Received: from eggs.gnu.org ([2001:4830:134:3::10]:58087) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brqpM-0002wc-1M for qemu-devel@nongnu.org; Wed, 05 Oct 2016 14:22:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1brqpK-00024A-Ms for qemu-devel@nongnu.org; Wed, 05 Oct 2016 14:21:59 -0400 References: <1475659573-1664-1-git-send-email-kwolf@redhat.com> <1475659573-1664-4-git-send-email-kwolf@redhat.com> From: Max Reitz Message-ID: <68d0655b-402c-ac92-0e1d-79440cfb2f6c@redhat.com> Date: Wed, 5 Oct 2016 20:21:49 +0200 MIME-Version: 1.0 In-Reply-To: <1475659573-1664-4-git-send-email-kwolf@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="9JSTXG8xFvEUVH8lkHErn4KlKrAqoDnDf" Subject: Re: [Qemu-devel] [PATCH 3/3] block: Add qdev ID to DEVICE_TRAY_MOVED List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-block@nongnu.org Cc: eblake@redhat.com, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --9JSTXG8xFvEUVH8lkHErn4KlKrAqoDnDf From: Max Reitz To: Kevin Wolf , qemu-block@nongnu.org Cc: eblake@redhat.com, qemu-devel@nongnu.org Message-ID: <68d0655b-402c-ac92-0e1d-79440cfb2f6c@redhat.com> Subject: Re: [PATCH 3/3] block: Add qdev ID to DEVICE_TRAY_MOVED References: <1475659573-1664-1-git-send-email-kwolf@redhat.com> <1475659573-1664-4-git-send-email-kwolf@redhat.com> In-Reply-To: <1475659573-1664-4-git-send-email-kwolf@redhat.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 05.10.2016 11:26, Kevin Wolf wrote: > The event currently only contains the BlockBackend name. However, with > anonymous BlockBackends, this is always the empty string. Add the qdev > ID (or if none was given, the QOM path) so that the user can still see > which device caused the event. >=20 > Event generation has to be moved from bdrv_eject() to the BlockBackend > because the BDS doesn't know the attached device, but that's easy > because blk_eject() is the only user of it. >=20 > Signed-off-by: Kevin Wolf > --- > block.c | 7 ------- > block/block-backend.c | 33 ++++++++++++++++++++++++++++++++- > docs/qmp-commands.txt | 3 +++ > docs/qmp-events.txt | 6 +++++- > qapi/block.json | 8 ++++++-- > 5 files changed, 46 insertions(+), 11 deletions(-) I didn't even know we use the same event for both virtual and physical trays. Fun, fun. Even more fun in that blk_eject() always issues the event, regardless of whether there actually is a physical tray. Therefore, I assume it's effectively just an event for the virtual tray which has to hook up in blk_eject() because a guest eject won't go through blk_dev_change_media_cb(), but it will go through blk_eject() (which QMP ejects do not). Totally makes sense. Reviewed-by: Max Reitz --9JSTXG8xFvEUVH8lkHErn4KlKrAqoDnDf Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEvBAEBCAAZBQJX9US9EhxtcmVpdHpAcmVkaGF0LmNvbQAKCRD0B9sAYdXPQBay B/9sMSWpIWOc1mGzL6iOI0i5ICqp1uhWTap+0vLWg1wVM9/S35Z1eQlWa107WcIQ dcjfzHeDc/w+OIOMPEfIp+g6iQVyjr9QoVfZUv/XVmrbMyolm6TLqUhgjD6MkkGB 7K7ST/jqjs83QFiThrzqCvk5htP8sTOh3J5zCzTFroV460bnsDvugdYKhpH2wA5E lE5QyB2ONxwIWZBtNipMUPXTBO4DljDjeI3qqvZ0Yj/qKLBtMhwGbGVwJRAp+jWt V6XGid+cXAlReTWbW0GfbPZmfUgvRiCVan4BLqaNmofcspAOUx4SdQ2/pMY1s0CZ jXkldZd1xHZJHH9pkVAuZ3MO =XUx5 -----END PGP SIGNATURE----- --9JSTXG8xFvEUVH8lkHErn4KlKrAqoDnDf--