qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <aliguori@us.ibm.com>
To: Avi Kivity <avi@redhat.com>
Cc: Lucas Meneghel Rodrigues <lmr@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/2] pc: make vgabios exit port more useful
Date: Wed, 24 Aug 2011 07:38:18 -0500	[thread overview]
Message-ID: <4E54F0BA.60106@us.ibm.com> (raw)
In-Reply-To: <4E54C8C3.4050609@redhat.com>

On 08/24/2011 04:47 AM, Avi Kivity wrote:
> On 08/08/2011 10:31 PM, Anthony Liguori wrote:
>> We've always listened on port 501 for vgabios panic messages. In the
>> entire
>> time I've worked on QEMU, I've never actually seen a vgabios panic
>> message :-)
>>
>> If we change the semantics of this port a little bit, it makes it
>> possible to
>> use it for more interesting use-cases. I chose this approach instead
>> of adding
>> a new I/O port because it avoids having a guest visible change.
>>
>> This change allows single-byte access to port 501 and also uses the value
>> written to construct an exit code.
>
> A little late to review but...
>
>>
>> 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?

>
> 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'.

I'll spin a patch.

Regards,

Anthony Liguori

>

  reply	other threads:[~2011-08-24 12:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-08 19:31 [Qemu-devel] [PATCH 1/2] pc: make vgabios exit port more useful Anthony Liguori
2011-08-08 19:31 ` [Qemu-devel] [PATCH 2/2] [FYI] coverage test for Linux installs Anthony Liguori
2011-08-08 19:35   ` Anthony Liguori
2011-08-23 15:50   ` Ryan Harper
2011-08-12 13:46 ` [Qemu-devel] [PATCH 1/2] pc: make vgabios exit port more useful Anthony Liguori
2011-08-24  9:47 ` Avi Kivity
2011-08-24 12:38   ` Anthony Liguori [this message]
2011-08-24 12:55     ` Avi Kivity
2011-08-24 13:02       ` Anthony Liguori
2011-08-24 13:06         ` Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E54F0BA.60106@us.ibm.com \
    --to=aliguori@us.ibm.com \
    --cc=avi@redhat.com \
    --cc=lmr@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).