提交 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 { ...@@ -112,17 +112,20 @@ struct _qemuMonitor {
* monitor. * monitor.
*/ */
#define QEMU_CHECK_MONITOR_FULL(mon, force_json, exit) \ #define QEMU_CHECK_MONITOR_FULL(mon, force_json, exit) \
if (!mon) { \ do { \
virReportError(VIR_ERR_INVALID_ARG, "%s", \ if (!mon) { \
_("monitor must not be NULL")); \ virReportError(VIR_ERR_INVALID_ARG, "%s", \
exit; \ _("monitor must not be NULL")); \
} \ exit; \
VIR_DEBUG("mon:%p vm:%p json:%d fd:%d", mon, mon->vm, mon->json, mon->fd); \ } \
if (force_json && !mon->json) { \ VIR_DEBUG("mon:%p vm:%p json:%d fd:%d", \
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", \ mon, mon->vm, mon->json, mon->fd); \
_("JSON monitor is required")); \ if (force_json && !mon->json) { \
exit; \ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", \
} _("JSON monitor is required")); \
exit; \
} \
} while (0)
/* Check monitor and return NULL on error */ /* Check monitor and return NULL on error */
#define QEMU_CHECK_MONITOR_NULL(mon) \ #define QEMU_CHECK_MONITOR_NULL(mon) \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册