From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41364) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYdeH-00045Q-Vp for qemu-devel@nongnu.org; Wed, 24 Feb 2016 12:54:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aYdeH-0007vK-52 for qemu-devel@nongnu.org; Wed, 24 Feb 2016 12:54:53 -0500 References: <1456247799-9593-1-git-send-email-kwolf@redhat.com> <1456247799-9593-3-git-send-email-kwolf@redhat.com> From: Max Reitz Message-ID: <56CDEE65.3060906@redhat.com> Date: Wed, 24 Feb 2016 18:54:45 +0100 MIME-Version: 1.0 In-Reply-To: <1456247799-9593-3-git-send-email-kwolf@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="58Pv5tuwAvFMMXVV0TLfcE2paHurnpgMH" Subject: Re: [Qemu-devel] [PATCH 2/2] hmp: Extend drive_del to delete nodes without BB List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-block@nongnu.org Cc: pkrempa@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --58Pv5tuwAvFMMXVV0TLfcE2paHurnpgMH Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 23.02.2016 18:16, Kevin Wolf wrote: > Now that we can use drive_add to create new nodes without a BB, we also= > want to be able to delete such nodes again. >=20 > Signed-off-by: Kevin Wolf > --- > blockdev.c | 9 +++++++++ > 1 file changed, 9 insertions(+) >=20 > diff --git a/blockdev.c b/blockdev.c > index 3f46bc1..b76b6cd 100644 > --- a/blockdev.c > +++ b/blockdev.c > @@ -2816,6 +2816,15 @@ void hmp_drive_del(Monitor *mon, const QDict *qd= ict) > AioContext *aio_context; > Error *local_err =3D NULL; > =20 > + bs =3D bdrv_find_node(id); > + if (bs) { > + qmp_x_blockdev_del(false, NULL, true, id, &local_err); > + if (local_err) { > + error_report_err(local_err); > + } > + return; > + } > + > blk =3D blk_by_name(id); > if (!blk) { > error_report("Device '%s' not found", id); >=20 It's a bit strange to require the user to specify the node name using "node-name" for drive_add, but the to use "id" in drive_del; especially because x-blockdev-del uses "node-name", too. Up to your discretion. Reviewed-by: Max Reitz --58Pv5tuwAvFMMXVV0TLfcE2paHurnpgMH 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 iQEcBAEBCAAGBQJWze5lAAoJEDuxQgLoOKytikgH/3UgZyeVlJXmhjnetS86OLti YpvV8T+xlkCFTYoIOpmFyYVkbCmn0NqnkKOBD1/WKzWp1TXTqgGT/NQWXXCmhIR1 yeqWrOOuRcg9yTCuChDWv4DHGYPlmjDjt8HyLvRme8Jnq7oIiJzpZEVdhVkrudXv vzalMAWiCNwBdt+a3qTF1HqU5GNolnICNOLkfBA7XzAT4IdgO4kM91hlLcOYAUk2 GABX0Xnm2yJxlci3WY/ctX2odRnxE/YwvZzX1zeHOTTVvSU5CG0XrL6DILfB5g0h 5DOKZqhRaPH0u9QYqfEbbvFbywm81c+XO8rZVMYSN/VG5kdO1Z0EBUY/NqB3Zkw= =o7Qq -----END PGP SIGNATURE----- --58Pv5tuwAvFMMXVV0TLfcE2paHurnpgMH--