From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aW4Kg-0000Fa-5N for qemu-devel@nongnu.org; Wed, 17 Feb 2016 10:48:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aW4Kf-00052L-5U for qemu-devel@nongnu.org; Wed, 17 Feb 2016 10:48:02 -0500 References: <1455646106-2047-1-git-send-email-mreitz@redhat.com> <1455646106-2047-9-git-send-email-mreitz@redhat.com> <20160217141835.GG29494@noname.str.redhat.com> From: Max Reitz Message-ID: <56C49626.2020509@redhat.com> Date: Wed, 17 Feb 2016 16:47:50 +0100 MIME-Version: 1.0 In-Reply-To: <20160217141835.GG29494@noname.str.redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="tNGlwJGh4Jebs9Cg0VVf8MUmCR1ad48KA" Subject: Re: [Qemu-devel] [PATCH v3 08/14] blockdev: Remove blk_hide_on_behalf_of_hmp_drive_del() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Stefan Hajnoczi , qemu-devel@nongnu.org, qemu-block@nongnu.org, Markus Armbruster This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --tNGlwJGh4Jebs9Cg0VVf8MUmCR1ad48KA Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 17.02.2016 15:18, Kevin Wolf wrote: > Am 16.02.2016 um 19:08 hat Max Reitz geschrieben: >> This function first removed the BlockBackend from the blk_backends lis= t >> and cleared its name so it would no longer be found by blk_name(); sin= ce >> blk_next() now iterates through monitor_block_backends (which the BB i= s >> removed from in hmp_drive_del()), this is no longer necessary. >=20 > Not clearing the name any more means that you can't create a new > BlockBackend with the same ID until the hidden BB finally goes away. >=20 > As it happens, you already can't do that with drive_add, because we als= o > keep the ID reserved in the QemuOpts, so it's already broken today. > However, before this patch, you can still use blockdev-add to create a > new BB with the ID of a BB that drive_del removed; after it, you get an= > error: >=20 > {"error": {"class": "GenericError", "desc": "Device with id 'disk' > already exists"}} >=20 > In order to fix this, I suggested on IRC that we view the BB name as > belonging to the monitor reference logically, i.e. we add a name with > monitor_add_blk() (which would get a new ID parameter) and clear it > again in monitor_remove_blk(). Moving the @name parameter from blk_new() to monitor_add_blk() seems reasonable but would necessitate pulling in two patches from the follow-up series to this (there are places which try to emit the BB's name while its BDS is created, which these two patches change so they no longer do this). Alternatively, as I said, we might want to call monitor_add_blk() in blk_new() if the name is non-NULL (and allow NULL names). Max >> Second, bdrv_make_anon() was called on the BDS. This was intended for >> cases where the BDS was owned by that BB alone; in which case the BDS >> will no longer exist at this point thanks to the blk_remove_bs() in >> hmp_drive_del(). >> >> Therefore, this function does nothing useful anymore. Remove it. >> >> Signed-off-by: Max Reitz >=20 > Kevin >=20 --tNGlwJGh4Jebs9Cg0VVf8MUmCR1ad48KA 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 iQEcBAEBCAAGBQJWxJYmAAoJEDuxQgLoOKytOEgH/ipisLBITkKl746JCgnAIS5u bxgPVx+NYc28wY8Oq0OmQ7F+K8/O4DcJyylkxn7baJBogTm/ayHS1Xm4/xnFWYgB 6ibtb4TLUXOne1m2afxjaQ9CPpyCKCwNQQweLFVWua25YQ6frxLGuXYUQsn/Qmr0 MODhptfzQ4A2aB0VfmOYClbskwRK1sOvR2fRHUGkwnpcKXy84htxrkeTqJVYKW1h 3h/CIOkq7tpWQrFs0hJBUeilPB2J/i/RFhNfruMrIicQAH5jucusiT0ivnB9vOoi Ir+b1FaNuw7XEopNQvhzH3AtVMivW8wcdnvidCyxNtb5NAIDZ5oskodPUMF76mc= =tfaY -----END PGP SIGNATURE----- --tNGlwJGh4Jebs9Cg0VVf8MUmCR1ad48KA--