[libvirt] [PATCH 11/13] Add new migration flag VIR_MIGRATE_TLS

John Ferlan posted 13 patches 8 years, 11 months ago
There is a newer version of this series
[libvirt] [PATCH 11/13] Add new migration flag VIR_MIGRATE_TLS
Posted by John Ferlan 8 years, 11 months ago
Signed-off-by: John Ferlan <jferlan@redhat.com>
---
 include/libvirt/libvirt-domain.h | 8 ++++++++
 src/qemu/qemu_migration.h        | 1 +
 tools/virsh-domain.c             | 7 +++++++
 3 files changed, 16 insertions(+)

diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
index e303140..931ff68 100644
--- a/include/libvirt/libvirt-domain.h
+++ b/include/libvirt/libvirt-domain.h
@@ -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;
 
 
diff --git a/src/qemu/qemu_migration.h b/src/qemu/qemu_migration.h
index 14c6178..8d88632 100644
--- a/src/qemu/qemu_migration.h
+++ b/src/qemu/qemu_migration.h
@@ -33,6 +33,7 @@ typedef qemuMigrationCompression *qemuMigrationCompressionPtr;
     (VIR_MIGRATE_LIVE |                         \
      VIR_MIGRATE_PEER2PEER |                    \
      VIR_MIGRATE_TUNNELLED |                    \
+     VIR_MIGRATE_TLS |                          \
      VIR_MIGRATE_PERSIST_DEST |                 \
      VIR_MIGRATE_UNDEFINE_SOURCE |              \
      VIR_MIGRATE_PAUSED |                       \
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 023ec8a..63ca236 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -10140,6 +10140,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}
 };
 
@@ -10381,6 +10385,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';
-- 
2.9.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 11/13] Add new migration flag VIR_MIGRATE_TLS
Posted by Jiri Denemark 8 years, 11 months ago
On Fri, Feb 17, 2017 at 14:39:28 -0500, John Ferlan wrote:
> Signed-off-by: John Ferlan <jferlan@redhat.com>
> ---
>  include/libvirt/libvirt-domain.h | 8 ++++++++
>  src/qemu/qemu_migration.h        | 1 +
>  tools/virsh-domain.c             | 7 +++++++
>  3 files changed, 16 insertions(+)
> 
> diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
> index e303140..931ff68 100644
> --- a/include/libvirt/libvirt-domain.h
> +++ b/include/libvirt/libvirt-domain.h
> @@ -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;
>  
>  
> diff --git a/src/qemu/qemu_migration.h b/src/qemu/qemu_migration.h
> index 14c6178..8d88632 100644
> --- a/src/qemu/qemu_migration.h
> +++ b/src/qemu/qemu_migration.h
> @@ -33,6 +33,7 @@ typedef qemuMigrationCompression *qemuMigrationCompressionPtr;
>      (VIR_MIGRATE_LIVE |                         \
>       VIR_MIGRATE_PEER2PEER |                    \
>       VIR_MIGRATE_TUNNELLED |                    \
> +     VIR_MIGRATE_TLS |                          \

Why did you insert it in the middle of the list?

>       VIR_MIGRATE_PERSIST_DEST |                 \
>       VIR_MIGRATE_UNDEFINE_SOURCE |              \
>       VIR_MIGRATE_PAUSED |                       \

Looks good otherwise.

Jirka

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 11/13] Add new migration flag VIR_MIGRATE_TLS
Posted by John Ferlan 8 years, 11 months ago

On 02/21/2017 04:08 PM, Jiri Denemark wrote:
> On Fri, Feb 17, 2017 at 14:39:28 -0500, John Ferlan wrote:
>> Signed-off-by: John Ferlan <jferlan@redhat.com>
>> ---
>>  include/libvirt/libvirt-domain.h | 8 ++++++++
>>  src/qemu/qemu_migration.h        | 1 +
>>  tools/virsh-domain.c             | 7 +++++++
>>  3 files changed, 16 insertions(+)
>>
>> diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
>> index e303140..931ff68 100644
>> --- a/include/libvirt/libvirt-domain.h
>> +++ b/include/libvirt/libvirt-domain.h
>> @@ -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;
>>  
>>  
>> diff --git a/src/qemu/qemu_migration.h b/src/qemu/qemu_migration.h
>> index 14c6178..8d88632 100644
>> --- a/src/qemu/qemu_migration.h
>> +++ b/src/qemu/qemu_migration.h
>> @@ -33,6 +33,7 @@ typedef qemuMigrationCompression *qemuMigrationCompressionPtr;
>>      (VIR_MIGRATE_LIVE |                         \
>>       VIR_MIGRATE_PEER2PEER |                    \
>>       VIR_MIGRATE_TUNNELLED |                    \
>> +     VIR_MIGRATE_TLS |                          \
> 
> Why did you insert it in the middle of the list?
> 

Dunno - I'll move it.

John
>>       VIR_MIGRATE_PERSIST_DEST |                 \
>>       VIR_MIGRATE_UNDEFINE_SOURCE |              \
>>       VIR_MIGRATE_PAUSED |                       \
> 
> Looks good otherwise.
> 
> Jirka
> 

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