From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O6T09-0007yg-By for qemu-devel@nongnu.org; Mon, 26 Apr 2010 14:25:49 -0400 Received: from [140.186.70.92] (port=42735 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O6T07-0007wY-Vk for qemu-devel@nongnu.org; Mon, 26 Apr 2010 14:25:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O6T06-0003UN-Dt for qemu-devel@nongnu.org; Mon, 26 Apr 2010 14:25:47 -0400 Received: from mail-pv0-f173.google.com ([74.125.83.173]:37161) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O6T06-0003UB-7q for qemu-devel@nongnu.org; Mon, 26 Apr 2010 14:25:46 -0400 Received: by pvh1 with SMTP id 1so276909pvh.4 for ; Mon, 26 Apr 2010 11:25:45 -0700 (PDT) Message-ID: <4BD5DAA2.4050206@codemonkey.ws> Date: Mon, 26 Apr 2010 13:25:38 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 5/9] Monitor: Return before exiting with 'quit' References: <1272296853-30285-1-git-send-email-lcapitulino@redhat.com> <1272296853-30285-6-git-send-email-lcapitulino@redhat.com> <4BD5D234.2030508@codemonkey.ws> <20100426152238.5ece1c15@redhat.com> In-Reply-To: <20100426152238.5ece1c15@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org On 04/26/2010 01:22 PM, Luiz Capitulino wrote: > On Mon, 26 Apr 2010 12:49:40 -0500 > Anthony Liguori wrote: > > >> On 04/26/2010 10:47 AM, Luiz Capitulino wrote: >> >>> The 'quit' Monitor command (implemented by do_quit()) calls >>> exit() directly, this is problematic under QMP because QEMU >>> exits before having a chance to send the ok response. >>> >>> Clients don't know if QEMU exited because of a problem or >>> because the 'quit' command has been executed. >>> >>> This commit fixes that by moving the exit() call to the main >>> loop, so that do_quit() requests the system to quit, instead >>> of calling exit() directly. >>> >>> >> Does this also have the effect of printing out a (qemu) prompt after >> quit before an EOF appears on that socket? >> > Ah, right.. > It's not necessarily a bad thing if it does. I just wanted to raise that because it's possible that someone depends on the behavior. I'm not sure it matters to me if we change this behavior though. > So, the easiest way to fix this is: > > if (user monitor) { > exit(0); > } else { > go through main; > } > > And, wrt to the pull, assuming you like the other patches, what's the best for you? > I'm happy to pull it, just wanted to see fi this issue was considered before I did. Regards, Anthony Liguori > Should I just drop this patch and ask you to pull again or can I do the fix, > rebase, send it in this thread, and ping you? >