[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 07/24] QMP: query-status: Add 'io-status' key
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 07/24] QMP: query-status: Add 'io-status' key |
Date: |
Fri, 14 Oct 2011 18:49:02 +0200 |
From: Luiz Capitulino <address@hidden>
Contains the I/O status for the given device. The key is only present
if the device supports it and the VM is configured to stop on errors.
Please, check the documentation being added in this commit for more
information.
Signed-off-by: Luiz Capitulino <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block.c | 12 ++++++++++++
qmp-commands.hx | 6 ++++++
2 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/block.c b/block.c
index 92ec2c3..40621b1 100644
--- a/block.c
+++ b/block.c
@@ -1893,6 +1893,12 @@ void bdrv_info_print(Monitor *mon, const QObject *data)
qlist_iter(qobject_to_qlist(data), bdrv_print_dict, mon);
}
+static const char *const io_status_name[BDRV_IOS_MAX] = {
+ [BDRV_IOS_OK] = "ok",
+ [BDRV_IOS_FAILED] = "failed",
+ [BDRV_IOS_ENOSPC] = "nospace",
+};
+
void bdrv_info(Monitor *mon, QObject **ret_data)
{
QList *bs_list;
@@ -1915,6 +1921,12 @@ void bdrv_info(Monitor *mon, QObject **ret_data)
qdict_put(bs_dict, "tray-open",
qbool_from_int(bdrv_dev_is_tray_open(bs)));
}
+
+ if (bdrv_iostatus_is_enabled(bs)) {
+ qdict_put(bs_dict, "io-status",
+ qstring_from_str(io_status_name[bs->iostatus]));
+ }
+
if (bs->drv) {
QObject *obj;
diff --git a/qmp-commands.hx b/qmp-commands.hx
index ea96191..9c11e87 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -1154,6 +1154,10 @@ Each json-object contain the following:
"tftp", "vdi", "vmdk", "vpc", "vvfat"
- "backing_file": backing file name (json-string, optional)
- "encrypted": true if encrypted, false otherwise (json-bool)
+- "io-status": I/O operation status, only present if the device supports it
+ and the VM is configured to stop on errors. It's always reset
+ to "ok" when the "cont" command is issued (json_string,
optional)
+ - Possible values: "ok", "failed", "nospace"
Example:
@@ -1161,6 +1165,7 @@ Example:
<- {
"return":[
{
+ "io-status": "ok",
"device":"ide0-hd0",
"locked":false,
"removable":false,
@@ -1173,6 +1178,7 @@ Example:
"type":"unknown"
},
{
+ "io-status": "ok",
"device":"ide1-cd0",
"locked":false,
"removable":true,
--
1.7.6.4
- [Qemu-devel] [PULL 00/24] Block patches, Kevin Wolf, 2011/10/14
- [Qemu-devel] [PATCH 01/24] block: allow resizing of images residing on host devices, Kevin Wolf, 2011/10/14
- [Qemu-devel] [PATCH 02/24] linux-aio: Fix laio_submit error handling, Kevin Wolf, 2011/10/14
- [Qemu-devel] [PATCH 03/24] block: Keep track of devices' I/O status, Kevin Wolf, 2011/10/14
- [Qemu-devel] [PATCH 04/24] virtio: Support I/O status, Kevin Wolf, 2011/10/14
- [Qemu-devel] [PATCH 05/24] ide: Support I/O status, Kevin Wolf, 2011/10/14
- [Qemu-devel] [PATCH 07/24] QMP: query-status: Add 'io-status' key,
Kevin Wolf <=
- [Qemu-devel] [PATCH 08/24] HMP: Print 'io-status' information, Kevin Wolf, 2011/10/14
- [Qemu-devel] [PATCH 09/24] block/vvfat: Fix potential memory leaks and other memory errors, Kevin Wolf, 2011/10/14
- [Qemu-devel] [PATCH 06/24] scsi: Support I/O status, Kevin Wolf, 2011/10/14
- [Qemu-devel] [PATCH 13/24] block: directly invoke .bdrv_* from emulation functions, Kevin Wolf, 2011/10/14
- [Qemu-devel] [PATCH 11/24] vvfat: Fix potential buffer overflow, Kevin Wolf, 2011/10/14
- [Qemu-devel] [PATCH 10/24] block/vvfat: Remove unused code, Kevin Wolf, 2011/10/14
- [Qemu-devel] [PATCH 12/24] block: directly invoke .bdrv_aio_*() in bdrv_co_io_em(), Kevin Wolf, 2011/10/14
- [Qemu-devel] [PATCH 14/24] block: split out bdrv_co_do_readv() and bdrv_co_do_writev(), Kevin Wolf, 2011/10/14
- [Qemu-devel] [PATCH 15/24] block: switch bdrv_read()/bdrv_write() to coroutines, Kevin Wolf, 2011/10/14