qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Fix double backslash problem in Windows


From: andrzej zaborowski
Subject: Re: [Qemu-devel] [PATCH] Fix double backslash problem in Windows
Date: Wed, 9 Jan 2008 13:44:10 +0100

On 09/01/2008, Laurent Vivier <address@hidden> wrote:
> Le mercredi 09 janvier 2008 à 11:40 +0100, andrzej zaborowski a écrit :
> > On 09/01/2008, Laurent Vivier <address@hidden> wrote:
> > > Le mercredi 09 janvier 2008 à 10:31 +0100, Laurent Vivier a écrit :
> > > > Le mardi 08 janvier 2008 à 17:17 +0100, Hervé Poussineau a écrit :
> > > > > Hi,
> > > > >
> > > > > On Windows, since December 2nd, files names provided in command line
> > > > > have to double their backslash to work correctly, for example: "-hda
> > > > > c:\\disks\\qemu.qcow" instead of -hda c:\disks\qemu.qcow"
> > > > > This patch removes this need and reverts back to Qemu 0.9.0 behaviour
> > > > >
> > > > > Hervé
> > > > >
> > > >
> > > > I have introduced this behavior to be able to use command line like
> > > > "qemu -hda my\ file", IMHO your patch should be #ifdef for window only.
> > >
> > > In fact, this is a wrong example, this case is managed by the shell.
> > > A good example is when we have a filename with a '"' in it:
> > >
> > > qemu -hda 2\\\"file
> > >
> > > to open file 2"file
> >
> > And the correct behaviour for that would be to open the file 2\"file, while
> >
> > qemu -hda 2\"file
> >
> > should open 2"file. The only character that we may need to handle
> > specially should be the comma, I don't know if anyone cares.
>
> You're right...
> but "-hda" is an alias for "-drive file="%s",index=%d,media=disk".

It should be an alias for "-drive file=%s,index=%d,media=disk"

>
> So when you type "qemu -hda 2\"file",
> it becomes "qemu -drive file="2"file",index=0,media=disk"
> which gives filename equal to "2file,index=0,media=disk" instead of
> filename equal to 2"file with option index and media.

" and \ should not be treated specially by -drive. This is what I
meant in the previous mails. So that the filename becomes 2"file
(everything up to the comma or end of string).

>
> So the '\' is needed, and you must have "qemu -hda 2\\\"file" to
> have "qemu -drive file="2\"file",index=0,media=disk" and then can
> extract filename to 2"file
>
> In the alias, file="%s" is needed to be able to manage filenames with
> spaces. for instance, if you don't have '"", you will have:
> qemu -hda "my file"
> -> qemu -drive file=my file,index=0,media=disk
> and thus filename is "my"...

It should be everything up to the comma, treating spaces specially
gives you nothing.
Regards

reply via email to

[Prev in Thread] Current Thread [Next in Thread]