::
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.
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
.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")
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"))
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(¶ms, &nparams, &maxparams,
VIR_DOMAIN_SAVE_PARAM_PARALLEL_CHANNELS, nchannels) < 0)
return false;
+
+ flags |= VIR_DOMAIN_SAVE_PARALLEL;
}
if (flags || xml) {