[PATCH] virsh: Add support for VIR_MIGRATE_PARAM_PERSIST_XML

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 docs/news.html.in    |  2 ++
 tools/virsh-domain.c | 23 +++++++++++++++++++++++
 tools/virsh.pod      |  5 ++++-
 3 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/docs/news.html.in b/docs/news.html.in
index 56c03b35c..a6f86e518 100644
--- a/docs/news.html.in
+++ b/docs/news.html.in
@@ -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/>
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index a133c81ac..dedddeb96 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -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;
diff --git a/tools/virsh.pod b/tools/virsh.pod
index f278fecaf..74d531122 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -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>.
-- 
2.11.0.rc2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux