From: Peter Krempa Date: Fri, 8 Nov 2019 15:38:08 +0000 (+0100) Subject: qemu: blockjob: Transfer 'readonly' state of images after active layer block commit X-Git-Tag: v5.10.0-rc1~241 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b036834eaea6eeb514896310edd418686b82f64b;p=thirdparty%2Flibvirt.git qemu: blockjob: Transfer 'readonly' state of images after active layer block commit When commiting a different image becomes the disk source. Since we store the readonly flag per-image we must update it to the same state the original image had. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index 2dddb1e408..5c294f8024 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -1106,6 +1106,7 @@ qemuBlockJobProcessEventCompletedActiveCommit(virQEMUDriverPtr driver, cfgbase = cfgbaseparent->backingStore; cfgbaseparent->backingStore = NULL; cfgdisk->src = cfgbase; + cfgdisk->src->readonly = cfgtop->readonly; virObjectUnref(cfgtop); } @@ -1115,6 +1116,7 @@ qemuBlockJobProcessEventCompletedActiveCommit(virQEMUDriverPtr driver, baseparent->backingStore = NULL; job->disk->src = job->data.commit.base; + job->disk->src->readonly = job->data.commit.top->readonly; qemuBlockJobEventProcessConcludedRemoveChain(driver, vm, asyncJob, job->data.commit.top); virObjectUnref(job->data.commit.top);