mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemuSnapshotDiskCreate: Use 'cfg' from the qemuSnapshotDiskContext
We store the virQEMUDriverConfig object in the context. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
2ec54727f7
commit
f9e8857eec
@ -1286,8 +1286,7 @@ qemuSnapshotDiskUpdateSource(virDomainObj *vm,
|
|||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
qemuSnapshotDiskCreate(qemuSnapshotDiskContext *snapctxt,
|
qemuSnapshotDiskCreate(qemuSnapshotDiskContext *snapctxt)
|
||||||
virQEMUDriverConfig *cfg)
|
|
||||||
{
|
{
|
||||||
qemuDomainObjPrivate *priv = snapctxt->vm->privateData;
|
qemuDomainObjPrivate *priv = snapctxt->vm->privateData;
|
||||||
virQEMUDriver *driver = priv->driver;
|
virQEMUDriver *driver = priv->driver;
|
||||||
@ -1318,9 +1317,9 @@ qemuSnapshotDiskCreate(qemuSnapshotDiskContext *snapctxt,
|
|||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
return -1;
|
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,
|
(snapctxt->vm->newDef && virDomainDefSave(snapctxt->vm->newDef, driver->xmlopt,
|
||||||
cfg->configDir) < 0))
|
snapctxt->cfg->configDir) < 0))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -1333,7 +1332,6 @@ qemuSnapshotCreateActiveExternalDisks(virDomainObj *vm,
|
|||||||
virDomainMomentObj *snap,
|
virDomainMomentObj *snap,
|
||||||
GHashTable *blockNamedNodeData,
|
GHashTable *blockNamedNodeData,
|
||||||
unsigned int flags,
|
unsigned int flags,
|
||||||
virQEMUDriverConfig *cfg,
|
|
||||||
qemuDomainAsyncJob asyncJob)
|
qemuDomainAsyncJob asyncJob)
|
||||||
{
|
{
|
||||||
bool reuse = (flags & VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT) != 0;
|
bool reuse = (flags & VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT) != 0;
|
||||||
@ -1348,7 +1346,7 @@ qemuSnapshotCreateActiveExternalDisks(virDomainObj *vm,
|
|||||||
blockNamedNodeData, asyncJob)))
|
blockNamedNodeData, asyncJob)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (qemuSnapshotDiskCreate(snapctxt, cfg) < 0)
|
if (qemuSnapshotDiskCreate(snapctxt) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -1369,8 +1367,6 @@ qemuSnapshotCreateDisksTransient(virDomainObj *vm,
|
|||||||
qemuDomainAsyncJob asyncJob)
|
qemuDomainAsyncJob asyncJob)
|
||||||
{
|
{
|
||||||
qemuDomainObjPrivate *priv = vm->privateData;
|
qemuDomainObjPrivate *priv = vm->privateData;
|
||||||
virQEMUDriver *driver = priv->driver;
|
|
||||||
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
|
|
||||||
g_autoptr(qemuSnapshotDiskContext) snapctxt = NULL;
|
g_autoptr(qemuSnapshotDiskContext) snapctxt = NULL;
|
||||||
g_autoptr(GHashTable) blockNamedNodeData = NULL;
|
g_autoptr(GHashTable) blockNamedNodeData = NULL;
|
||||||
|
|
||||||
@ -1383,7 +1379,7 @@ qemuSnapshotCreateDisksTransient(virDomainObj *vm,
|
|||||||
asyncJob)))
|
asyncJob)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (qemuSnapshotDiskCreate(snapctxt, cfg) < 0)
|
if (qemuSnapshotDiskCreate(snapctxt) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1519,7 +1515,7 @@ qemuSnapshotCreateActiveExternal(virQEMUDriver *driver,
|
|||||||
/* the domain is now paused if a memory snapshot was requested */
|
/* the domain is now paused if a memory snapshot was requested */
|
||||||
|
|
||||||
if ((ret = qemuSnapshotCreateActiveExternalDisks(vm, snap,
|
if ((ret = qemuSnapshotCreateActiveExternalDisks(vm, snap,
|
||||||
blockNamedNodeData, flags, cfg,
|
blockNamedNodeData, flags,
|
||||||
QEMU_ASYNC_JOB_SNAPSHOT)) < 0)
|
QEMU_ASYNC_JOB_SNAPSHOT)) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user