/**
* qtest_hmp:
* @s: #QTestState instance to operate on.
- * @fmt...: HMP command to send to QEMU
+ * @fmt...: HMP command to send to QEMU, formats arguments like sprintf().
*
* Send HMP command to QEMU via QMP's human-monitor-command.
* QMP events are discarded.
*
* Returns: the command's output. The caller should g_free() it.
*/
-char *qtest_hmp(QTestState *s, const char *fmt, ...);
+char *qtest_hmp(QTestState *s, const char *fmt, ...) GCC_FMT_ATTR(2, 3);
/**
* qtest_hmpv:
/**
* hmp:
- * @fmt...: HMP command to send to QEMU
+ * @fmt...: HMP command to send to QEMU, formats arguments like sprintf().
*
* Send HMP command to QEMU via QMP's human-monitor-command.
*
* Returns: the command's output. The caller should g_free() it.
*/
-char *hmp(const char *fmt, ...);
+char *hmp(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
/**
* get_irq:
if (verbose) {
fprintf(stderr, "\t%s\n", hmp_cmds[i]);
}
- response = hmp(hmp_cmds[i]);
+ response = hmp("%s", hmp_cmds[i]);
g_free(response);
}
if (verbose) {
fprintf(stderr, "\t%s\n", info);
}
- resp = hmp(info);
+ resp = hmp("%s", info);
g_free(resp);
/* And move forward to the next line */
info = strchr(endp + 1, '\n');