qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] QMP: Fix asynchronous events delivery
@ 2010-01-20 12:37 Luiz Capitulino
  2010-01-20 14:19 ` [Qemu-devel] " Adam Litke
  2010-01-20 14:56 ` [Qemu-devel] " Anthony Liguori
  0 siblings, 2 replies; 3+ messages in thread
From: Luiz Capitulino @ 2010-01-20 12:37 UTC (permalink / raw)
  To: qemu-devel; +Cc: aliguori, agl


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 <lcapitulino@redhat.com>
---
 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);
 }
-- 
1.6.6

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Qemu-devel] Re: [PATCH] QMP: Fix asynchronous events delivery
  2010-01-20 12:37 [Qemu-devel] [PATCH] QMP: Fix asynchronous events delivery Luiz Capitulino
@ 2010-01-20 14:19 ` Adam Litke
  2010-01-20 14:56 ` [Qemu-devel] " Anthony Liguori
  1 sibling, 0 replies; 3+ messages in thread
From: Adam Litke @ 2010-01-20 14:19 UTC (permalink / raw)
  To: Luiz Capitulino; +Cc: aliguori, qemu-devel

On Wed, 2010-01-20 at 10:37 -0200, Luiz Capitulino wrote:
> 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 <lcapitulino@redhat.com>

Acked-by: Adam Litke <agl@us.ibm.com>


-- 
Thanks,
Adam

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] QMP: Fix asynchronous events delivery
  2010-01-20 12:37 [Qemu-devel] [PATCH] QMP: Fix asynchronous events delivery Luiz Capitulino
  2010-01-20 14:19 ` [Qemu-devel] " Adam Litke
@ 2010-01-20 14:56 ` Anthony Liguori
  1 sibling, 0 replies; 3+ messages in thread
From: Anthony Liguori @ 2010-01-20 14:56 UTC (permalink / raw)
  To: Luiz Capitulino; +Cc: aliguori, qemu-devel, agl

On 01/20/2010 06:37 AM, Luiz Capitulino wrote:
> 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<lcapitulino@redhat.com>
>    

Applied.  Thanks.

Regards,

Anthony Liguori
> ---
>   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);
>   }
>    

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-01-20 14:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-20 12:37 [Qemu-devel] [PATCH] QMP: Fix asynchronous events delivery Luiz Capitulino
2010-01-20 14:19 ` [Qemu-devel] " Adam Litke
2010-01-20 14:56 ` [Qemu-devel] " Anthony Liguori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).