aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-06-14 16:55:01 +0200
committerKevin Wolf <kwolf@redhat.com>2012-07-09 15:53:02 +0200
commita9fc4408e3511a073583a18b98a26765ff1e21d7 (patch)
tree2adfa2fd22cb73e6c223774d8481a57a0066f246 /block.c
parent5c171afa4cff41101ac3e5b0cd703fd211aaa253 (diff)
block: copy over job and dirty bitmap fields in bdrv_append
While these should not be in use at the time a transaction is started, a command in the prepare phase of a transaction might have added them, so they need to be brought over. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/block.c b/block.c
index 0acdcac158..702821dbab 100644
--- a/block.c
+++ b/block.c
@@ -1027,6 +1027,16 @@ void bdrv_append(BlockDriverState *bs_new, BlockDriverState *bs_top)
tmp.iostatus_enabled = bs_top->iostatus_enabled;
tmp.iostatus = bs_top->iostatus;
+ /* dirty bitmap */
+ tmp.dirty_count = bs_top->dirty_count;
+ tmp.dirty_bitmap = bs_top->dirty_bitmap;
+ assert(bs_new->dirty_bitmap == NULL);
+
+ /* job */
+ tmp.in_use = bs_top->in_use;
+ tmp.job = bs_top->job;
+ assert(bs_new->job == NULL);
+
/* keep the same entry in bdrv_states */
pstrcpy(tmp.device_name, sizeof(tmp.device_name), bs_top->device_name);
tmp.list = bs_top->list;
@@ -1051,6 +1061,11 @@ void bdrv_append(BlockDriverState *bs_new, BlockDriverState *bs_top)
/* clear the copied fields in the new backing file */
bdrv_detach_dev(bs_new, bs_new->dev);
+ bs_new->job = NULL;
+ bs_new->in_use = 0;
+ bs_new->dirty_bitmap = NULL;
+ bs_new->dirty_count = 0;
+
qemu_co_queue_init(&bs_new->throttled_reqs);
memset(&bs_new->io_base, 0, sizeof(bs_new->io_base));
memset(&bs_new->io_limits, 0, sizeof(bs_new->io_limits));