[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH 3/3] block: Add qdev ID to DEVICE_TRAY_MOVED
From: |
Max Reitz |
Subject: |
Re: [Qemu-block] [PATCH 3/3] block: Add qdev ID to DEVICE_TRAY_MOVED |
Date: |
Wed, 5 Oct 2016 20:21:49 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 |
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.
>
> 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.
>
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
> 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 <address@hidden>
signature.asc
Description: OpenPGP digital signature