From 2bf7e10f78ebf67fbef364dce37ae844ba3c7a62 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Thu, 29 Sep 2016 16:47:58 +0200 Subject: block: Add node name to BLOCK_IO_ERROR event 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 Reviewed-by: Max Reitz --- docs/qmp-events.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/qmp-events.txt b/docs/qmp-events.txt index 7967ec4..62a9f9c 100644 --- a/docs/qmp-events.txt +++ b/docs/qmp-events.txt @@ -65,7 +65,12 @@ Emitted when a disk I/O error occurs. 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 @@ -76,6 +81,7 @@ Example: { "event": "BLOCK_IO_ERROR", "data": { "device": "ide0-hd1", + "node-name": "#block212", "operation": "write", "action": "stop" }, "timestamp": { "seconds": 1265044230, "microseconds": 450486 } } -- cgit v1.1 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 --- docs/qmp-commands.txt | 3 +++ docs/qmp-events.txt | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/qmp-commands.txt b/docs/qmp-commands.txt index e0adceb..e044029 100644 --- a/docs/qmp-commands.txt +++ b/docs/qmp-commands.txt @@ -3239,6 +3239,7 @@ Example: "microseconds": 716996 }, "event": "DEVICE_TRAY_MOVED", "data": { "device": "ide1-cd0", + "id": "ide0-1-0", "tray-open": true } } <- { "return": {} } @@ -3267,6 +3268,7 @@ Example: "microseconds": 272147 }, "event": "DEVICE_TRAY_MOVED", "data": { "device": "ide1-cd0", + "id": "ide0-1-0", "tray-open": false } } <- { "return": {} } @@ -3303,6 +3305,7 @@ Example: "microseconds": 549958 }, "event": "DEVICE_TRAY_MOVED", "data": { "device": "ide1-cd0", + "id": "ide0-1-0", "tray-open": true } } <- { "return": {} } diff --git a/docs/qmp-events.txt b/docs/qmp-events.txt index 62a9f9c..e0a2365 100644 --- a/docs/qmp-events.txt +++ b/docs/qmp-events.txt @@ -220,12 +220,16 @@ or by HMP/QMP commands. Data: -- "device": device name (json-string) +- "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. (json-string) +- "id": The name or QOM path of the guest device (json-string) - "tray-open": true if the tray has been opened or false if it has been closed (json-bool) { "event": "DEVICE_TRAY_MOVED", "data": { "device": "ide1-cd0", + "id": "/machine/unattached/device[22]", "tray-open": true }, "timestamp": { "seconds": 1265044230, "microseconds": 450486 } } -- cgit v1.1