From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57497) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afTZH-0003iQ-4b for qemu-devel@nongnu.org; Mon, 14 Mar 2016 10:33:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1afTZD-00019P-Sk for qemu-devel@nongnu.org; Mon, 14 Mar 2016 10:33:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38829) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afTZD-00018Y-N6 for qemu-devel@nongnu.org; Mon, 14 Mar 2016 10:33:55 -0400 References: <1457954501-26528-1-git-send-email-den@openvz.org> <1457954501-26528-9-git-send-email-den@openvz.org> From: Paolo Bonzini Message-ID: <56E6CBCA.4080100@redhat.com> Date: Mon, 14 Mar 2016 15:33:46 +0100 MIME-Version: 1.0 In-Reply-To: <1457954501-26528-9-git-send-email-den@openvz.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 8/9] log: report QAPI event List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Denis V. Lunev" Cc: Markus Armbruster , Luiz Capitulino , qemu-devel@nongnu.org, Stefan Hajnoczi , Pavel Butsykin On 14/03/2016 12:21, Denis V. Lunev wrote: > From: Pavel Butsykin > > Signed-off-by: Pavel Butsykin > Signed-off-by: Denis V. Lunev > CC: Stefan Hajnoczi > CC: Paolo Bonzini > CC: Luiz Capitulino > CC: Markus Armbruster > --- > include/qemu/log.h | 1 + > monitor.c | 6 ++++++ > util/log.c | 2 ++ > 3 files changed, 9 insertions(+) > > diff --git a/include/qemu/log.h b/include/qemu/log.h > index 9264bbf..0c7a564 100644 > --- a/include/qemu/log.h > +++ b/include/qemu/log.h > @@ -44,6 +44,7 @@ static inline bool qemu_log_separate(void) > #define LOG_TRACE (1 << 15) > #define LOG_QMP (1 << 16) > #define LOG_HMP (1 << 17) > +#define LOG_QAPI (1 << 18) This should just reuse LOG_QMP (but see reply to patch 6). Paolo > /* Returns true if a bit is set in the current loglevel mask > */ > diff --git a/monitor.c b/monitor.c > index 4bf4f31..751e754 100644 > --- a/monitor.c > +++ b/monitor.c > @@ -467,6 +467,12 @@ static void monitor_qapi_event_emit(QAPIEvent event, QDict *qdict) > { > Monitor *mon; > > + if (qemu_loglevel_mask(LOG_QAPI)) { > + QString *output_json = qobject_to_json(QOBJECT(qdict)); > + qemu_log_mask(LOG_QAPI, "QAPI event: %s\n", output_json->string); > + QDECREF(output_json); > + } > + > trace_monitor_protocol_event_emit(event, qdict); > QLIST_FOREACH(mon, &mon_list, entry) { > if (monitor_is_qmp(mon) && mon->qmp.in_command_mode) { > diff --git a/util/log.c b/util/log.c > index 795aaea..572f005 100644 > --- a/util/log.c > +++ b/util/log.c > @@ -135,6 +135,8 @@ const QEMULogItem qemu_log_items[] = { > "log the QMP commands and events" }, > { LOG_HMP, "hmp", > "log the HMP commands and events" }, > + { LOG_QAPI, "qapi", > + "log the QAPI events"}, > { 0, NULL, NULL }, > }; > >