[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 11/47] block: reorganize io error code
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH 11/47] block: reorganize io error code |
Date: |
Wed, 01 Aug 2012 11:30:32 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 |
Am 24.07.2012 13:03, schrieb Paolo Bonzini:
> Move the common part of IDE/SCSI/virtio error handling to the block
> layer. The new function bdrv_error_action subsumes all three of
> bdrv_emit_qmp_error_event, vm_stop, bdrv_iostatus_set_err.
>
> The same scheme will be used for errors in block jobs.
>
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
> block.c | 46 ++++++++++++++++++++++++++++++++++++++--------
> block.h | 5 +++--
> hw/ide/core.c | 20 +++++---------------
> hw/scsi-disk.c | 23 +++++++----------------
> hw/virtio-blk.c | 19 +++++--------------
> qemu-tool.c | 6 ++++++
> 6 files changed, 64 insertions(+), 55 deletions(-)
>
> diff --git a/block.c b/block.c
> index 5cd3a4b..333a8fd 100644
> --- a/block.c
> +++ b/block.c
> @@ -29,6 +29,7 @@
> #include "blockjob.h"
> #include "module.h"
> #include "qjson.h"
> +#include "sysemu.h"
> #include "qemu-coroutine.h"
> #include "qmp-commands.h"
> #include "qemu-timer.h"
> @@ -1152,8 +1153,8 @@ void bdrv_set_dev_ops(BlockDriverState *bs, const
> BlockDevOps *ops,
> }
> }
>
> -void bdrv_emit_qmp_error_event(const BlockDriverState *bdrv,
> - BlockErrorAction action, int is_read)
> +static void bdrv_emit_qmp_error_event(const BlockDriverState *bdrv,
> + BlockErrorAction action, int is_read)
> {
> QObject *data;
> const char *action_str;
> @@ -2147,6 +2148,39 @@ BlockdevOnError bdrv_get_on_error(BlockDriverState
> *bs, int is_read)
> return is_read ? bs->on_read_error : bs->on_write_error;
> }
>
> +BlockErrorAction bdrv_get_error_action(BlockDriverState *bs, int is_read,
> int error)
Maybe bool is_read?
Kevin
- Re: [Qemu-devel] [PATCH 11/47] block: reorganize io error code,
Kevin Wolf <=