From 2d76e724cf9e3f9fec6070a8af79c7ee4c2e763e Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Thu, 29 Sep 2016 18:30:53 +0200 Subject: block: Add qdev ID to DEVICE_TRAY_MOVED 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 Reviewed-by: Max Reitz --- qapi/block.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'qapi') diff --git a/qapi/block.json b/qapi/block.json index c896bd1..4661fc9 100644 --- a/qapi/block.json +++ b/qapi/block.json @@ -195,14 +195,18 @@ # Emitted whenever the tray of a removable device is moved by the guest or by # HMP/QMP commands # -# @device: device name +# @device: Block device name. This is always present for compatibility +# reasons, but it can be empty ("") if the image does not +# have a device name associated. +# +# @id: The name or QOM path of the guest device # # @tray-open: true if the tray has been opened or false if it has been closed # # Since: 1.1 ## { 'event': 'DEVICE_TRAY_MOVED', - 'data': { 'device': 'str', 'tray-open': 'bool' } } + 'data': { 'device': 'str', 'id': 'str', 'tray-open': 'bool' } } ## # @QuorumOpType -- cgit v1.1