Received: from eggs.gnu.org ([2001:4830:134:3::10]:55229) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPBEC-0000fn-Iu for qemu-devel@nongnu.org; Mon, 18 Jul 2016 12:17:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPBEB-0008FU-Cs for qemu-devel@nongnu.org; Mon, 18 Jul 2016 12:17:08 -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> <578D003E.3020708@redhat.com> From: Max Reitz Message-ID: Date: Mon, 18 Jul 2016 18:16:55 +0200 MIME-Version: 1.0 In-Reply-To: <578D003E.3020708@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="eKuUeriqsXoIc4l6LNroLjjRLUaArXLHX" 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: Eric Blake , 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) --eKuUeriqsXoIc4l6LNroLjjRLUaArXLHX From: Max Reitz To: Eric Blake , Kevin Wolf , qemu-block@nongnu.org Cc: berto@igalia.com, qemu-devel@nongnu.org Message-ID: 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> <578D003E.3020708@redhat.com> In-Reply-To: <578D003E.3020708@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 18.07.2016 18:13, Eric Blake wrote: > 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 th= at >>> 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. >>> >=20 >>> @@ -3113,22 +3112,22 @@ void qmp_block_commit(bool has_job_id, const = char *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. */ >=20 > Isn't this the [tail end of the] comment... >=20 >>> - 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); >>> + } >> >> 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). >=20 > ...you are wanting? Hm! Indeed it is. No complaints left for this patch, then. Max --eKuUeriqsXoIc4l6LNroLjjRLUaArXLHX 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 iQEvBAEBCAAZBQJXjQD3EhxtcmVpdHpAcmVkaGF0LmNvbQAKCRA7sUIC6DisrRsp B/9pNrFCo2/Gyc4vJXvmpcBb3KVQ3mecVjuwzmVwUyqQl21R4YdrPLURpZ8lsBaf ly2/FISqBGmFvIoga1g3nWlrJoUjV14CJrPA5cDlepWaSu8Jq4zz7eLSVbX6seer 39ZW6tKJ3HI5gbg/NHWzoKeUsx39stufYehcKZKqpyq/3MbSu34B+/xwu2rgPqmB lLFylAPhrlS/KyLYJ2Jb2Tr4DQNW9RaDoB5fpdfBC4C/HeajqhfgGefZq+/UphrO ZyWZK7UUGlGhyKqfCTfK2ixr9bOQLZb8d1+CwmIA29WTSpj7d46Ch6sD/8SieQpG tTP5PZH95RaZ12buN524lABn =jVEH -----END PGP SIGNATURE----- --eKuUeriqsXoIc4l6LNroLjjRLUaArXLHX--