mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-07 09:19:19 +00:00
virsh: qemu-monitor-command: Use macro for exclusive options
This commit is contained in:
parent
e44cdaf80b
commit
36428fa80b
@ -8945,6 +8945,8 @@ cmdQemuMonitorCommand(vshControl *ctl, const vshCmd *cmd)
|
|||||||
bool pad = false;
|
bool pad = false;
|
||||||
virJSONValuePtr pretty = NULL;
|
virJSONValuePtr pretty = NULL;
|
||||||
|
|
||||||
|
VSH_EXCLUSIVE_OPTIONS("hmp", "pretty");
|
||||||
|
|
||||||
dom = virshCommandOptDomain(ctl, cmd, NULL);
|
dom = virshCommandOptDomain(ctl, cmd, NULL);
|
||||||
if (dom == NULL)
|
if (dom == NULL)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -8961,13 +8963,8 @@ cmdQemuMonitorCommand(vshControl *ctl, const vshCmd *cmd)
|
|||||||
}
|
}
|
||||||
monitor_cmd = virBufferContentAndReset(&buf);
|
monitor_cmd = virBufferContentAndReset(&buf);
|
||||||
|
|
||||||
if (vshCommandOptBool(cmd, "hmp")) {
|
if (vshCommandOptBool(cmd, "hmp"))
|
||||||
if (vshCommandOptBool(cmd, "pretty")) {
|
|
||||||
vshError(ctl, _("--hmp and --pretty are not compatible"));
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
flags |= VIR_DOMAIN_QEMU_MONITOR_COMMAND_HMP;
|
flags |= VIR_DOMAIN_QEMU_MONITOR_COMMAND_HMP;
|
||||||
}
|
|
||||||
|
|
||||||
if (virDomainQemuMonitorCommand(dom, monitor_cmd, &result, flags) < 0)
|
if (virDomainQemuMonitorCommand(dom, monitor_cmd, &result, flags) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
Loading…
Reference in New Issue
Block a user