mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemu: Add memoryBackingDir to qemuDomainObjPrivate
This way we _can_ (but do not, yet) remember the memory backing path for running domains even after configuration change and daemon restart. Signed-off-by: Martin Kletzander <mkletzan@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
@@ -1934,6 +1934,8 @@ qemuDomainObjPrivateDataClear(qemuDomainObjPrivate *priv)
|
||||
g_slist_free_full(g_steal_pointer(&priv->threadContextAliases), g_free);
|
||||
|
||||
priv->migrationRecoverSetup = false;
|
||||
|
||||
g_clear_pointer(&priv->memoryBackingDir, g_free);
|
||||
}
|
||||
|
||||
|
||||
@@ -2708,6 +2710,7 @@ qemuDomainObjPrivateXMLFormat(virBuffer *buf,
|
||||
virBufferEscapeString(buf, "<libDir path='%s'/>\n", priv->libDir);
|
||||
virBufferEscapeString(buf, "<channelTargetDir path='%s'/>\n",
|
||||
priv->channelTargetDir);
|
||||
virBufferEscapeString(buf, "<memoryBackingDir path='%s'/>\n", priv->memoryBackingDir);
|
||||
|
||||
virCPUDefFormatBufFull(buf, priv->origCPU, NULL);
|
||||
|
||||
@@ -3429,6 +3432,8 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt,
|
||||
priv->channelTargetDir = tmp;
|
||||
tmp = NULL;
|
||||
|
||||
priv->memoryBackingDir = virXPathString("string(./memoryBackingDir/@path)", ctxt);
|
||||
|
||||
qemuDomainSetPrivatePathsOld(driver, vm);
|
||||
|
||||
if (virCPUDefParseXML(ctxt, "./cpu", VIR_CPU_TYPE_GUEST, &priv->origCPU,
|
||||
|
||||
@@ -261,6 +261,8 @@ struct _qemuDomainObjPrivate {
|
||||
|
||||
/* named file descriptor groups associated with the VM */
|
||||
GHashTable *fds;
|
||||
|
||||
char *memoryBackingDir;
|
||||
};
|
||||
|
||||
#define QEMU_DOMAIN_PRIVATE(vm) \
|
||||
|
||||
Reference in New Issue
Block a user