and its companion param VIR_SAVE_PARAM_PARALLEL_CONNECTIONS
Signed-off-by: Claudio Fontana <cfontana(a)suse.de>
---
src/qemu/qemu_driver.c | 18 ++++++++++++------
src/qemu/qemu_saveimage.c | 1 +
src/qemu/qemu_saveimage.h | 1 +
src/qemu/qemu_snapshot.c | 2 +-
4 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index b6e7e74367..4114d8919b 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -2641,7 +2641,7 @@ static int
qemuDomainSaveInternal(virQEMUDriver *driver,
virDomainObj *vm, const char *path,
int compressed, virCommand *compressor,
- const char *xmlin, unsigned int flags)
+ const char *xmlin, int nconn, unsigned int flags)
{
g_autofree char *xml = NULL;
bool was_running = false;
@@ -2722,7 +2722,7 @@ qemuDomainSaveInternal(virQEMUDriver *driver,
xml = NULL;
ret = qemuSaveImageCreate(driver, vm, path, data, compressor,
- flags, VIR_ASYNC_JOB_SAVE);
+ nconn, flags, VIR_ASYNC_JOB_SAVE);
if (ret < 0)
goto endjob;
@@ -2800,7 +2800,7 @@ qemuDomainManagedSaveHelper(virQEMUDriver *driver,
VIR_INFO("Saving state of domain '%s' to '%s'",
vm->def->name, path);
if (qemuDomainSaveInternal(driver, vm, path, compressed,
- compressor, dxml, flags) < 0)
+ compressor, dxml, -1, flags) < 0)
return -1;
vm->hasManagedSave = true;
@@ -2839,7 +2839,7 @@ qemuDomainSaveFlags(virDomainPtr dom, const char *path, const char
*dxml,
goto cleanup;
ret = qemuDomainSaveInternal(driver, vm, path, compressed,
- compressor, dxml, flags);
+ compressor, dxml, -1, flags);
cleanup:
virDomainObjEndAPI(&vm);
@@ -2866,16 +2866,20 @@ qemuDomainSaveParams(virDomainPtr dom,
const char *dxml = NULL;
int compressed;
int ret = -1;
+ int nconn = 2;
virCheckFlags(VIR_DOMAIN_SAVE_BYPASS_CACHE |
VIR_DOMAIN_SAVE_RUNNING |
- VIR_DOMAIN_SAVE_PAUSED, -1);
+ VIR_DOMAIN_SAVE_PAUSED |
+ VIR_DOMAIN_SAVE_PARALLEL, -1);
if (virTypedParamsValidate(params, nparams,
VIR_DOMAIN_SAVE_PARAM_FILE,
VIR_TYPED_PARAM_STRING,
VIR_DOMAIN_SAVE_PARAM_DXML,
VIR_TYPED_PARAM_STRING,
+ VIR_DOMAIN_SAVE_PARAM_PARALLEL_CONNECTIONS,
+ VIR_TYPED_PARAM_INT,
NULL) < 0)
return -1;
@@ -2885,6 +2889,8 @@ qemuDomainSaveParams(virDomainPtr dom,
if (virTypedParamsGetString(params, nparams,
VIR_DOMAIN_SAVE_PARAM_DXML, &dxml) < 0)
return -1;
+ if (virTypedParamsGetInt(params, nparams, VIR_DOMAIN_SAVE_PARAM_PARALLEL_CONNECTIONS,
&nconn) < 0)
+ return -1;
if (!(vm = qemuDomainObjFromDomain(dom)))
goto cleanup;
@@ -2907,7 +2913,7 @@ qemuDomainSaveParams(virDomainPtr dom,
goto cleanup;
ret = qemuDomainSaveInternal(driver, vm, to, compressed,
- compressor, dxml, flags);
+ compressor, dxml, nconn, flags);
cleanup:
virDomainObjEndAPI(&vm);
diff --git a/src/qemu/qemu_saveimage.c b/src/qemu/qemu_saveimage.c
index 3d8a061a77..ca6eccd7b5 100644
--- a/src/qemu/qemu_saveimage.c
+++ b/src/qemu/qemu_saveimage.c
@@ -518,6 +518,7 @@ qemuSaveImageCreate(virQEMUDriver *driver,
const char *path,
virQEMUSaveData *data,
virCommand *compressor,
+ int nconn G_GNUC_UNUSED,
unsigned int flags,
virDomainAsyncJob asyncJob)
{
diff --git a/src/qemu/qemu_saveimage.h b/src/qemu/qemu_saveimage.h
index 16848985cb..e5a51955da 100644
--- a/src/qemu/qemu_saveimage.h
+++ b/src/qemu/qemu_saveimage.h
@@ -111,6 +111,7 @@ qemuSaveImageCreate(virQEMUDriver *driver,
const char *path,
virQEMUSaveData *data,
virCommand *compressor,
+ int nconn,
unsigned int flags,
virDomainAsyncJob asyncJob);
diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
index b62fab7bb3..2e445e8296 100644
--- a/src/qemu/qemu_snapshot.c
+++ b/src/qemu/qemu_snapshot.c
@@ -1457,7 +1457,7 @@ qemuSnapshotCreateActiveExternal(virQEMUDriver *driver,
memory_existing = virFileExists(snapdef->memorysnapshotfile);
if ((ret = qemuSaveImageCreate(driver, vm, snapdef->memorysnapshotfile,
- data, compressor, 0,
+ data, compressor, -1, 0,
VIR_ASYNC_JOB_SNAPSHOT)) < 0)
goto cleanup;
--
2.35.3