Blob Blame Raw
From 9c107e1c452bc40beac01fc01f208f76967cb36b Mon Sep 17 00:00:00 2001
From: Michael S. Tsirkin <mst@redhat.com>
Date: Sun, 12 Jan 2014 11:54:00 +0100
Subject: [PATCH 09/16] acpi-build: disable with -no-acpi

RH-Author: Michael S. Tsirkin <mst@redhat.com>
Message-id: <1389527552-15015-1-git-send-email-mst@redhat.com>
Patchwork-id: 56637
O-Subject: [PATCH qemu-kvm RHEL7.0] acpi-build: disable with -no-acpi
Bugzilla: 1045386
RH-Acked-by: Amos Kong <akong@redhat.com>
RH-Acked-by: Marcel Apfelbaum <marcel.a@redhat.com>
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
RH-Acked-by: Richard Jones <rjones@redhat.com>

QEMU will currently crash if started with -no-acpi flag
since acpi build code probes the PM device which isn't present
in this configuration.

To fix, don't expose ACPI tables to guest when acpi has been
disabled from command line.

Fixes LP# 1248854
https://bugs.launchpad.net/qemu/+bug/1248854

Reported-by: chao zhou <chao.zhou@intel.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 81adc5131534ca7554cebe64cd8f86bac28dbd1b)

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1045386
Brew build: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=6854545
---
 hw/i386/acpi-build.c | 5 +++++
 1 file changed, 5 insertions(+)

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
 hw/i386/acpi-build.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 2d008bd..befc39f 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1185,6 +1185,11 @@ void acpi_setup(PcGuestInfo *guest_info)
         return;
     }
 
+    if (!acpi_enabled) {
+        ACPI_BUILD_DPRINTF(3, "ACPI disabled. Bailing out.\n");
+        return;
+    }
+
     build_state = g_malloc0(sizeof *build_state);
 
     build_state->guest_info = guest_info;
-- 
1.7.1