All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, jan.kiszka@siemens.com, armbru@redhat.com,
	stefanha@gmail.com, jdenemar@redhat.com
Subject: [Qemu-devel] [PATCH 6/8] scsi: Support I/O status
Date: Tue,  5 Jul 2011 15:17:49 -0300	[thread overview]
Message-ID: <1309889871-6267-7-git-send-email-lcapitulino@redhat.com> (raw)
In-Reply-To: <1309889871-6267-1-git-send-email-lcapitulino@redhat.com>

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 hw/scsi-disk.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index 66037fd..7002560 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -137,10 +137,12 @@ static void scsi_cancel_io(SCSIRequest *req)
 static void scsi_read_complete(void * opaque, int ret)
 {
     SCSIDiskReq *r = (SCSIDiskReq *)opaque;
+    SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev);
     int n;
 
     r->req.aiocb = NULL;
 
+    bdrv_iostatus_update(s->bs, ret);
     if (ret) {
         if (scsi_handle_rw_error(r, -ret, SCSI_REQ_STATUS_RETRY_READ)) {
             return;
@@ -243,11 +245,13 @@ static int scsi_handle_rw_error(SCSIDiskReq *r, int error, int type)
 static void scsi_write_complete(void * opaque, int ret)
 {
     SCSIDiskReq *r = (SCSIDiskReq *)opaque;
+    SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev);
     uint32_t len;
     uint32_t n;
 
     r->req.aiocb = NULL;
 
+    bdrv_iostatus_update(s->bs, ret);
     if (ret) {
         if (scsi_handle_rw_error(r, -ret, SCSI_REQ_STATUS_RETRY_WRITE)) {
             return;
@@ -905,6 +909,7 @@ static int scsi_disk_emulate_command(SCSIDiskReq *r, uint8_t *outbuf)
 	break;
     case SYNCHRONIZE_CACHE:
         ret = bdrv_flush(s->bs);
+        bdrv_iostatus_update(s->bs, ret);
         if (ret < 0) {
             if (scsi_handle_rw_error(r, -ret, SCSI_REQ_STATUS_RETRY_FLUSH)) {
                 return -1;
@@ -1226,6 +1231,7 @@ static int scsi_initfn(SCSIDevice *dev, SCSIDriveKind kind)
 
     s->qdev.type = TYPE_DISK;
     qemu_add_vm_change_state_handler(scsi_dma_restart_cb, s);
+    bdrv_enable_iostatus(s->bs);
     bdrv_set_removable(s->bs, kind == SCSI_CD);
     add_boot_device_path(s->qdev.conf.bootindex, &dev->qdev, ",0");
     return 0;
-- 
1.7.6.131.g99019

  parent reply	other threads:[~2011-07-05 18:18 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-05 18:17 [Qemu-devel] [PATCH v1 0/8]: QMP: Thin provisioning support Luiz Capitulino
2011-07-05 18:17 ` [Qemu-devel] [PATCH 1/8] Introduce the VMStatus type Luiz Capitulino
2011-07-05 18:33   ` Anthony Liguori
2011-07-05 18:51     ` Luiz Capitulino
2011-07-05 18:58       ` Anthony Liguori
2011-07-05 19:34         ` Luiz Capitulino
2011-07-12  7:28   ` Markus Armbruster
2011-07-12 14:25     ` Luiz Capitulino
2011-07-12 14:51       ` Kevin Wolf
2011-07-12 15:12         ` Luiz Capitulino
2011-07-12 16:03           ` Luiz Capitulino
2011-07-12 16:16             ` Kevin Wolf
2011-07-12 17:59               ` Luiz Capitulino
2011-07-05 18:17 ` [Qemu-devel] [PATCH 2/8] QMP: query-status: Introduce 'status' key Luiz Capitulino
2011-07-05 18:17 ` [Qemu-devel] [PATCH 3/8] block: Support to keep track of I/O status Luiz Capitulino
2011-07-12  7:45   ` Markus Armbruster
2011-07-12  8:33     ` Kevin Wolf
2011-07-12  9:12       ` Markus Armbruster
2011-07-12 14:38         ` Luiz Capitulino
2011-07-12 14:25   ` Kevin Wolf
2011-07-12 14:56     ` Luiz Capitulino
2011-07-05 18:17 ` [Qemu-devel] [PATCH 4/8] ide: Support " Luiz Capitulino
2011-07-05 18:17 ` [Qemu-devel] [PATCH 5/8] virtio: " Luiz Capitulino
2011-07-05 18:17 ` Luiz Capitulino [this message]
2011-07-05 18:17 ` [Qemu-devel] [PATCH 7/8] QMP: query-status: Add 'io-status' key Luiz Capitulino
2011-07-12  7:47   ` Markus Armbruster
2011-07-12 14:56     ` Luiz Capitulino
2011-07-05 18:17 ` [Qemu-devel] [PATCH 8/8] HMP: Print 'io-status' information Luiz Capitulino
2011-07-11 17:43 ` [Qemu-devel] [PATCH v1 0/8]: QMP: Thin provisioning support 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=1309889871-6267-7-git-send-email-lcapitulino@redhat.com \
    --to=lcapitulino@redhat.com \
    --cc=armbru@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=jdenemar@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.