From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51960) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XnuR6-0006ih-66 for qemu-devel@nongnu.org; Mon, 10 Nov 2014 14:15:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XnuR0-0006NB-4Z for qemu-devel@nongnu.org; Mon, 10 Nov 2014 14:15:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42088) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XnuQz-0006N3-JK for qemu-devel@nongnu.org; Mon, 10 Nov 2014 14:15:29 -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 sAAJFSVq013772 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 10 Nov 2014 14:15:28 -0500 Message-ID: <54610ECF.4000301@redhat.com> Date: Mon, 10 Nov 2014 12:15:27 -0700 From: Eric Blake MIME-Version: 1.0 References: <1415638784-32311-1-git-send-email-mreitz@redhat.com> <1415638784-32311-2-git-send-email-mreitz@redhat.com> In-Reply-To: <1415638784-32311-2-git-send-email-mreitz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="eruth8XcOQsFFidvxH2cuI9Ck3K74QPg9" Subject: Re: [Qemu-devel] [PATCH v2 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 , Fam Zheng , Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --eruth8XcOQsFFidvxH2cuI9Ck3K74QPg9 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/10/2014 09:59 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 | 98 +++++++++++++-------------------------= -------- > tests/qemu-iotests/099.out | 4 +- > 2 files changed, 29 insertions(+), 73 deletions(-) >=20 > =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, "con= fig"), If there is no "config" entry, this can pass NULL as a %s counterpart to snprintf, which is undefined behavior (works on glibc, but might crash elsewhere). Everything else looked okay, but I'm afraid I may have given you reason to post a v3 and make a kitten cry :( --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --eruth8XcOQsFFidvxH2cuI9Ck3K74QPg9 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 iQEcBAEBCAAGBQJUYQ7PAAoJEKeha0olJ0Nq6bQH/jyyc4MjckvPXLUOC/yYehsQ keP5BjONIdKkF69DqQ0U5joEk6qkf5Eggh9lloXQPi1ct4e0j0vjllYOHt6rNFrQ zrQcRB1qSU1O87RBvAFsgwvlpqMhi1omIuH9YSmXj5DLJo3lfTJSQtusTP3giczq hSXwDr2hav/1f+ifH2X/0LuFoS4InugLq1pABeqWr7km2l7THSgKRG5HS521ZuzA MOEUubNLgcNII3PTwS2uf6k0BEv/PKvHx/fZWyR81q3AuHW0NRvBQFJOwL6c+Shz p8uoOzVfHtlJTuGgGedRt2Nj7c8Z/UeGxTAaeiBUAeJX8P/FfdFwh5j/HzOReyM= =EmBK -----END PGP SIGNATURE----- --eruth8XcOQsFFidvxH2cuI9Ck3K74QPg9--