From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60037) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZI9O-0004sh-DU for qemu-devel@nongnu.org; Fri, 26 Feb 2016 08:09:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aZI9N-0002kW-KG for qemu-devel@nongnu.org; Fri, 26 Feb 2016 08:09:42 -0500 References: <1456247799-9593-1-git-send-email-kwolf@redhat.com> <1456247799-9593-3-git-send-email-kwolf@redhat.com> <56CDEE65.3060906@redhat.com> <20160224182319.GH4485@noname.redhat.com> From: Max Reitz Message-ID: <56D04E88.8050406@redhat.com> Date: Fri, 26 Feb 2016 14:09:28 +0100 MIME-Version: 1.0 In-Reply-To: <20160224182319.GH4485@noname.redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wmTTlgg6bQ2QKFGNoRmi6j6JEVl2MNGpl" 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 Cc: pkrempa@redhat.com, armbru@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --wmTTlgg6bQ2QKFGNoRmi6j6JEVl2MNGpl Content-Type: multipart/mixed; boundary="ctBgvURVVIoaQmEwUUTJS0sQJB5jCBetv" From: Max Reitz To: Kevin Wolf Cc: qemu-block@nongnu.org, armbru@redhat.com, pkrempa@redhat.com, eblake@redhat.com, qemu-devel@nongnu.org Message-ID: <56D04E88.8050406@redhat.com> Subject: Re: [PATCH 2/2] hmp: Extend drive_del to delete nodes without BB References: <1456247799-9593-1-git-send-email-kwolf@redhat.com> <1456247799-9593-3-git-send-email-kwolf@redhat.com> <56CDEE65.3060906@redhat.com> <20160224182319.GH4485@noname.redhat.com> In-Reply-To: <20160224182319.GH4485@noname.redhat.com> --ctBgvURVVIoaQmEwUUTJS0sQJB5jCBetv Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 24.02.2016 19:23, Kevin Wolf wrote: > 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 al= so >>> want to be able to delete such nodes again. >>> >>> Signed-off-by: Kevin Wolf >>> --- >>> blockdev.c | 9 +++++++++ >>> 1 file changed, 9 insertions(+) >>> >>> 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 *= qdict) >>> 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); >>> >> >> 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; especiall= y >> because x-blockdev-del uses "node-name", too. >=20 > 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? No, it's just me being confused again by the way HMP works. I keep forgetting that the user doesn't specify the parameter names. So the R-b stands. :-) Max --ctBgvURVVIoaQmEwUUTJS0sQJB5jCBetv-- --wmTTlgg6bQ2QKFGNoRmi6j6JEVl2MNGpl 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 iQEcBAEBCAAGBQJW0E6IAAoJEDuxQgLoOKytkUAH/jr0jzW2KFP/RkO598MJvmVg dRj9EYcb+/l08XPUgPffuf1FGP3bd2VTMvVgbNVnDlYdkAziuccrhH2KBgxJjw66 snhGq5TMsafc1F0JgceJ9QrpWVcnLAnoYwt4tnHnHDRC1Q2O7TgyiYWlEudZo22W Lc41rhWeC5fq5F3EwHwDjs0CAgkRwwLCtBSybmQwot2iqFPu/R+OpLUrCS5cYF3M Td1Y+OHt0pXHD66DSLH59LUOKpIeIlwgdWYqjt1B924MVND0wFq94t5fQO3Bos/n fQJOPtsZvQBmz5p8kYZnPmusN3iFtHCZEXnGDp8OOajHrw6YAHXCMYAnMvNL08c= =3c6h -----END PGP SIGNATURE----- --wmTTlgg6bQ2QKFGNoRmi6j6JEVl2MNGpl--