9ae3a8
From 9c107e1c452bc40beac01fc01f208f76967cb36b Mon Sep 17 00:00:00 2001
9ae3a8
From: Michael S. Tsirkin <mst@redhat.com>
9ae3a8
Date: Sun, 12 Jan 2014 11:54:00 +0100
9ae3a8
Subject: [PATCH 09/16] acpi-build: disable with -no-acpi
9ae3a8
9ae3a8
RH-Author: Michael S. Tsirkin <mst@redhat.com>
9ae3a8
Message-id: <1389527552-15015-1-git-send-email-mst@redhat.com>
9ae3a8
Patchwork-id: 56637
9ae3a8
O-Subject: [PATCH qemu-kvm RHEL7.0] acpi-build: disable with -no-acpi
9ae3a8
Bugzilla: 1045386
9ae3a8
RH-Acked-by: Amos Kong <akong@redhat.com>
9ae3a8
RH-Acked-by: Marcel Apfelbaum <marcel.a@redhat.com>
9ae3a8
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
9ae3a8
RH-Acked-by: Richard Jones <rjones@redhat.com>
9ae3a8
9ae3a8
QEMU will currently crash if started with -no-acpi flag
9ae3a8
since acpi build code probes the PM device which isn't present
9ae3a8
in this configuration.
9ae3a8
9ae3a8
To fix, don't expose ACPI tables to guest when acpi has been
9ae3a8
disabled from command line.
9ae3a8
9ae3a8
Fixes LP# 1248854
9ae3a8
https://bugs.launchpad.net/qemu/+bug/1248854
9ae3a8
9ae3a8
Reported-by: chao zhou <chao.zhou@intel.com>
9ae3a8
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9ae3a8
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
9ae3a8
(cherry picked from commit 81adc5131534ca7554cebe64cd8f86bac28dbd1b)
9ae3a8
9ae3a8
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1045386
9ae3a8
Brew build: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=6854545
9ae3a8
---
9ae3a8
 hw/i386/acpi-build.c | 5 +++++
9ae3a8
 1 file changed, 5 insertions(+)
9ae3a8
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 hw/i386/acpi-build.c |    5 +++++
9ae3a8
 1 files changed, 5 insertions(+), 0 deletions(-)
9ae3a8
9ae3a8
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
9ae3a8
index 2d008bd..befc39f 100644
9ae3a8
--- a/hw/i386/acpi-build.c
9ae3a8
+++ b/hw/i386/acpi-build.c
9ae3a8
@@ -1185,6 +1185,11 @@ void acpi_setup(PcGuestInfo *guest_info)
9ae3a8
         return;
9ae3a8
     }
9ae3a8
 
9ae3a8
+    if (!acpi_enabled) {
9ae3a8
+        ACPI_BUILD_DPRINTF(3, "ACPI disabled. Bailing out.\n");
9ae3a8
+        return;
9ae3a8
+    }
9ae3a8
+
9ae3a8
     build_state = g_malloc0(sizeof *build_state);
9ae3a8
 
9ae3a8
     build_state->guest_info = guest_info;
9ae3a8
-- 
9ae3a8
1.7.1
9ae3a8