]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tools: remove --parallel from virsh restore command
authorPavel Hrdina <phrdina@redhat.com>
Thu, 20 Mar 2025 22:14:06 +0000 (23:14 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Fri, 21 Mar 2025 09:56:19 +0000 (10:56 +0100)
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 <phrdina@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
docs/manpages/virsh.rst
tools/virsh-domain.c

index 8143366826ded616e578ed3fababe3cfc11f6a6a..fede984e112a1856f57235a7c2b99413c3ef4fa5 100644 (file)
@@ -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
index 1bee9698244b3343e9769024e442ba37eaab086d..bb49860604c5a87ef919b19996afe46dfee2226f 100644 (file)
@@ -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) {