From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45206) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8W9l-00023S-Nt for qemu-devel@nongnu.org; Mon, 14 Dec 2015 11:39:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a8W9k-0006a5-QK for qemu-devel@nongnu.org; Mon, 14 Dec 2015 11:39:25 -0500 References: <1449883528-26477-1-git-send-email-jsnow@redhat.com> <1449883528-26477-3-git-send-email-jsnow@redhat.com> <566EF00B.1050403@redhat.com> <566EF079.3020800@redhat.com> From: Max Reitz Message-ID: <566EF0A7.8090904@redhat.com> Date: Mon, 14 Dec 2015 17:39:03 +0100 MIME-Version: 1.0 In-Reply-To: <566EF079.3020800@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="c66QiG4fH2gl9CboQvv85kPPjAl7pjchh" Subject: Re: [Qemu-devel] [PATCH v2 2/4] block/qapi: always report full_backing_filename List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow , qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --c66QiG4fH2gl9CboQvv85kPPjAl7pjchh Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 14.12.2015 17:38, John Snow wrote: >=20 >=20 > On 12/14/2015 11:36 AM, Max Reitz wrote: >> On 12.12.2015 02:25, John Snow wrote: >>> Always report full_backing_filename, even if it's the same as >>> backing_filename. In the next patch, full_backing_filename may be >>> omitted if it cannot be generated instead of allowing e.g. drive_quer= y >>> to abort if it runs into this scenario. >>> >>> The presence or absence of the "full" field becomes useful informatio= n. >>> >>> Signed-off-by: John Snow >>> --- >>> block/qapi.c | 7 ++++--- >>> tests/qemu-iotests/043.out | 2 ++ >>> 2 files changed, 6 insertions(+), 3 deletions(-) >>> >>> diff --git a/block/qapi.c b/block/qapi.c >>> index 01569da..0e6b333 100644 >>> --- a/block/qapi.c >>> +++ b/block/qapi.c >>> @@ -251,9 +251,10 @@ void bdrv_query_image_info(BlockDriverState *bs,= >>> return; >>> } >>> =20 >>> - if (strcmp(backing_filename, backing_filename2) !=3D 0) { >>> - info->full_backing_filename =3D >>> - g_strdup(backing_filename2); >>> + /* Always report the full_backing_filename if present, even = if it's the >>> + * same as backing_filename. That they are same is useful in= fo. */ >>> + if (backing_filename2) { >> >> Is there a reason for this non-NULL check? Because it always is non-NU= LL >> right now. >> >> Max >> >=20 > No, I was just being convenient with re-ordering patches. It can be NUL= L > by the end of the set. I'll clean it if there's other work to do. Oh, OK, that's fine then. Reviewed-by: Max Reitz >=20 >>> + info->full_backing_filename =3D g_strdup(backing_filenam= e2); >>> info->has_full_backing_filename =3D true; >>> } >>> =20 >>> diff --git a/tests/qemu-iotests/043.out b/tests/qemu-iotests/043.out >>> index 33f8cc3..b37d2a3 100644 >>> --- a/tests/qemu-iotests/043.out >>> +++ b/tests/qemu-iotests/043.out >>> @@ -44,6 +44,7 @@ cluster_size: 65536 >>> "filename": "TEST_DIR/t.IMGFMT", >>> "cluster-size": 65536, >>> "format": "IMGFMT", >>> + "full-backing-filename": "TEST_DIR/t.IMGFMT.2.base", >>> "backing-filename": "TEST_DIR/t.IMGFMT.2.base", >>> "dirty-flag": false >>> }, >>> @@ -52,6 +53,7 @@ cluster_size: 65536 >>> "filename": "TEST_DIR/t.IMGFMT.2.base", >>> "cluster-size": 65536, >>> "format": "IMGFMT", >>> + "full-backing-filename": "TEST_DIR/t.IMGFMT.1.base", >>> "backing-filename": "TEST_DIR/t.IMGFMT.1.base", >>> "dirty-flag": false >>> }, >>> >> >> >=20 --c66QiG4fH2gl9CboQvv85kPPjAl7pjchh Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJWbvCnAAoJEDuxQgLoOKytgqkH/jk0paMUlyX4t+Glt218ej7t HAc/uPj9lqiJcrg09RDVbxIMh+ZSvKo+839b12/ffnkX9cXDkD4pmF2a4KifzuN6 gOFFBfCN1FsoghJiTH0M/eJZqTHAVMAdnFDjJgF6rZE1z3o6Ti358TirohXYwtSa BNR5Can9qssoI4Udv9QPNNaTqVbC4KBnosFG2L2fcNX+KWXOg4UPBrY2kr0rUZPH c/OYKaBzj3zl9awsgQgbK5RKprpuSeQ/tLt8JrX644xbA5vx0HHTUoI6p4xt0mo+ XOlq1kl1dTdU0lSXq1UEJdn6JMXrnnBSv/zbF8i0DjhZLQ3iAkNSwlTKLLEQAhY= =u3IW -----END PGP SIGNATURE----- --c66QiG4fH2gl9CboQvv85kPPjAl7pjchh--