1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-30 18:50:18 +03:00

tools: remove --parallel from virsh restore command

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>
This commit is contained in:
Pavel Hrdina 2025-03-20 23:14:06 +01:00
parent 743f49aa66
commit ec274a96b6
2 changed files with 10 additions and 15 deletions

View 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

View 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) {