qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Luiz Capitulino <lcapitulino@redhat.com>
Cc: kwolf@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 3/5] ide: Generate BLOCK_IO_ERROR QMP event
Date: Wed, 3 Feb 2010 09:31:07 +0100	[thread overview]
Message-ID: <20100203083107.GA28969@lst.de> (raw)
In-Reply-To: <1265145013-23231-4-git-send-email-lcapitulino@redhat.com>

On Tue, Feb 02, 2010 at 07:10:11PM -0200, Luiz Capitulino wrote:
> Just call bdrv_mon_event() in the right place.
> 
> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
> ---
>  hw/ide/core.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/hw/ide/core.c b/hw/ide/core.c
> index b6643e8..603e537 100644
> --- a/hw/ide/core.c
> +++ b/hw/ide/core.c
> @@ -480,14 +480,17 @@ static int ide_handle_rw_error(IDEState *s, int error, int op)
>      int is_read = (op & BM_STATUS_RETRY_READ);
>      BlockInterfaceErrorAction action = drive_get_on_error(s->bs, is_read);
>  
> -    if (action == BLOCK_ERR_IGNORE)
> +    if (action == BLOCK_ERR_IGNORE) {
> +        bdrv_mon_event(s->bs, BDRV_ACTION_IGNORE, is_read);
>          return 0;
> +    }
>  
>      if ((error == ENOSPC && action == BLOCK_ERR_STOP_ENOSPC)
>              || action == BLOCK_ERR_STOP_ANY) {
>          s->bus->bmdma->unit = s->unit;
>          s->bus->bmdma->status |= op;
>          vm_stop(0);
> +        bdrv_mon_event(s->bs, BDRV_ACTION_STOP, is_read);

Why isn't the event directly sent from drive_get_on_error?  Having
to opencode this in every driver is a sure way to make sure it's
going to be broken somewhere.

  reply	other threads:[~2010-02-03  8:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-02 21:10 [Qemu-devel] [PATCH v0 0/5]: BLOCK_IO_ERROR QMP event Luiz Capitulino
2010-02-02 21:10 ` [Qemu-devel] [PATCH 1/5] QMP: BLOCK_IO_ERROR event handling Luiz Capitulino
2010-02-03  9:18   ` [Qemu-devel] " Kevin Wolf
2010-02-03 11:27     ` Luiz Capitulino
2010-02-02 21:10 ` [Qemu-devel] [PATCH 2/5] block: BLOCK_IO_ERROR QMP event Luiz Capitulino
2010-02-02 21:10 ` [Qemu-devel] [PATCH 3/5] ide: Generate " Luiz Capitulino
2010-02-03  8:31   ` Christoph Hellwig [this message]
2010-02-03  9:10     ` Kevin Wolf
2010-02-03 11:41       ` Luiz Capitulino
2010-02-02 21:10 ` [Qemu-devel] [PATCH 4/5] scsi: " Luiz Capitulino
2010-02-02 21:10 ` [Qemu-devel] [PATCH 5/5] virtio-blk: " Luiz Capitulino
2010-02-03 10:25 ` [Qemu-devel] Re: [PATCH v0 0/5]: " Kevin Wolf
  -- strict thread matches above, loose matches on Subject: below --
2010-02-03 14:40 [Qemu-devel] [PATCH v1 " Luiz Capitulino
2010-02-03 14:41 ` [Qemu-devel] [PATCH 3/5] ide: Generate " Luiz Capitulino

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100203083107.GA28969@lst.de \
    --to=hch@lst.de \
    --cc=kwolf@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).