From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N2glj-0007PF-Ny for qemu-devel@nongnu.org; Tue, 27 Oct 2009 03:47:03 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N2gle-0007NN-NB for qemu-devel@nongnu.org; Tue, 27 Oct 2009 03:47:02 -0400 Received: from [199.232.76.173] (port=37416 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N2gle-0007NG-Kj for qemu-devel@nongnu.org; Tue, 27 Oct 2009 03:46:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17863) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N2gle-0000pA-5U for qemu-devel@nongnu.org; Tue, 27 Oct 2009 03:46:58 -0400 Date: Tue, 27 Oct 2009 13:16:15 +0530 From: Amit Shah Subject: Re: [Qemu-devel] Re: [PATCH v2 3/3] char: emit the OPENED event only when a new char connection is opened Message-ID: <20091027074615.GA28426@amit-x200.redhat.com> References: <1254920477-4645-1-git-send-email-amit.shah@redhat.com> <1254920477-4645-2-git-send-email-amit.shah@redhat.com> <1254920477-4645-3-git-send-email-amit.shah@redhat.com> <1254920477-4645-4-git-send-email-amit.shah@redhat.com> <4AE2D8C6.7070802@web.de> <20091026035312.GB11416@amit-x200.redhat.com> <4AE5525C.2040301@web.de> <20091026092841.GE11416@amit-x200.redhat.com> <4AE6037D.4070100@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AE6037D.4070100@web.de> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: Anthony Liguori , qemu-devel@nongnu.org On (Mon) Oct 26 2009 [21:15:57], Jan Kiszka wrote: > >>> However, with the qcow2 synchronous patch, the monitor prompt doesn't > >>> come up again -- which shows there is a problem with the way the bhs > >>> work and also the initial resets. > >> Then the qcow2 patch is already in? At least applying your patch doesn't > >> change the picture. > > > > Yeah; that patch went in just before my patches. Can you try reverting > > > > ef845c3bf421290153154635dc18eaa677cecb43 > > Makes no difference either - but it also does not touch any code that > code impact the open/reset signaling. What happens is the BHs that are run get run in a different order. Let me explain the two scenarios: 1. Current qemu tree, plus my patch to fix this issue that's in Anthony's queue plus reverting the qcow2 patch -- the monitor prompt appears fine. 2. Current qemu tree plus my patch from Anthony's queue - the monitor prompt doesn't appear. The difference is in the order the BHs are scheduled. In the case without the qcow2 patch, the bhs get scheduled early on and results in initial_reset_issued getting set. Later, when the char devs are initialsed, the OPENED event is sent out. In the case with the qcow2 patch, the bhs are run in a different order -- the bhs are scheduled but not run, and when the char init happens, the condition if (s->bh == NULL) is false and the bhs in effect get scheduled only once, not emitting the opened event. Of course, the qcow2 patch just causes some conditions for the bh handling to happen differently which I've not examined yet. I just tracked why this was happening. All that said, I'm ok with reverting that patch now till I find some kind of a solution to this. Amit