qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 2/2] block: fix the inaccurate draining activities with block I/O throttling
@ 2012-02-20  4:50 zwu.kernel
  0 siblings, 0 replies; only message in thread
From: zwu.kernel @ 2012-02-20  4:50 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, chris, Zhi Yong Wu, stefanha

From: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>

Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
---
 blockdev.c     |    4 ++--
 hw/ide/macio.c |    2 +-
 hw/ide/pci.c   |    3 ++-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/blockdev.c b/blockdev.c
index 7a6613a..fa85c78 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -693,7 +693,7 @@ void qmp_blockdev_snapshot_sync(const char *device, const char *snapshot_file,
         return;
     }
 
-    bdrv_drain_all();
+    bdrv_drain_request(bs);
     bdrv_flush(bs);
 
     bdrv_close(bs);
@@ -882,7 +882,7 @@ int do_drive_del(Monitor *mon, const QDict *qdict, QObject **ret_data)
     }
 
     /* quiesce block driver; prevent further io */
-    bdrv_drain_all();
+    bdrv_drain_request(bs);
     bdrv_flush(bs);
     bdrv_close(bs);
 
diff --git a/hw/ide/macio.c b/hw/ide/macio.c
index abbc41b..201574d 100644
--- a/hw/ide/macio.c
+++ b/hw/ide/macio.c
@@ -192,7 +192,7 @@ static void pmac_ide_flush(DBDMA_io *io)
     MACIOIDEState *m = io->opaque;
 
     if (m->aiocb) {
-        bdrv_drain_all();
+        bdrv_drain_request(m->aiocb->bs);
     }
 }
 
diff --git a/hw/ide/pci.c b/hw/ide/pci.c
index 246dd57..55f7622 100644
--- a/hw/ide/pci.c
+++ b/hw/ide/pci.c
@@ -27,6 +27,7 @@
 #include <hw/pci.h>
 #include <hw/isa.h>
 #include "block.h"
+#include "block_int.h"
 #include "dma.h"
 
 #include <hw/ide/pci.h>
@@ -309,7 +310,7 @@ void bmdma_cmd_writeb(BMDMAState *bm, uint32_t val)
              * aio operation with preadv/pwritev.
              */
             if (bm->bus->dma->aiocb) {
-                bdrv_drain_all();
+                bdrv_drain_request(bm->bus->dma->aiocb->bs);
                 assert(bm->bus->dma->aiocb == NULL);
                 assert((bm->status & BM_STATUS_DMAING) == 0);
             }
-- 
1.7.6

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-02-20  4:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-20  4:50 [Qemu-devel] [PATCH 2/2] block: fix the inaccurate draining activities with block I/O throttling zwu.kernel

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).