From patchwork Wed Jan 20 12:37:59 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 43278 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A5C0EB7CC1 for ; Wed, 20 Jan 2010 23:41:35 +1100 (EST) Received: from localhost ([127.0.0.1]:45124 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NXZqI-00022L-EB for incoming@patchwork.ozlabs.org; Wed, 20 Jan 2010 07:39:26 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NXZp4-0001zJ-Bj for qemu-devel@nongnu.org; Wed, 20 Jan 2010 07:38:10 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NXZp0-0001xP-Pa for qemu-devel@nongnu.org; Wed, 20 Jan 2010 07:38:10 -0500 Received: from [199.232.76.173] (port=44331 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NXZp0-0001xJ-CU for qemu-devel@nongnu.org; Wed, 20 Jan 2010 07:38:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:14559) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NXZoz-0002Oq-23 for qemu-devel@nongnu.org; Wed, 20 Jan 2010 07:38:05 -0500 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o0KCc3Tm010597 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 20 Jan 2010 07:38:03 -0500 Received: from doriath (vpn-246-151.phx2.redhat.com [10.3.246.151]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0KCc0fR008016 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 20 Jan 2010 07:38:02 -0500 Date: Wed, 20 Jan 2010 10:37:59 -0200 From: Luiz Capitulino To: qemu-devel@nongnu.org Message-ID: <20100120103759.219e043f@doriath> Organization: Red Hat Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: aliguori@us.ibm.com, agl@us.ibm.com Subject: [Qemu-devel] [PATCH] QMP: Fix asynchronous events delivery X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Commit f039a563f200beee80cc10fd70b21ea396979dab introduces a regression as monitor_protocol_event() will return in the first user Monitor it finds in the QLIST_FOREACH() loop. The right thing to do is to only delivery an asynchronous event if the 'mon' is a QMP Monitor. The aforementioned commit was an early version, if it was applied to stable (it should) this one has to be applied there too. Signed-off-by: Luiz Capitulino Acked-by: Adam Litke --- monitor.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/monitor.c b/monitor.c index 938eb3b..b2b88c1 100644 --- a/monitor.c +++ b/monitor.c @@ -377,10 +377,9 @@ void monitor_protocol_event(MonitorEvent event, QObject *data) } QLIST_FOREACH(mon, &mon_list, entry) { - if (!monitor_ctrl_mode(mon)) - return; - - monitor_json_emitter(mon, QOBJECT(qmp)); + if (monitor_ctrl_mode(mon)) { + monitor_json_emitter(mon, QOBJECT(qmp)); + } } QDECREF(qmp); }