From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:35985) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwD6b-0006dF-J3 for qemu-devel@nongnu.org; Wed, 24 Aug 2011 09:02:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QwD6a-0006li-HY for qemu-devel@nongnu.org; Wed, 24 Aug 2011 09:02:53 -0400 Received: from mail-gw0-f45.google.com ([74.125.83.45]:38169) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwD6a-0006ld-Di for qemu-devel@nongnu.org; Wed, 24 Aug 2011 09:02:52 -0400 Received: by gwb19 with SMTP id 19so941021gwb.4 for ; Wed, 24 Aug 2011 06:02:51 -0700 (PDT) Message-ID: <4E54F66B.40000@codemonkey.ws> Date: Wed, 24 Aug 2011 08:02:35 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1312831898-18702-1-git-send-email-aliguori@us.ibm.com> <4E54C8C3.4050609@redhat.com> <4E54F0BA.60106@us.ibm.com> <4E54F4CE.3030309@redhat.com> In-Reply-To: <4E54F4CE.3030309@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] pc: make vgabios exit port more useful List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Lucas Meneghel Rodrigues , Anthony Liguori , qemu-devel@nongnu.org On 08/24/2011 07:55 AM, Avi Kivity wrote: > On 08/24/2011 03:38 PM, Anthony Liguori wrote: >>> >>>> >>>> diff --git a/hw/pc.c b/hw/pc.c >>>> index 1c9d89a..4b07b35 100644 >>>> --- a/hw/pc.c >>>> +++ b/hw/pc.c >>>> @@ -549,8 +549,7 @@ static void bochs_bios_write(void *opaque, >>>> uint32_t addr, uint32_t val) >>>> /* LGPL'ed VGA BIOS messages */ >>>> case 0x501: >>>> case 0x502: >>>> - fprintf(stderr, "VGA BIOS panic, line %d\n", val); >>>> - exit(1); >>>> + exit((val<< 1) | 1); >>> >>> This code (before the patch) circumvents -no-shutdown. >> >> >> Indeed. I believe that's a feature though? > > Depends on what the user of -no-shutdown expects. > >> >>> >>> Shifting val left is surprising. What's wrong with even exit codes? >> >> Hrm, the '| 1' is wrong. My intention was to make the bottom bit of >> the exit code mean "if set to 0, this is an exit coming from a guest'. > > Too subtle, IMO. I understand that we want to avoid a full qmp parser > for one-off unit tests, but using bit fields in the exit code? > > Perhaps a python script that launches qemu with qmp and -no-shutdown, > listens for the guest shutdown event, and prints out the result? That > can be easily reused in test scripts. How can the test pass data via shutdown? You would need a scratch register of some form I think... Regards, Anthony Liguori >