From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M2TRc-0007NE-6e for qemu-devel@nongnu.org; Fri, 08 May 2009 13:01:08 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M2TRX-0007LL-GJ for qemu-devel@nongnu.org; Fri, 08 May 2009 13:01:07 -0400 Received: from [199.232.76.173] (port=54749 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M2TRX-0007LE-9g for qemu-devel@nongnu.org; Fri, 08 May 2009 13:01:03 -0400 Received: from mail2.shareable.org ([80.68.89.115]:46824) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M2TRW-0003UD-PR for qemu-devel@nongnu.org; Fri, 08 May 2009 13:01:02 -0400 Date: Fri, 8 May 2009 18:00:54 +0100 From: Jamie Lokier Subject: Re: [Qemu-devel] [PATCH] Add HTTP protocol using curl v2 Message-ID: <20090508170054.GB8681@shareable.org> References: <20090506093143.GC23167@redhat.com> <4A015F06.7050102@redhat.com> <4A018CD8.6000200@codemonkey.ws> <20090506133920.GK23167@redhat.com> <4A0195A3.7090205@redhat.com> <4A0197D9.9010109@codemonkey.ws> <4A019A87.7090505@redhat.com> <4A01A13F.6070001@codemonkey.ws> <4A01A36D.7010704@redhat.com> <4A01C023.7060902@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A01C023.7060902@codemonkey.ws> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Kevin Wolf , alex@csgraf.de, nolan@sigbus.net, Avi Kivity , qemu-devel@nongnu.org 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