conf: snapshot: rename variable holding memory snapshot file location

'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>
This commit is contained in:
Peter Krempa 2021-06-16 16:54:18 +02:00
parent 308aafe289
commit b30a8ee67d
3 changed files with 10 additions and 10 deletions

View 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");
}

View 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;

View 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;
}