and its companion param VIR_SAVE_PARAM_PARALLEL_CONNECTIONS

Signed-off-by: Claudio Fontana <cfont...@suse.de>
---
 src/qemu/qemu_driver.c    | 17 +++++++++++------
 src/qemu/qemu_saveimage.c |  1 +
 src/qemu/qemu_saveimage.h |  1 +
 src/qemu/qemu_snapshot.c  |  2 +-
 4 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index e3582f62a7..e276a66815 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;
 
@@ -2791,7 +2791,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);
@@ -2815,16 +2815,19 @@ qemuDomainSaveParams(virDomainPtr dom,
     int compressed;
     g_autoptr(virCommand) compressor = NULL;
     int ret = -1;
+    int nconn = 0;
     virDomainObj *vm = NULL;
     g_autoptr(virQEMUDriverConfig) cfg = NULL;
 
     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_SAVE_PARAM_FILE, VIR_TYPED_PARAM_STRING,
                                VIR_SAVE_PARAM_DXML, VIR_TYPED_PARAM_STRING,
+                               VIR_SAVE_PARAM_PARALLEL_CONNECTIONS, 
VIR_TYPED_PARAM_INT,
                                NULL) < 0)
         return -1;
 
@@ -2832,6 +2835,8 @@ qemuDomainSaveParams(virDomainPtr dom,
         return -1;
     if (virTypedParamsGetString(params, nparams, VIR_SAVE_PARAM_DXML, &dxml) < 
0)
         return -1;
+    if (virTypedParamsGetInt(params, nparams, 
VIR_SAVE_PARAM_PARALLEL_CONNECTIONS, &nconn) < 0)
+        return -1;
 
     cfg = virQEMUDriverGetConfig(driver);
     if ((compressed = qemuSaveImageGetCompressionProgram(cfg->saveImageFormat,
@@ -2849,7 +2854,7 @@ qemuDomainSaveParams(virDomainPtr dom,
         goto cleanup;
 
     ret = qemuDomainSaveInternal(driver, vm, to, compressed,
-                                 compressor, dxml, flags);
+                                 compressor, dxml, nconn, flags);
 
  cleanup:
     virDomainObjEndAPI(&vm);
@@ -2906,7 +2911,7 @@ qemuDomainManagedSave(virDomainPtr dom, unsigned int 
flags)
     VIR_INFO("Saving state of domain '%s' to '%s'", vm->def->name, name);
 
     ret = qemuDomainSaveInternal(driver, vm, name, compressed,
-                                 compressor, NULL, flags);
+                                 compressor, NULL, -1, flags);
     if (ret == 0)
         vm->hasManagedSave = true;
 
diff --git a/src/qemu/qemu_saveimage.c b/src/qemu/qemu_saveimage.c
index 4fd4c5cfcd..7c76db359e 100644
--- a/src/qemu/qemu_saveimage.c
+++ b/src/qemu/qemu_saveimage.c
@@ -258,6 +258,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 391cd55ed0..b3d5c02fd6 100644
--- a/src/qemu/qemu_saveimage.h
+++ b/src/qemu/qemu_saveimage.h
@@ -96,6 +96,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

Reply via email to