qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block: extend BLOCK_IO_ERROR with reason string
@ 2014-09-11 14:25 Luiz Capitulino
  2014-09-11 14:36 ` Kevin Wolf
  2014-09-11 15:11 ` Eric Blake
  0 siblings, 2 replies; 3+ messages in thread
From: Luiz Capitulino @ 2014-09-11 14:25 UTC (permalink / raw)
  To: kwolf; +Cc: fromani, armbru, qemu-devel

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 <lcapitulino@redhat.com>
---

This patch applies on top of the following patch:

 [PATCH] block: extend BLOCK_IO_ERROR event with nospace indicator

Which has been submitted some time ago and is already applied in the
block tree.

 block.c              | 3 ++-
 qapi/block-core.json | 7 ++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/block.c b/block.c
index 460effe..3c9fb33 100644
--- a/block.c
+++ b/block.c
@@ -3648,7 +3648,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.9.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] block: extend BLOCK_IO_ERROR with reason string
  2014-09-11 14:25 [Qemu-devel] [PATCH] block: extend BLOCK_IO_ERROR with reason string Luiz Capitulino
@ 2014-09-11 14:36 ` Kevin Wolf
  2014-09-11 15:11 ` Eric Blake
  1 sibling, 0 replies; 3+ messages in thread
From: Kevin Wolf @ 2014-09-11 14:36 UTC (permalink / raw)
  To: Luiz Capitulino; +Cc: fromani, armbru, qemu-devel

Am 11.09.2014 um 16:25 hat Luiz Capitulino geschrieben:
> 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 <lcapitulino@redhat.com>

Thanks, applied to the block branch.

Kevin

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] block: extend BLOCK_IO_ERROR with reason string
  2014-09-11 14:25 [Qemu-devel] [PATCH] block: extend BLOCK_IO_ERROR with reason string Luiz Capitulino
  2014-09-11 14:36 ` Kevin Wolf
@ 2014-09-11 15:11 ` Eric Blake
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Blake @ 2014-09-11 15:11 UTC (permalink / raw)
  To: Luiz Capitulino, kwolf; +Cc: fromani, armbru, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 660 bytes --]

On 09/11/2014 08:25 AM, Luiz Capitulino wrote:
> 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 <lcapitulino@redhat.com>
> ---

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 539 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-09-11 15:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-11 14:25 [Qemu-devel] [PATCH] block: extend BLOCK_IO_ERROR with reason string Luiz Capitulino
2014-09-11 14:36 ` Kevin Wolf
2014-09-11 15:11 ` Eric Blake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).