]> xenbits.xensource.com Git - libvirt.git/commitdiff
migration: add target peer disks port
authorNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Thu, 17 Mar 2016 14:58:47 +0000 (17:58 +0300)
committerJiri Denemark <jdenemar@redhat.com>
Thu, 17 Mar 2016 15:20:15 +0000 (16:20 +0100)
Some hypervisors (namely qemu) can have a separate connecton for
non-shared disks migration of active domains. Currently we have
no means to control the port of such a connection. At the same
time we have options to control port of memory migration traffic
(thru migration uri) as well as interfaces that target server
is bound to for incoming migration (thru VIR_MIGRATE_PARAM_LISTEN_ADDRESS).
Let's add the option for setting disks port too.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
include/libvirt/libvirt-domain.h
tools/virsh-domain.c
tools/virsh.pod

index d6cdfca87071232916354b0b3bcdea1835fbd6f7..4ac29cd7881609c6c50140124d5bcb010d15c52a 100644 (file)
@@ -773,6 +773,16 @@ typedef enum {
  */
 # define VIR_MIGRATE_PARAM_MIGRATE_DISKS    "migrate_disks"
 
+/**
+ * VIR_MIGRATE_PARAM_DISKS_PORT:
+ *
+ * virDomainMigrate* params field: port that destination server should use
+ * for incoming disks migration. Type is VIR_TYPED_PARAM_INT. If set to 0 or
+ * omitted, libvirt will choose a suitable default. At the moment this is only
+ * supported by the QEMU driver.
+ */
+# define VIR_MIGRATE_PARAM_DISKS_PORT    "disks_port"
+
 /* Domain migration. */
 virDomainPtr virDomainMigrate (virDomainPtr domain, virConnectPtr dconn,
                                unsigned long flags, const char *dname,
index d60eafeafc39385b393a5b7684ca88b0a926dd93..854823ebca9eed42369fe25247f38e135bbd0f52 100644 (file)
@@ -9667,6 +9667,10 @@ static const vshCmdOptDef opts_migrate[] = {
      .type = VSH_OT_STRING,
      .help = N_("comma separated list of disks to be migrated")
     },
+    {.name = "disks-port",
+     .type = VSH_OT_INT,
+     .help = N_("port to use by target server for incoming disks migration")
+    },
     {.name = NULL}
 };
 
@@ -9677,6 +9681,7 @@ doMigrate(void *opaque)
     virDomainPtr dom = NULL;
     const char *desturi = NULL;
     const char *opt = NULL;
+    int disksPort = 0;
     unsigned int flags = 0;
     virshCtrlData *data = opaque;
     vshControl *ctl = data->ctl;
@@ -9719,6 +9724,13 @@ doMigrate(void *opaque)
                                 VIR_MIGRATE_PARAM_LISTEN_ADDRESS, opt) < 0)
         goto save_error;
 
+    if (vshCommandOptInt(ctl, cmd, "disks-port", &disksPort) < 0)
+        goto out;
+    if (disksPort &&
+        virTypedParamsAddInt(&params, &nparams, &maxparams,
+                             VIR_MIGRATE_PARAM_DISKS_PORT, disksPort) < 0)
+        goto save_error;
+
     if (vshCommandOptStringReq(ctl, cmd, "dname", &opt) < 0)
         goto out;
     if (opt &&
index 466265889310e8bb26701bc23effa9b739c1476b..1e2c6a68371734bcc8fe8dfdfd582008c0a3f00d 100644 (file)
@@ -1532,7 +1532,7 @@ to the I<uri> namespace is displayed instead of being modified.
 [I<--compressed>] [I<--abort-on-error>] [I<--auto-converge>]
 I<domain> I<desturi> [I<migrateuri>] [I<graphicsuri>] [I<listen-address>]
 [I<dname>] [I<--timeout> B<seconds>] [I<--xml> B<file>]
-[I<--migrate-disks> B<disk-list>]
+[I<--migrate-disks> B<disk-list>] [I<--disks-port> B<port>]
 
 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>
@@ -1659,6 +1659,9 @@ 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.
 
+Optional I<disks-port> sets the port that hypervisor on destination side should
+bind to for incoming disks traffic. Currently it is supported only by qemu.
+
 =item B<migrate-setmaxdowntime> I<domain> I<downtime>
 
 Set maximum tolerable downtime for a domain which is being live-migrated to