[Top][All Lists]

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

Re: [Qemu-devel] [PATCH] Add HTTP protocol using curl v2

From: Jamie Lokier
Subject: Re: [Qemu-devel] [PATCH] Add HTTP protocol using curl v2
Date: Fri, 8 May 2009 18:00:54 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

Anthony Liguori wrote:
> Avi Kivity wrote:
> >Anthony Liguori wrote:
> >>>So what should the generic escaping look like?
> >>>  
> >>
> >>-drive file=my-silly\:filename\,with\ strange\ characters
> >>
> >>I see no reason to do anything overly complicated.  Of course, if 
> >>you're in a shell, you'll have to double escape unless you've got 
> >>single quotes around it.  That's a good argument for file: in 
> >>addition to escaping.
> >>
> >
> >With backslash escaping, I never know how many backslashes I end up 
> >with.  They're also the path separators in one OS.
> >
> >I'd go with URL separating:
> >
> >-drive file=file:my-silly%3afilename%2cwith%20strange%20characters
> URI escaping has some pretty strange rules because there set of 
> characters allowed in a URI is << what is representable in a shell 
> without requiring escaping.

There's no harm in accepting characters which aren't normally allowed
in a URI.  When _escaped_, any octet sequence can be encoded in a URI
so there's no problem there.

Backslash quoting in shell is easiest to type like this, using single
quotes around it:

    -drive 'file=my-silly\:filename\,with\ strange\ characters'

Backslash quoting is easier to do in shell scripts which are driving
QEMU, or driving QEMU's monitor.  I.e. using sed or printf %q in Bash:

    qpath=`printf %q "$path"`
    qemu -drive file="$qpath"

(I don't know why, but conveniently Bash's %q quotes commas).

-- Jamie

reply via email to

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