From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59568) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGwru-0001a5-Vc for qemu-devel@nongnu.org; Fri, 21 Feb 2014 15:38:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGwrn-0003pw-Bw for qemu-devel@nongnu.org; Fri, 21 Feb 2014 15:38:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50876) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGwrn-0003pd-2c for qemu-devel@nongnu.org; Fri, 21 Feb 2014 15:38:39 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s1LKccLv030778 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 21 Feb 2014 15:38:38 -0500 Message-ID: <5307B94D.9090509@redhat.com> Date: Fri, 21 Feb 2014 13:38:37 -0700 From: Eric Blake MIME-Version: 1.0 References: <1392996248-26781-1-git-send-email-kwolf@redhat.com> <1392996248-26781-7-git-send-email-kwolf@redhat.com> In-Reply-To: <1392996248-26781-7-git-send-email-kwolf@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="MweLFuF19OqRRFQlD6FJLIab0mxuLmGHo" Subject: Re: [Qemu-devel] [PATCH v3 6/6] qemu-iotests: Check qemu-img command line parsing List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-devel@nongnu.org Cc: jcody@redhat.com, stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --MweLFuF19OqRRFQlD6FJLIab0mxuLmGHo Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 02/21/2014 08:24 AM, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf > --- > + > +# Try to trick qemu-img into creating escaped commas > +run_qemu_img amend -f $IMGFMT -o backing_file=3D"$TEST_IMG", -o help "= $TEST_IMG" > +run_qemu_img amend -f $IMGFMT -o backing_file=3D"$TEST_IMG" -o ,help "= $TEST_IMG" > +run_qemu_img amend -f $IMGFMT -o backing_file=3D"$TEST_IMG" -o ,, -o h= elp "$TEST_IMG" Interesting. The first two are definitely invalid, but the third is a case where if -o had an implicit first key name, then ',' would be the value of that key for the second -o. Maybe the trick in your patch 1 is to add a bool parameter to is_valid_option_list() that states whether the option accepts an implicit first key name: no key name starts with a comma, and leading comma is valid only if you can have an implicit key name. In this case, -o does not have an implicit first key name, so your test proves that you were right to reject the comma for our current usage. But again, until we actually have a client of is_valid_option_list that also cares about implicit first key name, this patch is fine as-is. Series: Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --MweLFuF19OqRRFQlD6FJLIab0mxuLmGHo 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/ iQEcBAEBCAAGBQJTB7lNAAoJEKeha0olJ0NqRxYIAKXrRusJeMz9MFYr1A8aCj2E AwPfKOFBRz6a17M30NxnXwLT1JIPwo4uYU2VYJBvH9vlxLVXMg1JxfjdBdZF4d7B tbQB8HZcPqS6Opyy3iEvChjnbCZl/sJ/kGXBlI+5Fb0SYpgrznz6F4a5paay39Dr wKtEDZYnIVDG0cJ20hvxqkk95ZnOpmmveesZuZpaa96Jy5/sfXAfozLcpG28SRDG QIc9yWIC80vyIdsCWudoPxDwkq7Hi+EJSFNCpU9w4wGpFb0qKQiibcTN6r9a8ExO YZ6Y12QknGYlNF6Gs+nYqXIWJ8crzT7x9MY/lMjj7daUCHTeOxqdqCeILqKzQ8c= =44vO -----END PGP SIGNATURE----- --MweLFuF19OqRRFQlD6FJLIab0mxuLmGHo--