Received: from eggs.gnu.org ([2001:4830:134:3::10]:48935) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eBe2O-0005XC-Uj for qemu-devel@nongnu.org; Mon, 06 Nov 2017 04:49:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eBe2K-0004iu-0F for qemu-devel@nongnu.org; Mon, 06 Nov 2017 04:49:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39956) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eBe2J-0004ik-QV for qemu-devel@nongnu.org; Mon, 06 Nov 2017 04:49:43 -0500 From: Peter Xu Date: Mon, 6 Nov 2017 17:46:30 +0800 Message-Id: <20171106094643.14881-15-peterx@redhat.com> In-Reply-To: <20171106094643.14881-1-peterx@redhat.com> References: <20171106094643.14881-1-peterx@redhat.com> Subject: [Qemu-devel] [RFC v3 14/27] qmp: introduce some capability helpers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , "Daniel P . Berrange" , Paolo Bonzini , Fam Zheng , Jiri Denemark , Juan Quintela , mdroth@linux.vnet.ibm.com, peterx@redhat.com, Eric Blake , Laurent Vivier , marcandre.lureau@redhat.com, Markus Armbruster , "Dr . David Alan Gilbert" Introduce qmp_cap_enabled() and qmp_oob_enabled() helpers. --- monitor.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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) { -- 2.13.5