virsh: Add support for VIR_MIGRATE_PARAM_PERSIST_XML

Commit v1.3.3-181-gb028e9d7c implmented support for
VIR_MIGRATE_PARAM_PERSIST_XML migration parameter, but forgot to update
virsh.

https://bugzilla.redhat.com/show_bug.cgi?id=835300

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
Jiri Denemark 2016-11-22 14:06:43 +01:00
parent 1c122e737e
commit 38f7f297c8
3 changed files with 29 additions and 1 deletions

View File

@ -26,6 +26,8 @@
</li>
<li><strong>Improvements</strong>
<ul>
<li>virsh: Add support for passing an alternative persistent XML
to migrate command</li>
<li>vhostuser: Allow hotplug of multiqueue devices
</li>
<li>NEWS: Switch to an improved format<br/>

View File

@ -10105,6 +10105,10 @@ static const vshCmdOptDef opts_migrate[] = {
.type = VSH_OT_INT,
.help = N_("CPU throttling rate increment for auto-convergence")
},
{.name = "persistent-xml",
.type = VSH_OT_STRING,
.help = N_("filename containing updated persistent XML for the target")
},
{.name = NULL}
};
@ -10265,6 +10269,24 @@ doMigrate(void *opaque)
VIR_FREE(xml);
}
if (vshCommandOptStringReq(ctl, cmd, "persistent-xml", &opt) < 0)
goto out;
if (opt) {
char *xml;
if (virFileReadAll(opt, VSH_MAX_XML_FILE, &xml) < 0) {
vshError(ctl, _("cannot read file '%s'"), opt);
goto save_error;
}
if (virTypedParamsAddString(&params, &nparams, &maxparams,
VIR_MIGRATE_PARAM_PERSIST_XML, xml) < 0) {
VIR_FREE(xml);
goto save_error;
}
VIR_FREE(xml);
}
if ((rv = vshCommandOptInt(ctl, cmd, "auto-converge-initial", &intOpt)) < 0) {
goto out;
} else if (rv > 0) {
@ -10421,6 +10443,7 @@ cmdMigrate(vshControl *ctl, const vshCmd *cmd)
VSH_EXCLUSIVE_OPTIONS("live", "offline");
VSH_EXCLUSIVE_OPTIONS("timeout-suspend", "timeout-postcopy");
VSH_REQUIRE_OPTION("postcopy-after-precopy", "postcopy");
VSH_REQUIRE_OPTION("persistent-xml", "persistent");
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;

View File

@ -1625,7 +1625,7 @@ I<domain> I<desturi> [I<migrateuri>] [I<graphicsuri>] [I<listen-address>] [I<dna
[I<--compressed>] [I<--comp-methods> B<method-list>]
[I<--comp-mt-level>] [I<--comp-mt-threads>] [I<--comp-mt-dthreads>]
[I<--comp-xbzrle-cache>] [I<--auto-converge>] [I<auto-converge-initial>]
[I<auto-converge-increment>]
[I<auto-converge-increment>] [I<--persistent-xml> B<file>]
Migrate domain to another host. Add I<--live> for live migration; <--p2p>
for peer-2-peer migration; I<--direct> for direct migration; or I<--tunnelled>
@ -1679,6 +1679,9 @@ omitted, but can be used to supply an alternative XML file for use on
the destination to supply a larger set of changes to any host-specific
portions of the domain XML, such as accounting for naming differences
between source and destination in accessing underlying storage.
If I<--persistent> is enabled, I<--persistent-xml> B<file> can be used to
supply an alternative XML file which will be used as the persistent domain
definition on the destination host.
I<--timeout> B<seconds> tells virsh to run a specified action when live
migration exceeds that many seconds. It can only be used with I<--live>.