Guido Guenther wrote:
> +#if defined(TARGET_I386)
> +void qemu_system_powerdown(void)
> +{
> + if(pm_state->pmen & PWRBTN_EN) {
> + pm_state->pmsts |= PWRBTN_EN;
> + pm_update_sci(pm_state);
> + }
> +}
> +#endif
This code should also care about !pm_state, ie. non-PCI systems.
Jan
---
qemu/hw/acpi.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Index: kvm-userspace/qemu/hw/acpi.c
===================================================================
--- kvm-userspace.orig/qemu/hw/acpi.c
+++ kvm-userspace/qemu/hw/acpi.c
@@ -72,7 +72,7 @@ typedef struct PIIX4PMState {
#define SMBHSTDAT1 0x06
#define SMBBLKDAT 0x07
-PIIX4PMState *pm_state;
+PIIX4PMState *pm_state = NULL;
static uint32_t get_pmtmr(PIIX4PMState *s)
{
@@ -527,6 +527,8 @@ i2c_bus *piix4_pm_init(PCIBus *bus, int
#if defined(TARGET_I386)
void qemu_system_powerdown(void)
{
+ if (!pm_state)
+ exit(0);
if(pm_state->pmen & PWRBTN_EN) {
pm_state->pmsts |= PWRBTN_EN;
pm_update_sci(pm_state);
--
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
kvm-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel