]> xenbits.xensource.com Git - libvirt.git/commitdiff
Migration: Introduce VIR_MIGRATE_PARAM_LISTEN_ADDRESS
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 8 Oct 2013 11:49:25 +0000 (13:49 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 11 Oct 2013 08:51:36 +0000 (10:51 +0200)
The parameter allows overriding default listen address for '-incoming'
cmd line argument on destination.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
include/libvirt/libvirt.h.in
tools/virsh-domain.c
tools/virsh.pod

index 83c219edd2e763660c2b3d7013afefe3af2e4941..820e8ce7778cff6339d7537595e4f7375bd9493e 100644 (file)
@@ -1270,6 +1270,16 @@ typedef enum {
  */
 #define VIR_MIGRATE_PARAM_GRAPHICS_URI      "graphics_uri"
 
+/**
+ * VIR_MIGRATE_PARAM_LISTEN_ADDRESS:
+ *
+ * virDomainMigrate* params field: The listen address that hypervisor on the
+ * destination side should bind to for incoming migration. Both, IPv4 and IPv6
+ * addresses are accepted as well as hostnames (the resolving is done on
+ * destination). Some hypervisors do not support this feature an will return an
+ * error if this field is used.
+ */
+#define VIR_MIGRATE_PARAM_LISTEN_ADDRESS    "listen_address"
 
 /* Domain migration. */
 virDomainPtr virDomainMigrate (virDomainPtr domain, virConnectPtr dconn,
index 42c99205937d7edb5a877bea21b08cb0928cbe97..6d241db7dcb461618507a3ed0d085852d61a2f2d 100644 (file)
@@ -8550,6 +8550,10 @@ static const vshCmdOptDef opts_migrate[] = {
      .type = VSH_OT_DATA,
      .help = N_("graphics URI to be used for seamless graphics migration")
     },
+    {.name = "listen-address",
+     .type = VSH_OT_DATA,
+     .help = N_("listen address that destination should bind to for incoming migration")
+    },
     {.name = "dname",
      .type = VSH_OT_DATA,
      .help = N_("rename to new name during migration (if supported)")
@@ -8606,6 +8610,13 @@ doMigrate(void *opaque)
                                 VIR_MIGRATE_PARAM_GRAPHICS_URI, opt) < 0)
         goto save_error;
 
+    if (vshCommandOptStringReq(ctl, cmd, "listen-address", &opt) < 0)
+        goto out;
+    if (opt &&
+        virTypedParamsAddString(&params, &nparams, &maxparams,
+                                VIR_MIGRATE_PARAM_LISTEN_ADDRESS, opt) < 0)
+        goto save_error;
+
     if (vshCommandOptStringReq(ctl, cmd, "dname", &opt) < 0)
         goto out;
     if (opt &&
index e12a800fb9db1b406badeb4b91888831a50bd377..c6f6adda029a7e6a07654d0a836d3638dac033ac 100644 (file)
@@ -1081,8 +1081,8 @@ stats.
 [I<--persistent>] [I<--undefinesource>] [I<--suspend>] [I<--copy-storage-all>]
 [I<--copy-storage-inc>] [I<--change-protection>] [I<--unsafe>] [I<--verbose>]
 [I<--compressed>] [I<--abort-on-error>]
-I<domain> I<desturi> [I<migrateuri>] [I<graphicsuri>] [I<dname>]
-[I<--timeout> B<seconds>] [I<--xml> B<file>]
+I<domain> I<desturi> [I<migrateuri>] [I<graphicsuri>] [I<listen-address>]
+[I<dname>] [I<--timeout> B<seconds>] [I<--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>
@@ -1189,6 +1189,12 @@ specific parameters separated by '&'. Currently recognized parameters are
 
     spice://target.host.com:1234/?tlsPort=4567
 
+Optional I<listen-address> sets the listen address that hypervisor on the
+destination side should bind to for incoming migration. Both IPv4 and IPv6
+addresses are accepted as well as hostnames (the resolving is done on
+destination). Some hypervisors do not support this feature and will return an
+error if this parameter is used.
+
 =item B<migrate-setmaxdowntime> I<domain> I<downtime>
 
 Set maximum tolerable downtime for a domain which is being live-migrated to