]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: snapshot: rename variable holding memory snapshot file location
authorPeter Krempa <pkrempa@redhat.com>
Wed, 16 Jun 2021 14:54:18 +0000 (16:54 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 18 Jun 2021 07:16:16 +0000 (09:16 +0200)
'file' is too generic to know what's going on. Rename it to
'memorysnapshotfile'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/conf/snapshot_conf.c
src/conf/snapshot_conf.h
src/qemu/qemu_snapshot.c

index df3f2a4c635c9cbafa9a34c36d848a41d17b22cb..0592640dd91b44eb8f6c043a35e3df4fa3dff48b 100644 (file)
@@ -125,7 +125,7 @@ virDomainSnapshotDefDispose(void *obj)
     virDomainSnapshotDef *def = obj;
     size_t i;
 
-    g_free(def->file);
+    g_free(def->memorysnapshotfile);
     for (i = 0; i < def->ndisks; i++)
         virDomainSnapshotDiskDefClear(&def->disks[i]);
     g_free(def->disks);
@@ -360,13 +360,13 @@ virDomainSnapshotDefParse(xmlXPathContextPtr ctxt,
                          "disk-only snapshot"));
         goto cleanup;
     }
-    def->file = g_steal_pointer(&memoryFile);
+    def->memorysnapshotfile = g_steal_pointer(&memoryFile);
 
     /* verify that memory path is absolute */
-    if (def->file && !g_path_is_absolute(def->file)) {
+    if (def->memorysnapshotfile && !g_path_is_absolute(def->memorysnapshotfile)) {
         virReportError(VIR_ERR_XML_ERROR,
                        _("memory snapshot file path (%s) must be absolute"),
-                       def->file);
+                       def->memorysnapshotfile);
         goto cleanup;
     }
 
@@ -863,7 +863,7 @@ virDomainSnapshotDefFormatInternal(virBuffer *buf,
     if (def->memory) {
         virBufferAsprintf(buf, "<memory snapshot='%s'",
                           virDomainSnapshotLocationTypeToString(def->memory));
-        virBufferEscapeString(buf, " file='%s'", def->file);
+        virBufferEscapeString(buf, " file='%s'", def->memorysnapshotfile);
         virBufferAddLit(buf, "/>\n");
     }
 
index 7d49a555cd74264589a8a916430a04fc3c97383d..a3ec0cd410980e1adaa1cda21b894b526931542d 100644 (file)
@@ -82,7 +82,7 @@ struct _virDomainSnapshotDef {
     int state; /* virDomainSnapshotState */
 
     int memory; /* virDomainMemorySnapshot */
-    char *file; /* memory state file when snapshot is external */
+    char *memorysnapshotfile; /* memory state file when snapshot is external */
 
     size_t ndisks; /* should not exceed dom->ndisks */
     virDomainSnapshotDiskDef *disks;
index dab386e455b4bcc6a28383ab7ec89b4fea16888b..99fc4b836f35af217b1277ba23672d7e5bbe2ceb 100644 (file)
@@ -1451,9 +1451,9 @@ qemuSnapshotCreateActiveExternal(virQEMUDriver *driver,
             goto cleanup;
         xml = NULL;
 
-        if ((ret = qemuSaveImageCreate(driver, vm, snapdef->file, data,
-                                      compressor, 0,
-                                      QEMU_ASYNC_JOB_SNAPSHOT)) < 0)
+        if ((ret = qemuSaveImageCreate(driver, vm, snapdef->memorysnapshotfile,
+                                       data, compressor, 0,
+                                       QEMU_ASYNC_JOB_SNAPSHOT)) < 0)
             goto cleanup;
 
         /* the memory image was created, remove it on errors */
@@ -1522,7 +1522,7 @@ qemuSnapshotCreateActiveExternal(virQEMUDriver *driver,
 
     virQEMUSaveDataFree(data);
     if (memory_unlink && ret < 0)
-        unlink(snapdef->file);
+        unlink(snapdef->memorysnapshotfile);
 
     return ret;
 }