From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53624) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYe5w-0001uf-4y for qemu-devel@nongnu.org; Wed, 24 Feb 2016 13:23:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aYe5v-0000qa-Af for qemu-devel@nongnu.org; Wed, 24 Feb 2016 13:23:28 -0500 Date: Wed, 24 Feb 2016 19:23:19 +0100 From: Kevin Wolf Message-ID: <20160224182319.GH4485@noname.redhat.com> References: <1456247799-9593-1-git-send-email-kwolf@redhat.com> <1456247799-9593-3-git-send-email-kwolf@redhat.com> <56CDEE65.3060906@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0OAP2g/MAC+5xKAE" Content-Disposition: inline In-Reply-To: <56CDEE65.3060906@redhat.com> 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: Max Reitz Cc: pkrempa@redhat.com, armbru@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org --0OAP2g/MAC+5xKAE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Am 24.02.2016 um 18:54 hat Max Reitz geschrieben: > 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 >=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. Not sure I understand. For the user of drive_del that's simply a positional parameter, so they use neither "id" nor "node-name". Am I missing something? Kevin > Up to your discretion. >=20 > Reviewed-by: Max Reitz >=20 --0OAP2g/MAC+5xKAE Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJWzfUXAAoJEH8JsnLIjy/WJ64P/3NX1NqvHtfOLTR2/stzLj9D s8OO5yL1HZLC5oBEK0jpI7NJnZdYuftRBZjdJMwWJ/hAkVl7zBmMGI1s4VR3OBoL YqlCcHxfpFVfvcN1BiMOAoDCyWuVUfPxrAW2VULGr3IQ7JmzYgQIT/smvRejdGmz rvQFNZU0x8Y50fbLSn/b4FQR10jU/LNd9IjoEm0U92s1iBAnEHtxBCg+5n+PjU/S gvJv6TFZVXtm39RhUBD3reUpoSqMWSdk+PylfTPp+wIrNI5I2E4eK1OA2OhSUJPQ YDNMWBfxpkPUwYP0Nw+gCzSSTfmGujgm5GgaZ6i0yCugippkCNstOj3IEJJtNFc5 BrqBQdv89PA73g9U74KUrgP16ij4JpAIH24bul4RsaSW++yWHF0WsFd4PEaFFrTZ 6xLXSctrnawoOXkGS6SPEG5ceYZPGlfaScFNYdyagPE04sl6aVcwAmURpeoF3TvW zGtK7LHt47u+d1wPTfMzn8ucx2GRgm7ZFVosm8ogi8cJxuq5sXo6QonK23VTUA04 OcePPoB8bsXDKBh4e0zS0lcO8HZixq3tQDX2AQJqIGhg1eyDFsFLFbJzULZMelKR vtpqvPQZIehMXkNTx9qK/yoVwEOI+lBx0O33YkrKW9ahIK7yBfsSHYUAsNFnzcdI L59e4XuhUCKkNDtGQJZk =r7my -----END PGP SIGNATURE----- --0OAP2g/MAC+5xKAE--