From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35096) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4Xfo-0004si-Ao for qemu-devel@nongnu.org; Thu, 23 Aug 2012 09:42:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T4Xfj-0007EG-D1 for qemu-devel@nongnu.org; Thu, 23 Aug 2012 09:42:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:18436) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4Xfj-0007E7-55 for qemu-devel@nongnu.org; Thu, 23 Aug 2012 09:42:07 -0400 Date: Thu, 23 Aug 2012 14:42:00 +0100 From: "Daniel P. Berrange" Message-ID: <20120823134200.GH10833@redhat.com> References: <1345728155-11667-1-git-send-email-aliguori@us.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1345728155-11667-1-git-send-email-aliguori@us.ibm.com> Subject: Re: [Qemu-devel] [PATCH] monitor: move json init from OPEN event to init Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org On Thu, Aug 23, 2012 at 08:22:35AM -0500, Anthony Liguori wrote: > At some point in the past, the OPEN event was changed to be issued from a > bottom half. This creates a small window whereas a data callback registered in > init may be invoked before the OPEN event has been issued. > > This is reproducible with: > > echo "{'execute': 'qmp_capabilities'}" | qemu-system-x86_64 -M none -qmp stdio > > We can fix this for the monitor by moving the parser initialization to init. > > The remaining state that is set in OPEN appears harmless. > > Reported-by: Daniel Berrange > Signed-off-by: Anthony Liguori Signed-off-by: Daniel P. Berrange Works in my testing. I have also fixed libvirt so that it does not try to send commands to QMP, until QMP has sent out its initial greeting, thus avoiding the flaw too. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|