qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jamie Lokier <jamie@shareable.org>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: Kevin Wolf <kwolf@redhat.com>,
	alex@csgraf.de, nolan@sigbus.net, Avi Kivity <avi@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Add HTTP protocol using curl v2
Date: Fri, 8 May 2009 18:00:54 +0100	[thread overview]
Message-ID: <20090508170054.GB8681@shareable.org> (raw)
In-Reply-To: <4A01C023.7060902@codemonkey.ws>

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	other threads:[~2009-05-08 17:01 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-06  1:00 [Qemu-devel] [PATCH] Add HTTP protocol using curl v2 alex
2009-05-06  8:28 ` Daniel P. Berrange
2009-05-06  9:14   ` Kevin Wolf
2009-05-06  9:31     ` Daniel P. Berrange
2009-05-06  9:40       ` Alexander Graf
2009-05-06  9:57       ` Avi Kivity
2009-05-06 10:00         ` Kevin Wolf
2009-05-06 10:06         ` Daniel P. Berrange
2009-05-06 10:13           ` Daniel P. Berrange
2009-05-06 10:15             ` Avi Kivity
2009-05-06 10:15             ` Alexander Graf
2009-05-06 13:11               ` Anthony Liguori
2009-05-06 10:16             ` Kevin Wolf
2009-05-06 10:23               ` Alexander Graf
2009-05-06 10:24               ` Daniel P. Berrange
2009-05-06 10:09         ` Alexander Graf
2009-05-06 13:09         ` Anthony Liguori
2009-05-06 13:59           ` Avi Kivity
2009-05-06 14:08             ` Anthony Liguori
2009-05-06 14:14               ` François Revol
2009-05-06 13:12         ` Anthony Liguori
2009-05-06 13:39           ` Daniel P. Berrange
2009-05-06 13:43             ` Anthony Liguori
2009-05-06 13:50             ` Kevin Wolf
2009-05-06 13:59               ` Anthony Liguori
2009-05-06 14:11                 ` Kevin Wolf
2009-05-06 14:39                   ` Anthony Liguori
2009-05-06 14:48                     ` Alexander Graf
2009-05-06 14:49                     ` Avi Kivity
2009-05-06 16:51                       ` Anthony Liguori
2009-05-08 17:00                         ` Jamie Lokier [this message]
2009-05-06 14:49                     ` Kevin Wolf
2009-05-06 13:08       ` Anthony Liguori
2009-05-06 10:43     ` Jamie Lokier
2009-05-06 12:59   ` Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090508170054.GB8681@shareable.org \
    --to=jamie@shareable.org \
    --cc=alex@csgraf.de \
    --cc=anthony@codemonkey.ws \
    --cc=avi@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=nolan@sigbus.net \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).