From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52012) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwVGK-0007YE-SF for qemu-devel@nongnu.org; Wed, 01 Aug 2012 05:30:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SwVGJ-0003zV-Rc for qemu-devel@nongnu.org; Wed, 01 Aug 2012 05:30:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47305) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwVGJ-0003zR-Iz for qemu-devel@nongnu.org; Wed, 01 Aug 2012 05:30:39 -0400 Message-ID: <5018F738.8020807@redhat.com> Date: Wed, 01 Aug 2012 11:30:32 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1343127865-16608-1-git-send-email-pbonzini@redhat.com> <1343127865-16608-12-git-send-email-pbonzini@redhat.com> In-Reply-To: <1343127865-16608-12-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 11/47] block: reorganize io error code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: jcody@redhat.com, eblake@redhat.com, qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com 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 > --- > 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