[libvirt] [PATCH 1/2] qemu: blockjob: Transfer 'readonly' state of images after active layer block commit

Peter Krempa pkrempa at redhat.com
Wed Nov 13 14:22:11 UTC 2019


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 <pkrempa at 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




More information about the libvir-list mailing list