mirror of https://gitee.com/openkylin/libvirt.git
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:
parent
308aafe289
commit
b30a8ee67d
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue