]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Use macro for parsing ull migration parameters
authorJiri Denemark <jdenemar@redhat.com>
Mon, 23 Oct 2017 15:17:58 +0000 (17:17 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Thu, 2 Nov 2017 21:14:18 +0000 (22:14 +0100)
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
src/qemu/qemu_monitor_json.c

index cb0bb0d0df49c51b4147b4da6075eed4dcbc2f68..76fc84ed05050dc60f69647a8219829427af5b1b 100644 (file)
@@ -2687,6 +2687,9 @@ qemuMonitorJSONGetMigrationParams(qemuMonitorPtr mon,
 #define PARSE_INT(VAR, FIELD)                                               \
     PARSE_SET(virJSONValueObjectGetNumberInt, VAR, FIELD)
 
+#define PARSE_ULONG(VAR, FIELD)                                             \
+    PARSE_SET(virJSONValueObjectGetNumberUlong, VAR, FIELD)
+
 #define PARSE_STR(VAR, FIELD)                                               \
     do {                                                                    \
         const char *str;                                                    \
@@ -2703,15 +2706,13 @@ qemuMonitorJSONGetMigrationParams(qemuMonitorPtr mon,
     PARSE_INT(cpuThrottleIncrement, "cpu-throttle-increment");
     PARSE_STR(migrateTLSAlias, "tls-creds");
     PARSE_STR(migrateTLSHostname, "tls-hostname");
+    PARSE_ULONG(downtimeLimit, "downtime-limit");
 
 #undef PARSE_SET
 #undef PARSE_INT
+#undef PARSE_ULONG
 #undef PARSE_STR
 
-    if (virJSONValueObjectGetNumberUlong(result, "downtime-limit",
-                                         &params->downtimeLimit) == 0)
-        params->downtimeLimit_set = true;
-
     ret = 0;
  cleanup:
     virJSONValueFree(cmd);