[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 6/8] scsi: Support I/O status
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PATCH 6/8] scsi: Support I/O status |
Date: |
Tue, 5 Jul 2011 15:17:49 -0300 |
Signed-off-by: Luiz Capitulino <address@hidden>
---
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
- Re: [Qemu-devel] [PATCH 1/8] Introduce the VMStatus type, (continued)
[Qemu-devel] [PATCH 2/8] QMP: query-status: Introduce 'status' key, Luiz Capitulino, 2011/07/05
[Qemu-devel] [PATCH 3/8] block: Support to keep track of I/O status, Luiz Capitulino, 2011/07/05
Re: [Qemu-devel] [PATCH 3/8] block: Support to keep track of I/O status, Kevin Wolf, 2011/07/12
[Qemu-devel] [PATCH 6/8] scsi: Support I/O status,
Luiz Capitulino <=
[Qemu-devel] [PATCH 4/8] ide: Support I/O status, Luiz Capitulino, 2011/07/05
[Qemu-devel] [PATCH 7/8] QMP: query-status: Add 'io-status' key, Luiz Capitulino, 2011/07/05
[Qemu-devel] [PATCH 5/8] virtio: Support I/O status, Luiz Capitulino, 2011/07/05
[Qemu-devel] [PATCH 8/8] HMP: Print 'io-status' information, Luiz Capitulino, 2011/07/05
Re: [Qemu-devel] [PATCH v1 0/8]: QMP: Thin provisioning support, Luiz Capitulino, 2011/07/11