and its companion param VIR_SAVE_PARAM_PARALLEL_CONNECTIONS

Signed-off-by: Claudio Fontana <cfont...@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 9ad4945928..5a8d3d1309 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -2650,7 +2650,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;
@@ -2731,7 +2731,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;
 
@@ -2809,7 +2809,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;
@@ -2848,7 +2848,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);
@@ -2875,16 +2875,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;
 
@@ -2894,6 +2898,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;
@@ -2916,7 +2922,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 dee87ecfad..70ded3c439 100644
--- a/src/qemu/qemu_saveimage.c
+++ b/src/qemu/qemu_saveimage.c
@@ -521,6 +521,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 6db4e120cb..9b04af2fb9 100644
--- a/src/qemu/qemu_saveimage.h
+++ b/src/qemu/qemu_saveimage.h
@@ -116,6 +116,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 c6beeda1d0..3437c3e0cb 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.26.2

Reply via email to