mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 23:25:24 +00:00
qemu: block commit: Don't overwrite error when rolling back disk labels
Calls to qemuDomainDiskChainElementPrepare resets the original error, thus we need to save it in the cleanup path of qemuDomainBlockCommit.
This commit is contained in:
parent
3488f449a6
commit
c885b7fe1d
@ -17270,10 +17270,16 @@ qemuDomainBlockCommit(virDomainPtr dom,
|
||||
|
||||
endjob:
|
||||
if (ret < 0 && clean_access) {
|
||||
virErrorPtr orig_err = virSaveLastError();
|
||||
/* Revert access to read-only, if possible. */
|
||||
qemuDomainDiskChainElementPrepare(driver, vm, baseSource, true);
|
||||
if (top_parent && top_parent != disk->src)
|
||||
qemuDomainDiskChainElementPrepare(driver, vm, top_parent, true);
|
||||
|
||||
if (orig_err) {
|
||||
virSetError(orig_err);
|
||||
virFreeError(orig_err);
|
||||
}
|
||||
}
|
||||
virStorageSourceFree(mirror);
|
||||
qemuDomainObjEndJob(driver, vm);
|
||||
|
Loading…
Reference in New Issue
Block a user