diff mbox series

[RFC,v3,14/27] qmp: introduce some capability helpers

Message ID 20171106094643.14881-15-peterx@redhat.com
State New
Headers show
Series [RFC,v3,01/27] char-io: fix possible race on IOWatchPoll | expand

Commit Message

Peter Xu Nov. 6, 2017, 9:46 a.m. UTC
Introduce qmp_cap_enabled() and qmp_oob_enabled() helpers.
---
 monitor.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/monitor.c b/monitor.c
index dba56fbcdf..442d711d5d 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1038,6 +1038,16 @@  static void monitor_init_qmp_commands(void)
                          qmp_marshal_qmp_capabilities, QCO_NO_OPTIONS);
 }
 
+static bool qmp_cap_enabled(Monitor *mon, QMPCapability cap)
+{
+    return mon->qmp.qmp_caps[cap];
+}
+
+static bool qmp_oob_enabled(Monitor *mon)
+{
+    return qmp_cap_enabled(mon, QMP_CAPABILITY_OOB);
+}
+
 static void qmp_caps_check(Monitor *mon, QMPCapabilityList *list,
                            Error **errp)
 {