[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 15/22] block: extend BLOCK_IO_ERROR with reason strin
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 15/22] block: extend BLOCK_IO_ERROR with reason string |
Date: |
Fri, 12 Sep 2014 17:56:59 +0200 |
From: Luiz Capitulino <address@hidden>
BLOCK_IO_ERROR events are logged by libvirt, which helps with
post mortem analysis of guests. However, one information that
we miss today is a human readable string describing the cause
of the I/O error.
This commit adds that string it to BLOCK_IO_ERROR. Note that
this string is a debugging aid for humans, meaning that it
should not parsed by applications.
Signed-off-by: Luiz Capitulino <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block.c | 3 ++-
qapi/block-core.json | 7 ++++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/block.c b/block.c
index dda5ae9..bcd952a 100644
--- a/block.c
+++ b/block.c
@@ -3647,7 +3647,8 @@ static void send_qmp_error_event(BlockDriverState *bs,
ac = is_read ? IO_OPERATION_TYPE_READ : IO_OPERATION_TYPE_WRITE;
qapi_event_send_block_io_error(bdrv_get_device_name(bs), ac, action,
bdrv_iostatus_is_enabled(bs),
- error == ENOSPC, &error_abort);
+ error == ENOSPC, strerror(error),
+ &error_abort);
}
/* This is done by device models because, while the block layer knows
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 68945c2..4064d5b 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -1593,6 +1593,10 @@
# io-status is present, please see query-block documentation
# for more information (since: 2.2)
#
+# @reason: human readable string describing the error cause.
+# (This field is a debugging aid for humans, it should not
+# be parsed by applications) (since: 2.2)
+#
# Note: If action is "stop", a STOP event will eventually follow the
# BLOCK_IO_ERROR event
#
@@ -1600,7 +1604,8 @@
##
{ 'event': 'BLOCK_IO_ERROR',
'data': { 'device': 'str', 'operation': 'IoOperationType',
- 'action': 'BlockErrorAction', '*nospace': 'bool' } }
+ 'action': 'BlockErrorAction', '*nospace': 'bool',
+ 'reason': 'str' } }
##
# @BLOCK_JOB_COMPLETED
--
1.8.3.1
- [Qemu-devel] [PULL 11/22] block: Make the block accounting functions operate on BlockAcctStats, (continued)
- [Qemu-devel] [PULL 11/22] block: Make the block accounting functions operate on BlockAcctStats, Kevin Wolf, 2014/09/12
- [Qemu-devel] [PULL 06/22] thread-pool: Drop unnecessary includes, Kevin Wolf, 2014/09/12
- [Qemu-devel] [PULL 08/22] block: Extract the BlockAcctStats structure, Kevin Wolf, 2014/09/12
- [Qemu-devel] [PULL 12/22] block/archipelago: Implement bdrv_truncate(), Kevin Wolf, 2014/09/12
- [Qemu-devel] [PULL 13/22] qemu-iotests: Run 025 for Archipelago block driver, Kevin Wolf, 2014/09/12
- [Qemu-devel] [PULL 14/22] dataplane: fix virtio_blk_data_plane_create() op blocker error path, Kevin Wolf, 2014/09/12
- [Qemu-devel] [PULL 17/22] iotests: Send the correct fd in socket_scm_helper, Kevin Wolf, 2014/09/12
- [Qemu-devel] [PULL 18/22] block: round up file size to nearest sector, Kevin Wolf, 2014/09/12
- [Qemu-devel] [PULL 16/22] blockdev: Refuse to drive_del something added with blockdev-add, Kevin Wolf, 2014/09/12
- [Qemu-devel] [PULL 19/22] block: don't convert file size to sector size, Kevin Wolf, 2014/09/12
- [Qemu-devel] [PULL 15/22] block: extend BLOCK_IO_ERROR with reason string,
Kevin Wolf <=
- [Qemu-devel] [PULL 20/22] qapi: introduce PreallocMode and new PreallocModes full and falloc., Kevin Wolf, 2014/09/12
- [Qemu-devel] [PULL 21/22] raw-posix: Add falloc and full preallocation option, Kevin Wolf, 2014/09/12
- [Qemu-devel] [PULL 22/22] qcow2: Add falloc and full preallocation option, Kevin Wolf, 2014/09/12
- Re: [Qemu-devel] [PULL 00/22] Block patches, Peter Maydell, 2014/09/15