]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Drop giant if statement from qemuMonitorSetMigrationParams
authorJiri Denemark <jdenemar@redhat.com>
Thu, 26 Oct 2017 20:10:31 +0000 (22:10 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Thu, 2 Nov 2017 21:14:19 +0000 (22:14 +0100)
The check can be easily replaced with a simple test in the JSON
implementation and we don't need to update it every time a new parameter
is added.

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

index dd9d64a207d1772a9f2b8ac081e33d8497ad41ad..71069827e4013d40b28871430a15b557c4a82e19 100644 (file)
@@ -2618,15 +2618,6 @@ qemuMonitorSetMigrationParams(qemuMonitorPtr mon,
 
     QEMU_CHECK_MONITOR_JSON(mon);
 
-    if (!params->compressLevel_set &&
-        !params->compressThreads_set &&
-        !params->decompressThreads_set &&
-        !params->cpuThrottleInitial_set &&
-        !params->cpuThrottleIncrement_set &&
-        !params->migrateTLSAlias &&
-        !params->migrateTLSHostname)
-        return 0;
-
     return qemuMonitorJSONSetMigrationParams(mon, params);
 }
 
index 826133543e6c9da3f4f8dec8ab7f467ad1c27272..d3c37ded87b707336cb7f7ff63cba57d8ea67e9f 100644 (file)
@@ -2765,6 +2765,11 @@ qemuMonitorJSONSetMigrationParams(qemuMonitorPtr mon,
 #undef APPEND_INT
 #undef APPEND_STR
 
+    if (virJSONValueObjectKeysNumber(args) == 0) {
+        ret = 0;
+        goto cleanup;
+    }
+
     if (virJSONValueObjectAppend(cmd, "arguments", args) < 0)
         goto cleanup;
     args = NULL;