From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58912) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xoew9-0006XQ-MB for qemu-devel@nongnu.org; Wed, 12 Nov 2014 15:54:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xoew4-00019O-O1 for qemu-devel@nongnu.org; Wed, 12 Nov 2014 15:54:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53816) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xoew4-00019K-F2 for qemu-devel@nongnu.org; Wed, 12 Nov 2014 15:54:40 -0500 Message-ID: <5463C905.6010005@redhat.com> Date: Wed, 12 Nov 2014 13:54:29 -0700 From: Eric Blake MIME-Version: 1.0 References: <1415697825-26678-1-git-send-email-mreitz@redhat.com> <1415697825-26678-2-git-send-email-mreitz@redhat.com> In-Reply-To: <1415697825-26678-2-git-send-email-mreitz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6AwqNFfWCQ4QmAFBVjvbhDUvBx9shDhIG" Subject: Re: [Qemu-devel] [PATCH v3 1/2] blkdebug: Simplify and improve filename generation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-devel@nongnu.org Cc: Kevin Wolf , Peter Lieven , Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --6AwqNFfWCQ4QmAFBVjvbhDUvBx9shDhIG Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/11/2014 02:23 AM, Max Reitz wrote: > Instead of actually recreating the options from scratch, just reuse the= > options given for creating the BDS, which are the configuration file > name and additional options. In case there are no additional options we= > can thus create a plain filename. >=20 > This obviously results in a different output for qemu-iotest 099 which > exactly tests this filename generation. Fix it up as well. >=20 > Signed-off-by: Max Reitz > --- > block/blkdebug.c | 99 +++++++++++++-------------------------= -------- > tests/qemu-iotests/099.out | 4 +- > 2 files changed, 30 insertions(+), 73 deletions(-) >=20 > + if (!force_json && bs->file->exact_filename[0]) { > + snprintf(bs->exact_filename, sizeof(bs->exact_filename), > + "blkdebug:%s:%s", > + qdict_get_try_str(bs->options, "config") ?: "", This is one case where I _like_ the fact that we allow the gcc extension operator. It's so much more verbose to store the function call result into a temporary to avoid calling it twice. Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --6AwqNFfWCQ4QmAFBVjvbhDUvBx9shDhIG 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 iQEcBAEBCAAGBQJUY8kFAAoJEKeha0olJ0NqlHYH/i8ATNohokd/NneJnjOHwEbI yKaHT1M4z1c7bNu7iUJvq3MLSB8N/Luz4drXcW0W3xAteGyEVzy5SHHx9ycP00sR u7dNPVf7zptpEOQS8Cz2VrEbgkzeSYEAxZpUeNF449mRSUA6ZIHbcopO8pXLp4eg hYjoX7yWaxeqvLnw3Bd2xbk5E+CFamP32kFczBDx3isZFFCJLpmAuYca3oxt8YTC aC+t9Kn1fjSAYCF4crjCwjabpkHDss8b7Ls18sVrL1Scgx/sRc0OW0nxclHN0435 lXAY5wgivvPBuZYj+wbYjSVjBEENIKzjA4vY54fq8347CY6+t1Uni70FuRXkWDk= =ZPNL -----END PGP SIGNATURE----- --6AwqNFfWCQ4QmAFBVjvbhDUvBx9shDhIG--