From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54165) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPBBA-0005hJ-T1 for qemu-devel@nongnu.org; Mon, 18 Jul 2016 12:14:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPBB9-0007U2-M7 for qemu-devel@nongnu.org; Mon, 18 Jul 2016 12:14:00 -0400 References: <1468502894-18098-1-git-send-email-kwolf@redhat.com> <1468502894-18098-3-git-send-email-kwolf@redhat.com> <4140a13d-be94-525d-60ed-278a5e85a579@redhat.com> From: Eric Blake Message-ID: <578D003E.3020708@redhat.com> Date: Mon, 18 Jul 2016 10:13:50 -0600 MIME-Version: 1.0 In-Reply-To: <4140a13d-be94-525d-60ed-278a5e85a579@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="MoOmCjJnp5uMhIcl95MprjPr5G2K7RJrC" Subject: Re: [Qemu-devel] [PATCH v4 02/11] block: Accept node-name for block-commit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , Kevin Wolf , qemu-block@nongnu.org Cc: berto@igalia.com, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --MoOmCjJnp5uMhIcl95MprjPr5G2K7RJrC From: Eric Blake To: Max Reitz , Kevin Wolf , qemu-block@nongnu.org Cc: berto@igalia.com, qemu-devel@nongnu.org Message-ID: <578D003E.3020708@redhat.com> Subject: Re: [PATCH v4 02/11] block: Accept node-name for block-commit References: <1468502894-18098-1-git-send-email-kwolf@redhat.com> <1468502894-18098-3-git-send-email-kwolf@redhat.com> <4140a13d-be94-525d-60ed-278a5e85a579@redhat.com> In-Reply-To: <4140a13d-be94-525d-60ed-278a5e85a579@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 07/18/2016 07:38 AM, Max Reitz wrote: > On 14.07.2016 15:28, Kevin Wolf wrote: >> In order to remove the necessity to use BlockBackend names in the >> external API, we want to allow node-names everywhere. This converts >> block-commit to accept a node-name without lifting the restriction tha= t >> we're operating at a root node. >> >> As libvirt makes use of the DeviceNotFound error class, we must add >> explicit code to retain this behaviour because qmp_get_root_bs() only >> returns GenericErrors. >> >> @@ -3113,22 +3112,22 @@ void qmp_block_commit(bool has_job_id, const c= har *job_id, const char *device, >> * live commit feature versions; for this to work, we must make = sure to >> * perform the device lookup before any generic errors that may = occur in a >> * scenario in which all optional arguments are omitted. */ Isn't this the [tail end of the] comment... >> - blk =3D blk_by_name(device); >> - if (!blk) { >> - error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND, >> - "Device '%s' not found", device); >> + bs =3D qmp_get_root_bs(device, &local_err); >> + if (!bs) { >> + bs =3D bdrv_lookup_bs(device, device, NULL); >> + if (!bs) { >> + error_free(local_err); >> + error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND, >> + "Device '%s' not found", device); >> + } else { >> + error_propagate(errp, local_err); >> + } >=20 > I would have liked a comment here why this code exists; including an > explanation what libvirt uses DeviceNotFound for (i.e. for probing > whether qemu supports active commit). =2E..you are wanting? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --MoOmCjJnp5uMhIcl95MprjPr5G2K7RJrC 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 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXjQA+AAoJEKeha0olJ0NqZjsH/i1Tes+THFQvjFyea9Jr6sQk cKmcwbQjebBOCVcpdSsvAPfxFV3CY9yJUea0F2O774hSGZvN1QF8cVys0BEF0Vv7 NO7zRVts2PfHRISduHzNOAlr5FB+WKDkK+Mo4eYLjCuYUKAE77i0mQKsMVbrwnxW GF4eRKX6oi51FoyDMn9DLodabfb3R0UEW3fklOyfy//BzeAD/d1wT24qV1LN7JEb YRVuYhf8NrjXyDUj8vWqLW8SMG1f8ueO81E+pKLAN78FuL+9lRX2eGHCUpbXGl2h FgGuORXtyr3CqbgDT5Hy/hsgWvPRQjqimJ7ovf57HyrRISzJSm4sBtRFh15vfrI= =oRDA -----END PGP SIGNATURE----- --MoOmCjJnp5uMhIcl95MprjPr5G2K7RJrC--