diff mbox series

[RFC,v4,13/27] qmp: introduce some capability helpers

Message ID 20171116130610.23582-14-peterx@redhat.com
State New
Headers show
Series QMP: out-of-band (OOB) execution support | expand

Commit Message

Peter Xu Nov. 16, 2017, 1:05 p.m. UTC
Introduce qmp_cap_enabled() and qmp_oob_enabled() helpers.

Signed-off-by: Peter Xu <peterx@redhat.com>
---
 monitor.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/monitor.c b/monitor.c
index da03d1370f..655c25041c 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)
 {