From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49510) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCRNZ-0007Y7-QH for qemu-devel@nongnu.org; Tue, 07 Jul 2015 07:49:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCRNV-0004Tk-Ai for qemu-devel@nongnu.org; Tue, 07 Jul 2015 07:49:37 -0400 Date: Tue, 7 Jul 2015 12:49:28 +0100 From: Stefan Hajnoczi Message-ID: <20150707114928.GA2405@stefanha-thinkpad.redhat.com> References: <19df383991831bad31163fa0053f996284eeedec.1435934626.git.DirtY.iCE.hu@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5mCyUwZo2JvN/JJP" Content-Disposition: inline In-Reply-To: <19df383991831bad31163fa0053f996284eeedec.1435934626.git.DirtY.iCE.hu@gmail.com> Subject: Re: [Qemu-devel] [Qemu-block] [PATCH v2] opts: produce valid command line in qemu_opts_print List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?utf-8?B?S8WRdsOhZ8OzLCBab2x0w6Fu?= Cc: qemu-trivial@nongnu.org, Kevin Wolf , qemu-devel@nongnu.org, "open list:Block layer core" , Markus Armbruster --5mCyUwZo2JvN/JJP Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 03, 2015 at 04:45:36PM +0200, K=C5=91v=C3=A1g=C3=B3, Zolt=C3=A1= n wrote: > This will let us print options in a format that the user would actually > write it on the command line (foo=3Dbar,baz=3Dasd,etc=3Ddef), without > prepending a spurious comma at the beginning of the list, or quoting > values unnecessarily. This patch provides the following changes: > * write and id=3D, if the option has an id > * do not print separator before the first element > * do not quote string arguments > * properly escape commas (,) for QEMU >=20 > Signed-off-by: K=C5=91v=C3=A1g=C3=B3, Zolt=C3=A1n > Reviewed-by: Markus Armbruster > --- >=20 > Change from v1: > * updated escaped_print as suggested by Markus >=20 > block.c | 2 +- > util/qemu-option.c | 29 ++++++++++++++++++++++++++--- > 2 files changed, 27 insertions(+), 4 deletions(-) Looks good but please fix qemu-iotests so the test suite keeps passing: $ make && cd tests/qemu-iotests && ./check -qcow2 The test fixes must be in the same commit so the git commit history remains bisectable. --5mCyUwZo2JvN/JJP Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVm7zIAAoJEJykq7OBq3PIq7sH/iQq4NfOVNoPgSb2Ar/WTKBW 3ryaCwbG+1q089ZsbSSXeG5IDLCnWt7/x6Y0+iwppBGcVAblADFJec0pXVBSss99 mAomcs3akV9QbFUTY8dZ3QaDaDP1QnN7DrMrxL7McCYkRSkE7yFq2eo4IwwEgqAc XwndEUnQ6v4R05z/NpHcCFQghUQKlOpYutu+OnmOIkrWBI4Fxt1oem8mQ13Eq237 qozxdVH6fFyzOFJL9Oa4vU0+u/15Xqmyq6YNcnD5Ll6MLZLJIEAc8VIQU1jI4tCg pwGpMHAHCGqOTlB9prwCikWF/8+HG8mLYuMUI6W4ajc35vQxhzaiPIHvHMIzy48= =yIz2 -----END PGP SIGNATURE----- --5mCyUwZo2JvN/JJP--