qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 4/8] ide: Support I/O status


From: Luiz Capitulino
Subject: [Qemu-devel] [PATCH 4/8] ide: Support I/O status
Date: Tue, 5 Jul 2011 15:17:47 -0300

Signed-off-by: Luiz Capitulino <address@hidden>
---
 hw/ide/core.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/hw/ide/core.c b/hw/ide/core.c
index bf9df41..5fae4c6 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -473,6 +473,7 @@ void ide_sector_read(IDEState *s)
         if (n > s->req_nb_sectors)
             n = s->req_nb_sectors;
         ret = bdrv_read(s->bs, sector_num, s->io_buffer, n);
+        bdrv_iostatus_update(s->bs, ret);
         if (ret != 0) {
             if (ide_handle_rw_error(s, -ret,
                 BM_STATUS_PIO_RETRY | BM_STATUS_RETRY_READ))
@@ -544,6 +545,7 @@ void ide_dma_cb(void *opaque, int ret)
     int64_t sector_num;
 
 handle_rw_error:
+    bdrv_iostatus_update(s->bs, ret);
     if (ret < 0) {
         int op = BM_STATUS_DMA_RETRY;
 
@@ -642,6 +644,7 @@ void ide_sector_write(IDEState *s)
     if (n > s->req_nb_sectors)
         n = s->req_nb_sectors;
     ret = bdrv_write(s->bs, sector_num, s->io_buffer, n);
+    bdrv_iostatus_update(s->bs, ret);
 
     if (ret != 0) {
         if (ide_handle_rw_error(s, -ret, BM_STATUS_PIO_RETRY))
@@ -678,6 +681,7 @@ static void ide_flush_cb(void *opaque, int ret)
 {
     IDEState *s = opaque;
 
+    bdrv_iostatus_update(s->bs, ret);
     if (ret < 0) {
         /* XXX: What sector number to set here? */
         if (ide_handle_rw_error(s, -ret, BM_STATUS_RETRY_FLUSH)) {
@@ -1749,6 +1753,7 @@ int ide_init_drive(IDEState *s, BlockDriverState *bs, 
IDEDriveKind kind,
     }
 
     ide_reset(s);
+    bdrv_enable_iostatus(bs);
     bdrv_set_removable(bs, s->drive_kind == IDE_CD);
     return 0;
 }
-- 
1.7.6.131.g99019




reply via email to

[Prev in Thread] Current Thread [Next in Thread]