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 <kw...@redhat.com> > --- > 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 <mre...@redhat.com>
signature.asc
Description: OpenPGP digital signature