qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: zwu.kernel@gmail.com
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, pbonzini@redhat.com,
	Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>,
	zwu.kernel@gmail.com, stefanha@linux.vnet.ibm.com
Subject: [Qemu-devel] [PATCH v2 2/2] block: drain throttled requests for one block device
Date: Mon, 12 Mar 2012 14:29:27 +0800	[thread overview]
Message-ID: <1331533767-15866-1-git-send-email-zwu.kernel@gmail.com> (raw)

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 d78aa51..1bc4667 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -694,7 +694,7 @@ void qmp_blockdev_snapshot_sync(const char *device, const char *snapshot_file,
         return;
     }
 
-    bdrv_drain_all();
+    bdrv_drain(bs);
     bdrv_flush(bs);
 
     bdrv_close(bs);
@@ -1014,7 +1014,7 @@ int do_drive_del(Monitor *mon, const QDict *qdict, QObject **ret_data)
     }
 
     /* quiesce block driver; prevent further io */
-    bdrv_drain_all();
+    bdrv_drain(bs);
     bdrv_flush(bs);
     bdrv_close(bs);
 
diff --git a/hw/ide/macio.c b/hw/ide/macio.c
index a4df244..454a020 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(m->aiocb->bs);
     }
 }
 
diff --git a/hw/ide/pci.c b/hw/ide/pci.c
index 88c0942..205d65a 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(bm->bus->dma->aiocb->bs);
                 assert(bm->bus->dma->aiocb == NULL);
                 assert((bm->status & BM_STATUS_DMAING) == 0);
             }
-- 
1.7.6

                 reply	other threads:[~2012-03-12  6:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1331533767-15866-1-git-send-email-zwu.kernel@gmail.com \
    --to=zwu.kernel@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@linux.vnet.ibm.com \
    --cc=wuzhy@linux.vnet.ibm.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 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).