提交 36428fa8 编写于 作者: P Peter Krempa

virsh: qemu-monitor-command: Use macro for exclusive options

上级 e44cdaf8
......@@ -8945,6 +8945,8 @@ cmdQemuMonitorCommand(vshControl *ctl, const vshCmd *cmd)
bool pad = false;
virJSONValuePtr pretty = NULL;
VSH_EXCLUSIVE_OPTIONS("hmp", "pretty");
dom = virshCommandOptDomain(ctl, cmd, NULL);
if (dom == NULL)
goto cleanup;
......@@ -8961,13 +8963,8 @@ cmdQemuMonitorCommand(vshControl *ctl, const vshCmd *cmd)
}
monitor_cmd = virBufferContentAndReset(&buf);
if (vshCommandOptBool(cmd, "hmp")) {
if (vshCommandOptBool(cmd, "pretty")) {
vshError(ctl, _("--hmp and --pretty are not compatible"));
goto cleanup;
}
if (vshCommandOptBool(cmd, "hmp"))
flags |= VIR_DOMAIN_QEMU_MONITOR_COMMAND_HMP;
}
if (virDomainQemuMonitorCommand(dom, monitor_cmd, &result, flags) < 0)
goto cleanup;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册