summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy2015-11-17 18:02:58 +0100
committerStefan Hajnoczi2015-11-24 02:25:36 +0100
commitc9f6856ded10602147ca1d1806e7afb545430fd9 (patch)
tree1a1337a727ff10ff8bf5fc9a30505bf3fd86242c
parentMerge remote-tracking branch 'remotes/ehabkost/tags/numa-pull-request' into s... (diff)
downloadqemu-c9f6856ded10602147ca1d1806e7afb545430fd9.tar.gz
qemu-c9f6856ded10602147ca1d1806e7afb545430fd9.tar.xz
qemu-c9f6856ded10602147ca1d1806e7afb545430fd9.zip
parallels: dirty BAT properly for continuous allocations
This patch marks part of the BAT dirty properly. There is a possibility that multy-block allocation could have one block allocated on one BAT page and next block on the next page. The code without the patch could not save updated position to the file. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: Denis V. Lunev <den@openvz.org> Message-id: 1447779778-26062-1-git-send-email-den@openvz.org CC: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
-rw-r--r--block/parallels.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/parallels.c b/block/parallels.c
index 4f79293826..f689fdeaff 100644
--- a/block/parallels.c
+++ b/block/parallels.c
@@ -220,7 +220,7 @@ static int64_t allocate_clusters(BlockDriverState *bs, int64_t sector_num,
s->bat_bitmap[idx + i] = cpu_to_le32(s->data_end / s->off_multiplier);
s->data_end += s->tracks;
bitmap_set(s->bat_dirty_bmap,
- bat_entry_off(idx) / s->bat_dirty_block, 1);
+ bat_entry_off(idx + i) / s->bat_dirty_block, 1);
}
return bat2sect(s, idx) + sector_num % s->tracks;