From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkcTN-0005w6-V4 for qemu-devel@nongnu.org; Wed, 14 May 2014 12:56:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WkcTJ-00064J-0j for qemu-devel@nongnu.org; Wed, 14 May 2014 12:56:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29853) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkcTI-00064F-Qb for qemu-devel@nongnu.org; Wed, 14 May 2014 12:56:00 -0400 Message-ID: <5373A01E.8060500@redhat.com> Date: Wed, 14 May 2014 10:55:58 -0600 From: Eric Blake MIME-Version: 1.0 References: <1399538540-5076-1-git-send-email-mbooth@redhat.com> <1399538540-5076-2-git-send-email-mbooth@redhat.com> <53725664.7050904@redhat.com> <53739325.1030306@redhat.com> In-Reply-To: <53739325.1030306@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="RdQdLhQrj69dfqLP5CVxakSNTng07L117" Subject: Re: [Qemu-devel] [PATCH 1/4] curl: Fix parsing of readahead option from filename List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Matthew Booth , qemu-devel@nongnu.org Cc: kwolf@redhat.com, peter.maydell@linaro.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --RdQdLhQrj69dfqLP5CVxakSNTng07L117 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 05/14/2014 10:00 AM, Matthew Booth wrote: > On 13/05/14 13:29, Eric Blake wrote: >> On 05/08/2014 02:42 AM, Matthew Booth wrote: >>> curl_parse_filename wasn't removing the option string from the >>> url, resulting in a 404. >>> >>> This change is a rewrite of the previous parsing behaviour, and=20 >>> also changes the option syntax. The new syntax is: >>> >>> http://example.com/path?query[sslverify=3Doff:readahead=3D64k] >=20 >> Again, I'm not sure I'm happy with this - we shouldn't be inventing >> our own syntax when URI is already a well-defined syntax. >=20 > I don't understand. Are you suggesting adding the options as query > parameters to the URI? We obviously can't do that, because it would > change the URI. Neither can we assume that the URI will not contain > query parameters and we have them to ourselves. For example, vsphere > disk URIs, which is what I'm targetting, contain query parameters. I think the better suggestion has already been made elsewhere in the thread: _don't_ allow sslverify or readahead as parameters in the filename, but require them to be separate parameters. And don't add any new locally interpreted parameters in the filename. The filename should be passed, intact, to the curl command, and any additional parameters that affect how we use curl should be separate options rather than trying to encode them into the curl filename. We have the new json: string parsing to make it possible to encode a single string that includes both the curl filename URL and any separate options for contexts where an option must be supplied but encoded into a single strin= g. So, a proper command line would include something like: -drive "file.driver=3Dcurl,file.filename=3Dhttp://example.com/path?query...,file= =2Esslverify=3Doff,file.readahead=3D64k" and the URL passed to curl is passed verbatim, without trying to pack in any extra stuff needed locally. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --RdQdLhQrj69dfqLP5CVxakSNTng07L117 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTc6AeAAoJEKeha0olJ0Nqg/sH+QEqZINmFNcur8pXfCAc71Lf WZSEfs79z5HUYEWl2Am0lMl7z56a9qvgX9pNJesT4dav7S8j+gJi+FhB2vZzqG0Z 3eu701VFEb0mKvDwO4XQjyeegSZvbIgUMbbivy0lWEtGBKM9rA4KywceK2AeLpyW h5N5aQ/YlTnMhg9cYluZo05d69N6RfumQSt1xPFcNPAAdAqTIf95OFzCpvMYvU8B 7ZJjgmFMpG2rKrnKTDvUHWW/3XIZjv9N3Anzjka4FZkgiDorG0eiG3iP79/thCEZ GYM1F6lz0HGPum8SFMl5J5UTns0Na8BXnrf2/EHXT0jOndmGPLc/cefj0bUl+IM= =H+5r -----END PGP SIGNATURE----- --RdQdLhQrj69dfqLP5CVxakSNTng07L117--