]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Rename TLS related migration parameters
authorJiri Denemark <jdenemar@redhat.com>
Thu, 26 Oct 2017 18:11:47 +0000 (20:11 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Thu, 2 Nov 2017 21:14:20 +0000 (22:14 +0100)
The parameters used "migrate" prefix which is pretty redundant and
qemuMonitorMigrationParams structure is our internal representation of
QEMU migration parameters and it is supposed to use names which match
QEMU names.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
src/qemu/qemu_migration.c
src/qemu/qemu_monitor.c
src/qemu/qemu_monitor.h
src/qemu/qemu_monitor_json.c
tests/qemumonitorjsontest.c

index af744661f40842d0065616dcd56d7f21b0285e31..e4e9e79ccb9c3a7c0e1c08b88a6f91f3b009274f 100644 (file)
@@ -114,7 +114,7 @@ qemuMigrationCheckTLSCreds(virQEMUDriverPtr driver,
         goto cleanup;
 
     /* NB: Could steal NULL pointer too! Let caller decide what to do. */
-    VIR_STEAL_PTR(priv->migTLSAlias, migParams.migrateTLSAlias);
+    VIR_STEAL_PTR(priv->migTLSAlias, migParams.tlsCreds);
 
     ret = 0;
 
@@ -225,7 +225,7 @@ qemuMigrationAddTLSObjects(virQEMUDriverPtr driver,
                                 *tlsAlias, &tlsProps) < 0)
         goto error;
 
-    if (VIR_STRDUP(migParams->migrateTLSAlias, *tlsAlias) < 0)
+    if (VIR_STRDUP(migParams->tlsCreds, *tlsAlias) < 0)
         goto error;
 
     return 0;
@@ -2349,8 +2349,8 @@ qemuMigrationParamsClear(qemuMonitorMigrationParamsPtr migParams)
     if (!migParams)
         return;
 
-    VIR_FREE(migParams->migrateTLSAlias);
-    VIR_FREE(migParams->migrateTLSHostname);
+    VIR_FREE(migParams->tlsCreds);
+    VIR_FREE(migParams->tlsHostname);
 }
 
 
