From 624ff5736ef9245bb8070400ccaf65857b6d1c38 Mon Sep 17 00:00:00 2001 From: Luiz Capitulino Date: Thu, 11 Sep 2014 10:25:48 -0400 Subject: block: extend BLOCK_IO_ERROR with reason string 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 Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- block.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'block.c') diff --git a/block.c b/block.c index dda5ae914d..bcd952a4cb 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 -- cgit v1.2.3