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:
Peter Krempa 2022-01-12 14:56:04 +01:00
parent d1d4983dfc
commit 504b108cb9
1 changed files with 6 additions and 6 deletions

View File

@ -980,23 +980,23 @@ virDomainSnapshotRedefinePrep(virDomainObj *vm,
virDomainXMLOption *xmlopt, virDomainXMLOption *xmlopt,
unsigned int flags) unsigned int flags)
{ {
virDomainSnapshotDef *def = *defptr; virDomainSnapshotDef *snapdef = *defptr;
virDomainMomentObj *other; virDomainMomentObj *other;
virDomainSnapshotDef *otherdef = NULL; virDomainSnapshotDef *otherdef = NULL;
bool check_if_stolen; bool check_if_stolen;
if (virDomainSnapshotCheckCycles(vm->snapshots, def, vm->def->name) < 0) if (virDomainSnapshotCheckCycles(vm->snapshots, snapdef, vm->def->name) < 0)
return -1; return -1;
other = virDomainSnapshotFindByName(vm->snapshots, def->parent.name); other = virDomainSnapshotFindByName(vm->snapshots, snapdef->parent.name);
if (other) if (other)
otherdef = virDomainSnapshotObjGetDef(other); otherdef = virDomainSnapshotObjGetDef(other);
check_if_stolen = other && otherdef->parent.dom; 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) { flags) < 0) {
/* revert any stealing of the snapshot domain definition */ /* revert any stealing of the snapshot domain definition */
if (check_if_stolen && def->parent.dom && !otherdef->parent.dom) if (check_if_stolen && snapdef->parent.dom && !otherdef->parent.dom)
otherdef->parent.dom = g_steal_pointer(&def->parent.dom); otherdef->parent.dom = g_steal_pointer(&snapdef->parent.dom);
return -1; return -1;
} }
if (other) { if (other) {