Received: from eggs.gnu.org ([2001:4830:134:3::10]:50030) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bK1MD-0007Eo-G3 for qemu-devel@nongnu.org; Mon, 04 Jul 2016 06:44:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bK1MB-0000NF-9K for qemu-devel@nongnu.org; Mon, 04 Jul 2016 06:44:04 -0400 Date: Mon, 4 Jul 2016 12:43:54 +0200 From: Kevin Wolf Message-ID: <20160704104354.GC5399@noname.redhat.com> References: <1467296007-12252-1-git-send-email-kwolf@redhat.com> <1467296007-12252-2-git-send-email-kwolf@redhat.com> <429dc8d6-bff3-6918-71cc-c03efbe6c604@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vkogqOf2sHV7VnPd" Content-Disposition: inline In-Reply-To: <429dc8d6-bff3-6918-71cc-c03efbe6c604@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 1/6] block/qdev: Allow node name for drive properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: qemu-block@nongnu.org, eblake@redhat.com, qemu-devel@nongnu.org --vkogqOf2sHV7VnPd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Am 02.07.2016 um 17:33 hat Max Reitz geschrieben: > On 30.06.2016 16:13, Kevin Wolf wrote: > > If a node name instead of a BlockBackend name is specified as the driver > > for a guest device, an anonymous BlockBackend is created now. > >=20 > > Signed-off-by: Kevin Wolf > > --- > > hw/core/qdev-properties-system.c | 22 +++++++++++++++++++--- > > 1 file changed, 19 insertions(+), 3 deletions(-) >=20 > I just noticed this won't work with (at least) USB mass storage devices. > scsi_bus_legacy_add_drive() creates a new device and uses > qdev_prop_set_drive() to set its drive, and that function uses > blk_name() to get the required value for .drive. >=20 > That can of course be fixed by using bdrv_get_node_name(blk_bs(value)) > there if blk_name(value) is empty. But in addition we need to make sure > that the BB is not deleted in usb_msd_realize_storage() (because that > function has to detach the device from the BB before creating the SCSI > disk), so we need to wrap the explicitly hacky block there in > blk_ref(blk) and blk_unref(blk). I'm not sure if I even want to fix this here... Maybe it's better to leave node names broken for usb-storage, as a motivation for someone to try and clean up this mess for good. I mean, it's not the first time that this hack breaks. Kevin --vkogqOf2sHV7VnPd Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJXej3qAAoJEH8JsnLIjy/WDU4QAKu0cco/s0WfuEXb3FuQy1Gp +xpZQX139QhY2KpUg8DxnLmXWL2TwE8nNSS0w4EWM1wKGbFnvudnPWwqbFvGEgji LQPKWdJGFXUgA1quKK3Pjm726GKpz1znLGHHLMwwnlNgyoTss28jbfSndwHaY9Ah 5y5r7wjeNpt4JhS+0x9tArzOz05/zRDKFt1LVlo8YHwKoV4TmOM1YxqecfmaQWoV QU90Xppwm7IbWlZTH6o02mCbybYUL7hzKsJEThSbN9aHcVav4UWkkHXXwcV9QHTE 1CCwJp9L2xkSn/Yo7i2Hd93qcljBcDkOldsTkt3TMVpF/Ycjgm5jnmmjQDT4tDy3 YGC/oBEM72pupTQM6YEElADR1cfdYT7HvgnYXQtoSAyrCoaG1UDnYmUUvtWmIOyf udrlU+4aF0m2KomNWhZNm8OuR96CiyV3J54AanMT9pOG8Uv4gwpQHOckTy9Hd/TB msBMpeDJYGFAE0Tq3bBbpXoCnZY5HzX6bI9eqK2uws4nJ9QK091FHaoecjVbbnsk TUhbCzKN0t5zwTvHft8VylGUSXPwcJ0wT2uTuS+/EPRY+vcqaCr5dLspXPRSAiYc NzhSPMvgfkXa6ICB+wD2gc7t2bldDsc8SRyRzoj58LcyU6n5vtQQfmO0Q/uLrffo MqDN1LfeZsIyXKYnj40b =vLIm -----END PGP SIGNATURE----- --vkogqOf2sHV7VnPd--