qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] x86: Fix powerdown for non-ACPI case
Date: Tue, 2 Sep 2008 02:09:12 +0200	[thread overview]
Message-ID: <20080902000912.GA683@hall.aurel32.net> (raw)
In-Reply-To: <48BC1262.3040201@siemens.com>

On Mon, Sep 01, 2008 at 06:03:46PM +0200, Jan Kiszka wrote:
> Trivial fix for a corner case: system_shutdown on isapc machines causes
> qemu to segfaults due to accessing the uninitialized pm_state. Issue a
> system shutdown instead.

Applied, thanks.

> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  hw/acpi.c |    6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> Index: b/hw/acpi.c
> ===================================================================
> --- a/hw/acpi.c
> +++ b/hw/acpi.c
> @@ -72,7 +72,7 @@ typedef struct PIIX4PMState {
>  #define SMBHSTDAT1 0x06
>  #define SMBBLKDAT 0x07
>  
> -PIIX4PMState *pm_state;
> +static PIIX4PMState *pm_state;
>  
>  static uint32_t get_pmtmr(PIIX4PMState *s)
>  {
> @@ -526,7 +526,9 @@ i2c_bus *piix4_pm_init(PCIBus *bus, int
>  #if defined(TARGET_I386)
>  void qemu_system_powerdown(void)
>  {
> -    if(pm_state->pmen & PWRBTN_EN) {
> +    if (!pm_state) {
> +        qemu_system_shutdown_request();
> +    } else if (pm_state->pmen & PWRBTN_EN) {
>          pm_state->pmsts |= PWRBTN_EN;
>  	pm_update_sci(pm_state);
>      }
> 
> 
> 

-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net

      reply	other threads:[~2008-09-02  0:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-01 16:03 [Qemu-devel] [PATCH] x86: Fix powerdown for non-ACPI case Jan Kiszka
2008-09-02  0:09 ` Aurelien Jarno [this message]

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=20080902000912.GA683@hall.aurel32.net \
    --to=aurelien@aurel32.net \
    --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).