[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 03/16] block migration: do not submit multiple AIOs
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 03/16] block migration: do not submit multiple AIOs for same sector (v2) |
Date: |
Tue, 30 Nov 2010 18:58:07 +0100 |
From: Marcelo Tosatti <address@hidden>
An old version of this patch was applied to master, so this contains the
differences between v1 and v2.
Signed-off-by: Marcelo Tosatti <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block-migration.c | 14 +++++---------
1 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/block-migration.c b/block-migration.c
index 3e66f49..1475325 100644
--- a/block-migration.c
+++ b/block-migration.c
@@ -146,8 +146,7 @@ static int bmds_aio_inflight(BlkMigDevState *bmds, int64_t
sector)
{
int64_t chunk = sector / (int64_t)BDRV_SECTORS_PER_DIRTY_CHUNK;
- if (bmds->aio_bitmap &&
- (sector << BDRV_SECTOR_BITS) < bdrv_getlength(bmds->bs)) {
+ if ((sector << BDRV_SECTOR_BITS) < bdrv_getlength(bmds->bs)) {
return !!(bmds->aio_bitmap[chunk / (sizeof(unsigned long) * 8)] &
(1UL << (chunk % (sizeof(unsigned long) * 8))));
} else {
@@ -169,13 +168,9 @@ static void bmds_set_aio_inflight(BlkMigDevState *bmds,
int64_t sector_num,
bit = start % (sizeof(unsigned long) * 8);
val = bmds->aio_bitmap[idx];
if (set) {
- if (!(val & (1UL << bit))) {
- val |= 1UL << bit;
- }
+ val |= 1UL << bit;
} else {
- if (val & (1UL << bit)) {
- val &= ~(1UL << bit);
- }
+ val &= ~(1UL << bit);
}
bmds->aio_bitmap[idx] = val;
}
@@ -385,8 +380,9 @@ static int mig_save_device_dirty(Monitor *mon, QEMUFile *f,
int nr_sectors;
for (sector = bmds->cur_dirty; sector < bmds->total_sectors;) {
- if (bmds_aio_inflight(bmds, sector))
+ if (bmds_aio_inflight(bmds, sector)) {
qemu_aio_flush();
+ }
if (bdrv_get_dirty(bmds->bs, sector)) {
if (total_sectors - sector < BDRV_SECTORS_PER_DIRTY_CHUNK) {
--
1.7.2.3
- [Qemu-devel] [PATCH 07/16] scsi: Increase the number of possible devices, (continued)
- [Qemu-devel] [PATCH 07/16] scsi: Increase the number of possible devices, Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 04/16] ide: convert bmdma address ioport to ioport_register(), Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 14/16] ide: Set bus master inactive on error, Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 12/16] raw-posix: raw_pwrite comment fixup, Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 10/16] scsi: Move sense handling into the driver, Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 08/16] scsi: Return SAM status codes, Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 05/16] qemu and qemu-xen: support empty write barriers in xen_disk, Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 09/16] scsi: INQUIRY VPD fixes, Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 01/16] scsi-disk: Move active request asserts, Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 02/16] Implement drive_del to decouple block removal from device removal, Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 03/16] block migration: do not submit multiple AIOs for same sector (v2),
Kevin Wolf <=
- [Qemu-devel] [PATCH 16/16] ide: Reset current_addr after stopping DMA, Kevin Wolf, 2010/11/30