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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux