qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 1/5] block: Emit BLOCK_IO_ERROR before vm_stop() call
Date: Thu, 25 Feb 2010 12:06:58 -0300	[thread overview]
Message-ID: <1267110422-25873-2-git-send-email-lcapitulino@redhat.com> (raw)
In-Reply-To: <1267110422-25873-1-git-send-email-lcapitulino@redhat.com>

The next commit will move the STOP event into do_vm_stop(), to
have the expected event sequence we need to emit the I/O error
event before calling vm_stop().

The expected sequence is:

{ "event": "BLOCK_IO_ERROR" [...] }
{ "event": "STOP" }

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 hw/ide/core.c   |    2 +-
 hw/scsi-disk.c  |    2 +-
 hw/virtio-blk.c |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/ide/core.c b/hw/ide/core.c
index 2e0971d..67480bb 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -491,8 +491,8 @@ static int ide_handle_rw_error(IDEState *s, int error, int op)
             || 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);
+        vm_stop(0);
     } else {
         if (op & BM_STATUS_DMA_RETRY) {
             dma_buf_commit(s, 0);
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index b2f61fe..7bb9c6c 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -190,8 +190,8 @@ static int scsi_handle_write_error(SCSIDiskReq *r, int error)
     if ((error == ENOSPC && action == BLOCK_ERR_STOP_ENOSPC)
             || action == BLOCK_ERR_STOP_ANY) {
         r->status |= SCSI_REQ_STATUS_RETRY;
-        vm_stop(0);
         bdrv_mon_event(s->bs, BDRV_ACTION_STOP, 0);
+        vm_stop(0);
     } else {
         scsi_command_complete(r, CHECK_CONDITION,
                 HARDWARE_ERROR);
diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index b80402d..8939bb2 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -72,8 +72,8 @@ static int virtio_blk_handle_rw_error(VirtIOBlockReq *req, int error,
             || action == BLOCK_ERR_STOP_ANY) {
         req->next = s->rq;
         s->rq = req;
-        vm_stop(0);
         bdrv_mon_event(req->dev->bs, BDRV_ACTION_STOP, is_read);
+        vm_stop(0);
     } else {
         virtio_blk_req_complete(req, VIRTIO_BLK_S_IOERR);
         bdrv_mon_event(req->dev->bs, BDRV_ACTION_REPORT, is_read);
-- 
1.7.0.GIT

  reply	other threads:[~2010-02-25 15:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-25 15:06 [Qemu-devel] [PATCH v0 0/5]: QMP: some event fixes Luiz Capitulino
2010-02-25 15:06 ` Luiz Capitulino [this message]
2010-03-09 14:25   ` [Qemu-devel] [PATCH 1/5] block: Emit BLOCK_IO_ERROR before vm_stop() call Anthony Liguori
2010-02-25 15:06 ` [Qemu-devel] [PATCH 2/5] QMP: Move STOP event into do_vm_stop() Luiz Capitulino
2010-02-25 15:07 ` [Qemu-devel] [PATCH 3/5] QMP: Move RESET event into qemu_system_reset() Luiz Capitulino
2010-02-25 15:07 ` [Qemu-devel] [PATCH 4/5] QMP: Drop DEBUG event Luiz Capitulino
2010-02-25 15:07 ` [Qemu-devel] [PATCH 5/5] QMP: Revamp the qmp-events.txt file Luiz Capitulino
2010-02-25 15:20 ` [Qemu-devel] Re: [PATCH v0 0/5]: QMP: some event fixes Juan Quintela

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=1267110422-25873-2-git-send-email-lcapitulino@redhat.com \
    --to=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).