[PATCH 10/17] virDomainSnapshotRedefinePrep: Use 'snapdef' for snapshot definition object

Peter Krempa pkrempa at redhat.com
Wed Jan 12 18:10:10 UTC 2022


We use this variable name to distinguish it from the domain definition.

Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 src/conf/snapshot_conf.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c
index 1d61f93b65..4d2cfae128 100644
--- a/src/conf/snapshot_conf.c
+++ b/src/conf/snapshot_conf.c
@@ -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) {
-- 
2.31.1




More information about the libvir-list mailing list