qemumonitorjsontest: Rename 2nd CHECK macro in migration params test

The second CHECK macro was used for string parameters. Let's rename it
to CHECK_STR and move it up to have all checks in one place.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
Jiri Denemark 2017-10-26 20:52:32 +02:00
parent cf0c87aacf
commit 9b5d1bd2e3

View File

@ -1830,16 +1830,7 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationParams(const void *data)
#define CHECK_INT(VAR, FIELD, VALUE) \
CHECK_NUM(VAR, FIELD, VALUE, "%d")
CHECK_INT(compressLevel, "compress-level", 1);
CHECK_INT(compressThreads, "compress-threads", 8);
CHECK_INT(decompressThreads, "decompress-threads", 2);
CHECK_INT(cpuThrottleInitial, "cpu-throttle-initial", 20);
CHECK_INT(cpuThrottleIncrement, "cpu-throttle-increment", 10);
#undef CHECK_NUM
#undef CHECK_INT
#define CHECK(VAR, FIELD, VALUE) \
#define CHECK_STR(VAR, FIELD, VALUE) \
do { \
if (!params.VAR) { \
virReportError(VIR_ERR_INTERNAL_ERROR, "%s is not set", FIELD); \
@ -1853,10 +1844,17 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationParams(const void *data)
} \
} while (0)
CHECK(migrateTLSAlias, "tls-creds", "tls0");
CHECK(migrateTLSHostname, "tls-hostname", "");
CHECK_INT(compressLevel, "compress-level", 1);
CHECK_INT(compressThreads, "compress-threads", 8);
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", "");
#undef CHECK
#undef CHECK_NUM
#undef CHECK_INT
#undef CHECK_STR
ret = 0;