[libvirt] [PATCH 03/12] qemu: Use macro for parsing ull migration parameters

Jiri Denemark jdenemar at redhat.com
Thu Oct 26 22:03:52 UTC 2017


Signed-off-by: Jiri Denemark <jdenemar at redhat.com>
---
 src/qemu/qemu_monitor_json.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index cb0bb0d0d..76fc84ed0 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -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);
-- 
2.14.3




More information about the libvir-list mailing list