[libvirt] [PATCH 3/3] virsh: Add options for parallel migration

Jiri Denemark jdenemar at redhat.com
Wed Feb 6 16:09:01 UTC 2019


Signed-off-by: Jiri Denemark <jdenemar at redhat.com>
---
 tools/virsh-domain.c | 19 +++++++++++++++++++
 tools/virsh.pod      |  7 +++++++
 2 files changed, 26 insertions(+)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index db0d5d4dcc..94cade5757 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -10561,6 +10561,14 @@ static const vshCmdOptDef opts_migrate[] = {
      .type = VSH_OT_INT,
      .help = N_("post-copy migration bandwidth limit in MiB/s")
     },
+    {.name = "parallel",
+     .type = VSH_OT_BOOL,
+     .help = N_("enable parallel migration")
+    },
+    {.name = "parallel-connections",
+     .type = VSH_OT_INT,
+     .help = N_("number of connections for parallel migration")
+    },
     {.name = NULL}
 };
 
@@ -10766,6 +10774,14 @@ doMigrate(void *opaque)
             goto save_error;
     }
 
+    if (vshCommandOptInt(ctl, cmd, "parallel-connections", &intOpt) < 0)
+        goto out;
+    if (intOpt &&
+        virTypedParamsAddInt(&params, &nparams, &maxparams,
+                             VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS,
+                             intOpt) < 0)
+        goto save_error;
+
     if (vshCommandOptBool(cmd, "live"))
         flags |= VIR_MIGRATE_LIVE;
     if (vshCommandOptBool(cmd, "p2p"))
@@ -10814,6 +10830,9 @@ doMigrate(void *opaque)
     if (vshCommandOptBool(cmd, "tls"))
         flags |= VIR_MIGRATE_TLS;
 
+    if (vshCommandOptBool(cmd, "parallel"))
+        flags |= VIR_MIGRATE_PARALLEL;
+
     if (flags & VIR_MIGRATE_PEER2PEER || vshCommandOptBool(cmd, "direct")) {
         if (virDomainMigrateToURI3(dom, desturi, params, nparams, flags) == 0)
             ret = '0';
diff --git a/tools/virsh.pod b/tools/virsh.pod
index 67edb57b14..7604c7536e 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -1904,6 +1904,7 @@ I<domain> I<desturi> [I<migrateuri>] [I<graphicsuri>] [I<listen-address>] [I<dna
 [I<--comp-xbzrle-cache>] [I<--auto-converge>] [I<auto-converge-initial>]
 [I<auto-converge-increment>] [I<--persistent-xml> B<file>] [I<--tls>]
 [I<--postcopy-bandwidth> B<bandwidth>]
+[I<--parallel> [I<parallel-connections> B<connections>]]
 
 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>
@@ -1997,6 +1998,12 @@ Providing I<--tls> causes the migration to use the host configured TLS setup
 the migration of the domain. Usage requires proper TLS setup for both source
 and target.
 
+I<--parallel> option will cause migration data to be sent over multiple
+parallel connections. The number of such connections can be set using
+I<parallel-connections>. Parallel connections may help with saturating the
+network link between the source and the target and thus speeding up the
+migration.
+
 Running migration can be canceled by interrupting virsh (usually using
 C<Ctrl-C>) or by B<domjobabort> command sent from another virsh instance.
 
-- 
2.20.1




More information about the libvir-list mailing list