mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 03:25:20 +00:00
virDomainSnapshotRedefinePrep: Use 'snapdef' for snapshot definition object
We use this variable name to distinguish it from the domain definition. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
d1d4983dfc
commit
504b108cb9
@ -980,23 +980,23 @@ virDomainSnapshotRedefinePrep(virDomainObj *vm,
|
||||
virDomainXMLOption *xmlopt,
|
||||
unsigned int flags)
|
||||
{
|
||||
virDomainSnapshotDef *def = *defptr;
|
||||
virDomainSnapshotDef *snapdef = *defptr;
|
||||
virDomainMomentObj *other;
|
||||
virDomainSnapshotDef *otherdef = NULL;
|
||||
bool check_if_stolen;
|
||||
|
||||
if (virDomainSnapshotCheckCycles(vm->snapshots, def, vm->def->name) < 0)
|
||||
if (virDomainSnapshotCheckCycles(vm->snapshots, snapdef, vm->def->name) < 0)
|
||||
return -1;
|
||||
|
||||
other = virDomainSnapshotFindByName(vm->snapshots, def->parent.name);
|
||||
other = virDomainSnapshotFindByName(vm->snapshots, snapdef->parent.name);
|
||||
if (other)
|
||||
otherdef = virDomainSnapshotObjGetDef(other);
|
||||
check_if_stolen = other && otherdef->parent.dom;
|
||||
if (virDomainSnapshotRedefineValidate(def, vm->def->uuid, other, xmlopt,
|
||||
if (virDomainSnapshotRedefineValidate(snapdef, vm->def->uuid, other, xmlopt,
|
||||
flags) < 0) {
|
||||
/* revert any stealing of the snapshot domain definition */
|
||||
if (check_if_stolen && def->parent.dom && !otherdef->parent.dom)
|
||||
otherdef->parent.dom = g_steal_pointer(&def->parent.dom);
|
||||
if (check_if_stolen && snapdef->parent.dom && !otherdef->parent.dom)
|
||||
otherdef->parent.dom = g_steal_pointer(&snapdef->parent.dom);
|
||||
return -1;
|
||||
}
|
||||
if (other) {
|
||||
|
Loading…
Reference in New Issue
Block a user