mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
test: snapshot revert: always error out if VM XML is missing
We should have this check even if FORCE flag is used because later we unconditionally copy the `snap->def->dom` and error out if there is no copy created. The test driver will always save the VM XML when creating new snapshot. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
6c86b92f14
commit
ca04290be3
@ -9042,13 +9042,14 @@ testDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!snap->def->dom) {
|
||||
virReportError(VIR_ERR_SNAPSHOT_REVERT_RISKY,
|
||||
_("snapshot '%s' lacks domain '%s' rollback info"),
|
||||
snap->def->name, vm->def->name);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!(flags & VIR_DOMAIN_SNAPSHOT_REVERT_FORCE)) {
|
||||
if (!snap->def->dom) {
|
||||
virReportError(VIR_ERR_SNAPSHOT_REVERT_RISKY,
|
||||
_("snapshot '%s' lacks domain '%s' rollback info"),
|
||||
snap->def->name, vm->def->name);
|
||||
goto cleanup;
|
||||
}
|
||||
if (virDomainObjIsActive(vm) &&
|
||||
!(snapdef->state == VIR_DOMAIN_SNAPSHOT_RUNNING ||
|
||||
snapdef->state == VIR_DOMAIN_SNAPSHOT_PAUSED) &&
|
||||
|
Loading…
x
Reference in New Issue
Block a user