mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-07 21:17:55 +03:00
qemuSnapshotForEachQcow2: Handle also NVRAM image for internal snapshots
The live VM snapshot code already does handle the NVRAM image when it's in use, so we should also handle it when modifying/creating the snapshots via qemu-img when inactive. Add the handling to qemuSnapshotForEachQcow2 which is used for all inactive operations. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
5ca0552d31
commit
c82dd60b2e
@ -347,6 +347,26 @@ qemuSnapshotForEachQcow2(virDomainDef *def,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (def->os.loader && def->os.loader->nvram) {
|
||||||
|
virStorageSource *nvram = def->os.loader->nvram;
|
||||||
|
|
||||||
|
if (virStorageSourceIsLocalStorage(nvram) &&
|
||||||
|
nvram->format == VIR_STORAGE_FILE_QCOW2) {
|
||||||
|
if (qemuSnapshotForEachQcow2One(nvram, op, snap->def->name) < 0) {
|
||||||
|
if (create) {
|
||||||
|
nrollback = def->ndisks;
|
||||||
|
virErrorPreserveLast(&orig_err);
|
||||||
|
goto rollback;
|
||||||
|
} else {
|
||||||
|
VIR_WARN("failed 'qemu-img snapshot %s' action on NVRAM image",
|
||||||
|
op);
|
||||||
|
skipped = true;
|
||||||
|
virResetLastError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return skipped ? 1 : 0;
|
return skipped ? 1 : 0;
|
||||||
|
|
||||||
rollback:
|
rollback:
|
||||||
|
Loading…
Reference in New Issue
Block a user