The event currently only contains the BlockBackend name. However, with
anonymous BlockBackends, this is always the empty string. Add the node
name so that the user can still see which block device caused the event.
Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: Max Reitz <[email protected]>
IoOperationType optype;
optype = is_read ? IO_OPERATION_TYPE_READ : IO_OPERATION_TYPE_WRITE;
- qapi_event_send_block_io_error(blk_name(blk), optype, action,
- blk_iostatus_is_enabled(blk),
+ qapi_event_send_block_io_error(blk_name(blk),
+ bdrv_get_node_name(blk_bs(blk)), optype,
+ action, blk_iostatus_is_enabled(blk),
error == ENOSPC, strerror(error),
&error_abort);
}
Data:
-- "device": device name (json-string)
+- "device": device name. This is always present for compatibility
+ reasons, but it can be empty ("") if the image does not
+ have a device name associated. (json-string)
+- "node-name": node name. Note that errors may be reported for the root node
+ that is directly attached to a guest device rather than for the
+ node where the error occurred. (json-string)
- "operation": I/O operation (json-string, "read" or "write")
- "action": action that has been taken, it's one of the following (json-string):
"ignore": error has been ignored
{ "event": "BLOCK_IO_ERROR",
"data": { "device": "ide0-hd1",
+ "node-name": "#block212",
"operation": "write",
"action": "stop" },
"timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
#
# Emitted when a disk I/O error occurs
#
-# @device: device name
+# @device: device name. This is always present for compatibility
+# reasons, but it can be empty ("") if the image does not
+# have a device name associated.
+#
+# @node-name: node name. Note that errors may be reported for the root node
+# that is directly attached to a guest device rather than for the
+# node where the error occurred. (Since: 2.8)
#
# @operation: I/O operation
#
# Since: 0.13.0
##
{ 'event': 'BLOCK_IO_ERROR',
- 'data': { 'device': 'str', 'operation': 'IoOperationType',
+ 'data': { 'device': 'str', 'node-name': 'str', 'operation': 'IoOperationType',
'action': 'BlockErrorAction', '*nospace': 'bool',
'reason': 'str' } }