]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Add new migration flag VIR_MIGRATE_TLS
authorJohn Ferlan <jferlan@redhat.com>
Wed, 15 Feb 2017 13:58:46 +0000 (08:58 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Sat, 25 Mar 2017 12:19:49 +0000 (08:19 -0400)
Signed-off-by: John Ferlan <jferlan@redhat.com>
include/libvirt/libvirt-domain.h
src/qemu/qemu_migration.h
tools/virsh-domain.c

index c490d712f22ebeb41b9fba4e090ed8e213502334..620606c6284716dabfe13bf6eeec9adf215298cb 100644 (file)
@@ -815,6 +815,14 @@ typedef enum {
      * post-copy mode. See virDomainMigrateStartPostCopy for more details.
      */
     VIR_MIGRATE_POSTCOPY          = (1 << 15),
+
+    /* Setting the VIR_MIGRATE_TLS flag will cause the migration to attempt
+     * to use the TLS environment configured by the hypervisor in order to
+     * perform the migration. If incorrectly configured on either source or
+     * destination, the migration will fail.
+     */
+    VIR_MIGRATE_TLS               = (1 << 16),
+
 } virDomainMigrateFlags;
 
 
index 14c61788756a70dd210e0b41f4c5b90641a554cd..bcebf064a98eb915097116808ae7f708433d6dd8 100644 (file)
@@ -45,7 +45,8 @@ typedef qemuMigrationCompression *qemuMigrationCompressionPtr;
      VIR_MIGRATE_ABORT_ON_ERROR |               \
      VIR_MIGRATE_AUTO_CONVERGE |                \
      VIR_MIGRATE_RDMA_PIN_ALL |                 \
-     VIR_MIGRATE_POSTCOPY)
+     VIR_MIGRATE_POSTCOPY |                     \
+     VIR_MIGRATE_TLS)
 
 /* All supported migration parameters and their types. */
 # define QEMU_MIGRATION_PARAMETERS                                \
index 09a9f82033fb3ba1ac6bc6f65230bf04315fb277..ebd4b33deda33b2f9bceff44f1977f1c1cf530ea 100644 (file)
@@ -10222,6 +10222,10 @@ static const vshCmdOptDef opts_migrate[] = {
      .type = VSH_OT_STRING,
      .help = N_("filename containing updated persistent XML for the target")
     },
+    {.name = "tls",
+     .type = VSH_OT_BOOL,
+     .help = N_("use TLS for migration")
+    },
     {.name = NULL}
 };
 
@@ -10463,6 +10467,9 @@ doMigrate(void *opaque)
     if (vshCommandOptBool(cmd, "postcopy"))
         flags |= VIR_MIGRATE_POSTCOPY;
 
+    if (vshCommandOptBool(cmd, "tls"))
+        flags |= VIR_MIGRATE_TLS;
+
     if (flags & VIR_MIGRATE_PEER2PEER || vshCommandOptBool(cmd, "direct")) {
         if (virDomainMigrateToURI3(dom, desturi, params, nparams, flags) == 0)
             ret = '0';