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 <pkre...@redhat.com>
---
 src/qemu/qemu_blockjob.c | 2 ++
 1 file changed, 2 insertions(+)

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);
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to