[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 2/2] block: disable I/O throttling on sync api
From: |
zwu . kernel |
Subject: |
[Qemu-devel] [PATCH v2 2/2] block: disable I/O throttling on sync api |
Date: |
Tue, 27 Mar 2012 19:43:17 +0800 |
From: Zhi Yong Wu <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Zhi Yong Wu <address@hidden>
---
block.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/block.c b/block.c
index 1fbf4dd..f0b4f38 100644
--- a/block.c
+++ b/block.c
@@ -1477,6 +1477,12 @@ static int bdrv_rw_co(BlockDriverState *bs, int64_t
sector_num, uint8_t *buf,
qemu_iovec_init_external(&qiov, &iov, 1);
+ if (bs->io_limits_enabled) {
+ fprintf(stderr, "Disabling I/O throttling on '%s' due "
+ "to synchronous I/O.\n", bdrv_get_device_name(bs));
+ bdrv_io_limits_disable(bs);
+ }
+
if (qemu_in_coroutine()) {
/* Fast-path if already in coroutine context */
bdrv_rw_co_entry(&rwco);
@@ -1983,10 +1989,14 @@ static int guess_disk_lchs(BlockDriverState *bs,
struct partition *p;
uint32_t nr_sects;
uint64_t nb_sectors;
+ bool enabled;
bdrv_get_geometry(bs, &nb_sectors);
+ enabled = bs->io_limits_enabled;
+ bs->io_limits_enabled = false;
ret = bdrv_read(bs, 0, buf, 1);
+ bs->io_limits_enabled = enabled;
if (ret < 0)
return -1;
/* test msdos magic */
--
1.7.6
- [Qemu-devel] [PATCH v2 2/2] block: disable I/O throttling on sync api,
zwu . kernel <=