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 <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2019-11-08 16:38:08 +01:00
parent f46eb511a2
commit b036834eae

View File

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