From: Pavel Hrdina <phrd...@redhat.com>

There is no need to have --parallel and --parallel-channels especially
when --parallel on its own is the same as not used at all. In both cases
libvirt will default to single channel.

Signed-off-by: Pavel Hrdina <phrd...@redhat.com>
---
 docs/manpages/virsh.rst |  8 ++++----
 tools/virsh-domain.c    | 17 ++++++-----------
 2 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst
index 8143366826..fede984e11 100644
--- a/docs/manpages/virsh.rst
+++ b/docs/manpages/virsh.rst
@@ -4125,7 +4125,7 @@ restore
 ::
 
    restore state-file [--bypass-cache] [--xml file]
-      [{--running | --paused}] [--reset-nvram] [--parallel] 
[--parallel-channels]
+      [{--running | --paused}] [--reset-nvram] [--parallel-channels]
 
 Restores a domain from a ``virsh save`` state file. See *save* for more info.
 
@@ -4147,9 +4147,9 @@ domain should be started in.
 If *--reset-nvram* is specified, any existing NVRAM file will be deleted
 and re-initialized from its pristine template.
 
-*--parallel* option will cause the save data to be loaded using the number
-of parallel IO channels specified with *--parallel-channels*. Parallel
-channels will help speed up large restore operations.
+*--parallel-channels* option can specify number of parallel IO channels
+to be used when loading memory from file. Parallel save may significantly
+reduce the time required to save large memory domains.
 
 ``Note``: To avoid corrupting file system contents within the domain, you
 should not reuse the saved state file for a second ``restore`` unless you
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 1bee969824..bb49860604 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -5666,10 +5666,6 @@ static const vshCmdOptDef opts_restore[] = {
      .type = VSH_OT_BOOL,
      .help = N_("avoid file system cache when restoring")
     },
-    {.name = "parallel",
-     .type = VSH_OT_BOOL,
-     .help = N_("enable parallel restore")
-    },
     {.name = "parallel-channels",
      .type = VSH_OT_INT,
      .help = N_("number of IO channels to use for parallel restore")
@@ -5706,13 +5702,11 @@ cmdRestore(vshControl *ctl, const vshCmd *cmd)
     virTypedParameterPtr params = NULL;
     int nparams = 0;
     int maxparams = 0;
-    int nchannels = 1;
+    int nchannels = 0;
     int rc;
 
     if (vshCommandOptBool(cmd, "bypass-cache"))
         flags |= VIR_DOMAIN_SAVE_BYPASS_CACHE;
-    if (vshCommandOptBool(cmd, "parallel"))
-        flags |= VIR_DOMAIN_SAVE_PARALLEL;
     if (vshCommandOptBool(cmd, "running"))
         flags |= VIR_DOMAIN_SAVE_RUNNING;
     if (vshCommandOptBool(cmd, "paused"))
@@ -5738,13 +5732,14 @@ cmdRestore(vshControl *ctl, const vshCmd *cmd)
                                 VIR_DOMAIN_SAVE_PARAM_DXML, xml) < 0)
         return false;
 
-    if (flags & VIR_DOMAIN_SAVE_PARALLEL) {
-        if ((rc = vshCommandOptInt(ctl, cmd, "parallel-channels", &nchannels)) 
< 0)
-            return false;
-
+    if ((rc = vshCommandOptInt(ctl, cmd, "parallel-channels", &nchannels)) < 0)
+        return false;
+    if (rc == 1) {
         if (virTypedParamsAddInt(&params, &nparams, &maxparams,
                                  VIR_DOMAIN_SAVE_PARAM_PARALLEL_CHANNELS, 
nchannels) < 0)
             return false;
+
+        flags |= VIR_DOMAIN_SAVE_PARALLEL;
     }
 
     if (flags || xml) {
-- 
2.48.1

Reply via email to