@@ -2391,8 +2391,8 @@ qemuMigrationSetEmptyTLSParams(virQEMUDriverPtr driver,
    if (!priv->migTLSAlias)
        return 0;
 
-   if (VIR_STRDUP(migParams->migrateTLSAlias, "") < 0 ||
-       VIR_STRDUP(migParams->migrateTLSHostname, "") < 0)
+   if (VIR_STRDUP(migParams->tlsCreds, "") < 0 ||
+       VIR_STRDUP(migParams->tlsHostname, "") < 0)
        return -1;
 
     return 0;
@@ -2508,8 +2508,8 @@ qemuMigrationResetTLS(virQEMUDriverPtr driver,
     qemuDomainDelTLSObjects(driver, vm, asyncJob, secAlias, tlsAlias);
     qemuDomainSecretInfoFree(&priv->migSecinfo);
 
-    if (VIR_STRDUP(migParams.migrateTLSAlias, "") < 0 ||
-        VIR_STRDUP(migParams.migrateTLSHostname, "") < 0 ||
+    if (VIR_STRDUP(migParams.tlsCreds, "") < 0 ||
+        VIR_STRDUP(migParams.tlsHostname, "") < 0 ||
         qemuMigrationSetParams(driver, vm, asyncJob, &migParams) < 0)
         goto cleanup;
 
@@ -2774,7 +2774,7 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
             goto stopjob;
 
         /* Force reset of 'tls-hostname', it's a source only parameter */
-        if (VIR_STRDUP(migParams.migrateTLSHostname, "") < 0)
+        if (VIR_STRDUP(migParams.tlsHostname, "") < 0)
             goto stopjob;
 
     } else {
@@ -3737,12 +3737,11 @@ qemuMigrationRun(virQEMUDriverPtr driver,
          * connect directly to the destination. */
         if (spec->destType == MIGRATION_DEST_CONNECT_HOST ||
             spec->destType == MIGRATION_DEST_FD) {
-            if (VIR_STRDUP(migParams->migrateTLSHostname,
-                           spec->dest.host.name) < 0)
+            if (VIR_STRDUP(migParams->tlsHostname, spec->dest.host.name) < 0)
                 goto error;
         } else {
             /* Be sure there's nothing from a previous migration */
-            if (VIR_STRDUP(migParams->migrateTLSHostname, "") < 0)
+            if (VIR_STRDUP(migParams->tlsHostname, "") < 0)
                 goto error;
         }
     } else {
index c887267352cad2c2539780a017da22aa6dc5547a..3e2c69a9ab5dc48a097b2323e2615b84aa70c7f9 100644 (file)
@@ -2606,15 +2606,14 @@ qemuMonitorSetMigrationParams(qemuMonitorPtr mon,
 {
     VIR_DEBUG("compressLevel=%d:%d compressThreads=%d:%d "
               "decompressThreads=%d:%d cpuThrottleInitial=%d:%d "
-              "cpuThrottleIncrement=%d:%d tlsAlias=%s "
-              "tlsHostname=%s downtimeLimit=%d:%llu",
+              "cpuThrottleIncrement=%d:%d tlsCreds=%s tlsHostname=%s "
+              "downtimeLimit=%d:%llu",
               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,
-              NULLSTR(params->migrateTLSAlias),
-              NULLSTR(params->migrateTLSHostname),
+              NULLSTR(params->tlsCreds), NULLSTR(params->tlsHostname),
               params->downtimeLimit_set, params->downtimeLimit);
 
     QEMU_CHECK_MONITOR_JSON(mon);
index bc8494faee46bc1989aea8b2cae960593cb1f129..e123baaaeaafd2aff9959432ed47227c5682339b 100644 (file)
@@ -625,8 +625,8 @@ struct _qemuMonitorMigrationParams {
 
     /* Value is either NULL, "", or some string. NULL indicates no support;
      * whereas, some string value indicates we can support setting/clearing */
-    char *migrateTLSAlias;
-    char *migrateTLSHostname;
+    char *tlsCreds;
+    char *tlsHostname;
 
     bool downtimeLimit_set;
     unsigned long long downtimeLimit;
index a2f3e331747f007c08dcbe6ccf8f4dd72cb4f6ce..9f238bc30b41a42c382cfe891d5459e71eb10607 100644 (file)
@@ -2704,8 +2704,8 @@ qemuMonitorJSONGetMigrationParams(qemuMonitorPtr mon,
     PARSE_INT(decompressThreads, "decompress-threads");
     PARSE_INT(cpuThrottleInitial, "cpu-throttle-initial");
     PARSE_INT(cpuThrottleIncrement, "cpu-throttle-increment");
-    PARSE_STR(migrateTLSAlias, "tls-creds");
-    PARSE_STR(migrateTLSHostname, "tls-hostname");
+    PARSE_STR(tlsCreds, "tls-creds");
+    PARSE_STR(tlsHostname, "tls-hostname");
     PARSE_ULONG(downtimeLimit, "downtime-limit");
 
 #undef PARSE_SET
@@ -2762,8 +2762,8 @@ qemuMonitorJSONSetMigrationParams(qemuMonitorPtr mon,
     APPEND_INT(decompressThreads, "decompress-threads");
     APPEND_INT(cpuThrottleInitial, "cpu-throttle-initial");
     APPEND_INT(cpuThrottleIncrement, "cpu-throttle-increment");
-    APPEND_STR(migrateTLSAlias, "tls-creds");
-    APPEND_STR(migrateTLSHostname, "tls-hostname");
+    APPEND_STR(tlsCreds, "tls-creds");
+    APPEND_STR(tlsHostname, "tls-hostname");
     APPEND_ULONG(downtimeLimit, "downtime-limit");
 
 #undef APPEND
index cc55b0c43e5a2f61046bb4ab348aa2a26f151dd9..aa5da8be98f5154ccc0d7a88f060c663a4b8b67c 100644 (file)
@@ -1853,8 +1853,8 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationParams(const void *data)
     CHECK_INT(decompressThreads, "decompress-threads", 2);
     CHECK_INT(cpuThrottleInitial, "cpu-throttle-initial", 20);
     CHECK_INT(cpuThrottleIncrement, "cpu-throttle-increment", 10);
-    CHECK_STR(migrateTLSAlias, "tls-creds", "tls0");
-    CHECK_STR(migrateTLSHostname, "tls-hostname", "");
+    CHECK_STR(tlsCreds, "tls-creds", "tls0");
+    CHECK_STR(tlsHostname, "tls-hostname", "");
     CHECK_ULONG(downtimeLimit, "downtime-limit", 500ULL);
 
 #undef CHECK_NUM
@@ -1865,8 +1865,8 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationParams(const void *data)
     ret = 0;
 
  cleanup:
-    VIR_FREE(params.migrateTLSAlias);
-    VIR_FREE(params.migrateTLSHostname);
+    VIR_FREE(params.tlsCreds);
+    VIR_FREE(params.tlsHostname);
     qemuMonitorTestFree(test);
     return ret;
 }