[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH][RFC] Handling ':' on filenames
From: |
Eduardo Habkost |
Subject: |
Re: [Qemu-devel] [PATCH][RFC] Handling ':' on filenames |
Date: |
Mon, 09 Mar 2009 11:27:53 -0300 |
User-agent: |
Sup/git |
Excerpts from kvm_autotest's message of Dom Mar 08 08:28:31 -0300 2009:
<snip>
> > ---
> > block.c | 8 ++++++++
> > 1 files changed, 8 insertions(+), 0 deletions(-)
> >
> > diff --git a/block.c b/block.c
> > index 7c744c7..04488d6 100644
> > --- a/block.c
> > +++ b/block.c
> > @@ -236,6 +236,14 @@ static BlockDriver *find_protocol(const char *filename)
> > is_windows_drive_prefix(filename))
> > return &bdrv_raw;
> > #endif
> > +
> > + /* Protocol name will never start with a slash.
> > + * This allows the user to specify absolute filenames
> > + * containing a ":" character.
> > + */
> > + if (*filename == '/')
> > + return &bdrv_raw;
>
> 3. The patch limits protocols names to not start with '/' (full paths).
> I think we should apply the same logic to relative paths, so
> protocol names would not start with '.' as well (no protocol
> starts with '.' today):
>
> + if ((*filename == '/') || (*filename == '.'))
> + return &bdrv_raw;
Is ':' a valid character for Windows filenames? In this case, we
may want to check for backslashes also.
The "./filename" approach for relative paths seems nice to complete the fix,
but I still see this is a workaround to a more fundamental problem.
>
> 4. Note that this patch does not limit image formats to raw, it
> just says "use no protocols for full/relative paths".
>
> > +
> > p = strchr(filename, ':');
> > if (!p)
> > return &bdrv_raw;
>
>
> Regards,
> Uri.
--
Eduardo