On Fri, Dec 15, 2017 at 05:42:55PM +0800, Fam Zheng wrote: > On Tue, 12/05 13:51, Peter Xu wrote: > > Introduce qmp_cap_enabled() and qmp_oob_enabled() helpers. > > > > Signed-off-by: Peter Xu <pet...@redhat.com> > > --- > > monitor.c | 10 ++++++++++ > > 1 file changed, 10 insertions(+) > > > > diff --git a/monitor.c b/monitor.c > > index 097312e65f..9666115259 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.14.3 > > > > NACK, this commit doesn't commit for me: > > /home/fam/work/qemu/monitor.c:1046:13: error: ‘qmp_oob_enabled’ defined but > not used [-Werror=unused-function] > static bool qmp_oob_enabled(Monitor *mon) > ^~~~~~~~~~~~~~~ > cc1: all warnings being treated as errors > CC x86_64-softmmu/accel/stubs/hax-stub.o
I'll squash this patch to patch 16, where it started to be used. Thanks, -- Peter Xu