qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/2] pc: make vgabios exit port more useful


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 1/2] pc: make vgabios exit port more useful
Date: Wed, 24 Aug 2011 08:02:35 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110516 Lightning/1.0b2 Thunderbird/3.1.10

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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]