提交 7ddcab89 编写于 作者: J Jiri Denemark

qemu: Use macro for parsing ull migration parameters

Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
上级 4fabc0ca
...@@ -2687,6 +2687,9 @@ qemuMonitorJSONGetMigrationParams(qemuMonitorPtr mon, ...@@ -2687,6 +2687,9 @@ qemuMonitorJSONGetMigrationParams(qemuMonitorPtr mon,
#define PARSE_INT(VAR, FIELD) \ #define PARSE_INT(VAR, FIELD) \
PARSE_SET(virJSONValueObjectGetNumberInt, VAR, FIELD) PARSE_SET(virJSONValueObjectGetNumberInt, VAR, FIELD)
#define PARSE_ULONG(VAR, FIELD) \
PARSE_SET(virJSONValueObjectGetNumberUlong, VAR, FIELD)
#define PARSE_STR(VAR, FIELD) \ #define PARSE_STR(VAR, FIELD) \
do { \ do { \
const char *str; \ const char *str; \
...@@ -2703,15 +2706,13 @@ qemuMonitorJSONGetMigrationParams(qemuMonitorPtr mon, ...@@ -2703,15 +2706,13 @@ qemuMonitorJSONGetMigrationParams(qemuMonitorPtr mon,
PARSE_INT(cpuThrottleIncrement, "cpu-throttle-increment"); PARSE_INT(cpuThrottleIncrement, "cpu-throttle-increment");
PARSE_STR(migrateTLSAlias, "tls-creds"); PARSE_STR(migrateTLSAlias, "tls-creds");
PARSE_STR(migrateTLSHostname, "tls-hostname"); PARSE_STR(migrateTLSHostname, "tls-hostname");
PARSE_ULONG(downtimeLimit, "downtime-limit");
#undef PARSE_SET #undef PARSE_SET
#undef PARSE_INT #undef PARSE_INT
#undef PARSE_ULONG
#undef PARSE_STR #undef PARSE_STR
if (virJSONValueObjectGetNumberUlong(result, "downtime-limit",
&params->downtimeLimit) == 0)
params->downtimeLimit_set = true;
ret = 0; ret = 0;
cleanup: cleanup:
virJSONValueFree(cmd); virJSONValueFree(cmd);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册