提交 0f889e72 编写于 作者: P Peter Krempa

qemu: monitor: Add do-while block to QEMU_CHECK_MONITOR_FULL

Assure that it's just one statement to avoid problems when used with
conditions.
上级 78806cd2
......@@ -112,17 +112,20 @@ struct _qemuMonitor {
* monitor.
*/
#define QEMU_CHECK_MONITOR_FULL(mon, force_json, exit) \
do { \
if (!mon) { \
virReportError(VIR_ERR_INVALID_ARG, "%s", \
_("monitor must not be NULL")); \
exit; \
} \
VIR_DEBUG("mon:%p vm:%p json:%d fd:%d", mon, mon->vm, mon->json, mon->fd); \
VIR_DEBUG("mon:%p vm:%p json:%d fd:%d", \
mon, mon->vm, mon->json, mon->fd); \
if (force_json && !mon->json) { \
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", \
_("JSON monitor is required")); \
exit; \
}
} \
} while (0)
/* Check monitor and return NULL on error */
#define QEMU_CHECK_MONITOR_NULL(mon) \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册