From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53737) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8WhS-0001RO-PM for qemu-devel@nongnu.org; Mon, 14 Dec 2015 12:14:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a8WhR-00074p-IM for qemu-devel@nongnu.org; Mon, 14 Dec 2015 12:14:14 -0500 References: <1449883528-26477-1-git-send-email-jsnow@redhat.com> From: Max Reitz Message-ID: <566EF8D7.3050408@redhat.com> Date: Mon, 14 Dec 2015 18:13:59 +0100 MIME-Version: 1.0 In-Reply-To: <1449883528-26477-1-git-send-email-jsnow@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="eHGMAfbss5eBx0Lp4I4KFOA3V5MqIuIjd" Subject: Re: [Qemu-devel] [PATCH v2 0/4] block: allow partial info-block query 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) --eHGMAfbss5eBx0Lp4I4KFOA3V5MqIuIjd Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 12.12.2015 02:25, John Snow wrote: > Max: Did you have in mind something like this? What I had in mind was fixing the whole thing (the test case in 110 should actually work just fine, because you can easily determine the base directory to be used). ;-) I've been working on that myself anyway, so yes, regarding not aborting block-status if some full backing filename cannot be reconstructed, this looks good (by preventing qemu-img from resorting to the relative filename when querying the backing chain). There is a single thing I don't find quite perfect: $ mkdir -p foo $ ./qemu-img create -f qcow2 foo/base.qcow2 64M $ ./qemu-img create -f qcow2 -b base.qcow2 foo/top.qcow2 $ ./qemu-img info foo/top.qcow2 [...] backing file: base.qcow2 (actual path: foo/base.qcow2) [...] $ ./qemu-img info \ "json:{'lazy-refcounts':true,'file.filename':'foo/top.qcow2'}" [...] backing file: base.qcow2 [...] $ cd foo $ ../qemu-img info top.qcow2 [...] backing file: base.qcow2 [...] Before this series, there was only one case where the actual path information was missing: If it equals the raw relative filename. Now, there are two cases: As can be seen in the last invokation, it still will not be emitted if actual and raw filename are equal. But as you can see in the second invokation, it will be hidden also if it simply cannot be determined. Therefore, if the actual path information is missing, the user cannot determine[1] whether this is due to the actual path (relative to the CWD) is equal to the (raw) relative path to the overlay; or whether this is due to some error in determining the absolute filename. [1] You can by testing whether --backing-chain emits an error. But that is a bit crude. I think we should put a note there if an error occurred while determining the absolute backing filename. (Doing that is pretty simple: if (!info->has_full_backing_filename) { func_fprintf(f, " (cannot determine actual path)"); } else if (strcmp(...)) { func_fprintf(f, " (actual path: %s)", ...); } ) I think that should be an additional patch between 2 and 4. Max >=20 > v2: > - Fix qemu-img from now choking when it gets a partial response. >=20 > _______________________________________________________________________= _________ >=20 > For convenience, this branch is available at: > https://github.com/jnsnow/qemu.git branch block-allow-partial-query > https://github.com/jnsnow/qemu/tree/block-allow-partial-query >=20 > This version is tagged block-allow-partial-query-v2: > https://github.com/jnsnow/qemu/releases/tag/block-allow-partial-query-v= 2 >=20 > John Snow (4): > block/qapi: do not redundantly print "actual path" > block/qapi: always report full_backing_filename > qemu-img: abort when full_backing_filename not present > block/qapi: allow best-effort query >=20 > block/qapi.c | 18 +++++++++++------- > qemu-img.c | 5 ++++- > tests/qemu-iotests/043.out | 2 ++ > tests/qemu-iotests/110.out | 5 ++++- > 4 files changed, 21 insertions(+), 9 deletions(-) >=20 --eHGMAfbss5eBx0Lp4I4KFOA3V5MqIuIjd 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 iQEcBAEBCAAGBQJWbvjXAAoJEDuxQgLoOKytpr4H+weqBFCpg9yJ/Wx6MJzLpQio pBVPBhEruibiBrlvNOAHy8AIVkc/H5zsq+RHWvHDe45carvNf0oXV8jE5MPB+GEv wZl86ZacjyU19eDHbHmuJSTCTlsmKxMfHzTDYAn4Szi6ZnXimS/rrJJxNukWHtLY 5xssAVT7rSFVxNqav76HneH0oq040T83P1DTzRkQQHL7wiD4qNhv5JLgBZzQbjVl WOntGfQnD0A5fatdAiMbk12dkqzHP4msnW/AXjrDAOoZ6h48NSYjI4C8Cb/JQZxM 8lp1UmmYkJYJkS4SxSykWuTz5x5/VbQ6JzESnyjq7h/LcNnEyfzxsiDznckQOqs= =LB0r -----END PGP SIGNATURE----- --eHGMAfbss5eBx0Lp4I4KFOA3V5MqIuIjd--