[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 10/13] qemu: Add TLS params to _qemuMonitorMigrationParams



Add the fields to support setting tls-creds and tls-hostname during
a migration (either source or target)

Signed-off-by: John Ferlan <jferlan redhat com>
---
 src/qemu/qemu_monitor.c      | 12 +++++++++---
 src/qemu/qemu_monitor.h      |  7 +++++++
 src/qemu/qemu_monitor_json.c | 11 +++++++++++
 3 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index b15207a..f5720d3 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -2504,12 +2504,16 @@ qemuMonitorSetMigrationParams(qemuMonitorPtr mon,
 {
     VIR_DEBUG("compressLevel=%d:%d compressThreads=%d:%d "
               "decompressThreads=%d:%d cpuThrottleInitial=%d:%d "
-              "cpuThrottleIncrement=%d:%d",
+              "cpuThrottleIncrement=%d:%d tlsAlias=%d:%s "
+              "tlsHostname=%d:%s",
               params->compressLevel_set, params->compressLevel,
               params->compressThreads_set, params->compressThreads,
               params->decompressThreads_set, params->decompressThreads,
               params->cpuThrottleInitial_set, params->cpuThrottleInitial,
-              params->cpuThrottleIncrement_set, params->cpuThrottleIncrement);
+              params->cpuThrottleIncrement_set, params->cpuThrottleIncrement,
+              params->migrateTLSAlias_set, NULLSTR(params->migrateTLSAlias),
+              params->migrateTLSHostname_set,
+              NULLSTR(params->migrateTLSHostname));
 
     QEMU_CHECK_MONITOR_JSON(mon);
 
@@ -2517,7 +2521,9 @@ qemuMonitorSetMigrationParams(qemuMonitorPtr mon,
         !params->compressThreads_set &&
         !params->decompressThreads_set &&
         !params->cpuThrottleInitial_set &&
-        !params->cpuThrottleIncrement_set)
+        !params->cpuThrottleIncrement_set &&
+        !params->migrateTLSAlias_set &&
+        !params->migrateTLSHostname_set)
         return 0;
 
     return qemuMonitorJSONSetMigrationParams(mon, params);
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index 8811d85..d719112 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -570,6 +570,13 @@ struct _qemuMonitorMigrationParams {
 
     bool cpuThrottleIncrement_set;
     int cpuThrottleIncrement;
+
+    /* Input only for destination */
+    bool migrateTLSAlias_set;
+    char *migrateTLSAlias;
+
+    bool migrateTLSHostname_set;
+    char *migrateTLSHostname;
 };
 
 int qemuMonitorGetMigrationParams(qemuMonitorPtr mon,
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 7aa9e31..7a70366 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -2637,6 +2637,17 @@ qemuMonitorJSONSetMigrationParams(qemuMonitorPtr mon,
 
 #undef APPEND
 
+    /* Set only parameters for TLS migration options */
+    if (params->migrateTLSAlias_set &&
+        virJSONValueObjectAppendString(args, "tls-creds",
+                                       params->migrateTLSAlias) < 0)
+        goto cleanup;
+
+    if (params->migrateTLSHostname_set &&
+        virJSONValueObjectAppendString(args, "tls-hostname",
+                                       params->migrateTLSHostname) < 0)
+        goto cleanup;
+
     if (virJSONValueObjectAppend(cmd, "arguments", args) < 0)
         goto cleanup;
     args = NULL;
-- 
2.9.3


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]