From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:52101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzLDh-0000KP-EK for qemu-devel@nongnu.org; Sun, 19 Feb 2012 23:51:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RzLDf-0007QM-VU for qemu-devel@nongnu.org; Sun, 19 Feb 2012 23:51:25 -0500 Received: from e35.co.us.ibm.com ([32.97.110.153]:44487) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzLDf-0007Q8-Pw for qemu-devel@nongnu.org; Sun, 19 Feb 2012 23:51:23 -0500 Received: from /spool/local by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 19 Feb 2012 21:51:22 -0700 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id 8B5DD1FF0055 for ; Sun, 19 Feb 2012 21:51:04 -0700 (MST) Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q1K4p4Pg169082 for ; Sun, 19 Feb 2012 21:51:04 -0700 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q1K4p3sF008400 for ; Sun, 19 Feb 2012 21:51:04 -0700 From: zwu.kernel@gmail.com Date: Mon, 20 Feb 2012 12:50:55 +0800 Message-Id: <1329713455-9255-1-git-send-email-zwu.kernel@gmail.com> Subject: [Qemu-devel] [PATCH 2/2] block: fix the inaccurate draining activities with block I/O throttling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, chris@arachsys.com, Zhi Yong Wu , stefanha@linux.vnet.ibm.com From: Zhi Yong Wu Signed-off-by: Zhi Yong Wu --- 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 #include #include "block.h" +#include "block_int.h" #include "dma.h" #include @@ -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