We store the virQEMUDriverConfig object in the context.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_snapshot.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
index 0a93621b75..8855a019cb 100644
--- a/src/qemu/qemu_snapshot.c
+++ b/src/qemu/qemu_snapshot.c
@@ -1285,8 +1285,7 @@ qemuSnapshotDiskUpdateSource(virDomainObj *vm,
static int
-qemuSnapshotDiskCreate(qemuSnapshotDiskContext *snapctxt,
- virQEMUDriverConfig *cfg)
+qemuSnapshotDiskCreate(qemuSnapshotDiskContext *snapctxt)
{
qemuDomainObjPrivate *priv = snapctxt->vm->privateData;
virQEMUDriver *driver = priv->driver;
@@ -1317,9 +1316,9 @@ qemuSnapshotDiskCreate(qemuSnapshotDiskContext *snapctxt,
if (rc < 0)
return -1;
- if (virDomainObjSave(snapctxt->vm, driver->xmlopt, cfg->stateDir) < 0 ||
+ if (virDomainObjSave(snapctxt->vm, driver->xmlopt,
snapctxt->cfg->stateDir) < 0 ||
(snapctxt->vm->newDef &&
virDomainDefSave(snapctxt->vm->newDef, driver->xmlopt,
- cfg->configDir) < 0))
+ snapctxt->cfg->configDir) <
0))
return -1;
return 0;
@@ -1332,7 +1331,6 @@ qemuSnapshotCreateActiveExternalDisks(virDomainObj *vm,
virDomainMomentObj *snap,
GHashTable *blockNamedNodeData,
unsigned int flags,
- virQEMUDriverConfig *cfg,
qemuDomainAsyncJob asyncJob)
{
bool reuse = (flags & VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT) != 0;
@@ -1347,7 +1345,7 @@ qemuSnapshotCreateActiveExternalDisks(virDomainObj *vm,
blockNamedNodeData,
asyncJob)))
return -1;
- if (qemuSnapshotDiskCreate(snapctxt, cfg) < 0)
+ if (qemuSnapshotDiskCreate(snapctxt) < 0)
return -1;
return 0;
@@ -1368,8 +1366,6 @@ qemuSnapshotCreateDisksTransient(virDomainObj *vm,
qemuDomainAsyncJob asyncJob)
{
qemuDomainObjPrivate *priv = vm->privateData;
- virQEMUDriver *driver = priv->driver;
- g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
g_autoptr(qemuSnapshotDiskContext) snapctxt = NULL;
g_autoptr(GHashTable) blockNamedNodeData = NULL;
@@ -1382,7 +1378,7 @@ qemuSnapshotCreateDisksTransient(virDomainObj *vm,
asyncJob)))
return -1;
- if (qemuSnapshotDiskCreate(snapctxt, cfg) < 0)
+ if (qemuSnapshotDiskCreate(snapctxt) < 0)
return -1;
}
@@ -1518,7 +1514,7 @@ qemuSnapshotCreateActiveExternal(virQEMUDriver *driver,
/* the domain is now paused if a memory snapshot was requested */
if ((ret = qemuSnapshotCreateActiveExternalDisks(vm, snap,
- blockNamedNodeData, flags, cfg,
+ blockNamedNodeData, flags,
QEMU_ASYNC_JOB_SNAPSHOT)) < 0)
goto cleanup;
--
2.31.1