PCMachineState: introduce acpi_build_enabled field

Introduce this field to control whether ACPI build is enabled by a
particular machine or accelerator.

It defaults to true if the machine itself supports ACPI build. Xen
accelerator will disable it because Xen is in charge of building ACPI
tables for the guest.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Tested-by: Sander Eikelenboom <linux@eikelenboom.it>
This commit is contained in:
Wei Liu 2016-11-01 17:44:16 +00:00 committed by Stefano Stabellini
parent b586363418
commit 021746c131
4 changed files with 11 additions and 1 deletions

View File

@ -2953,7 +2953,7 @@ void acpi_setup(void)
return;
}
if (!pcmc->has_acpi_build) {
if (!pcms->acpi_build_enabled) {
ACPI_BUILD_DPRINTF("ACPI build disabled. Bailing out.\n");
return;
}

View File

@ -2159,6 +2159,8 @@ static void pc_machine_initfn(Object *obj)
pcms->vmport = ON_OFF_AUTO_AUTO;
/* nvdimm is disabled on default. */
pcms->acpi_nvdimm_state.is_enabled = false;
/* acpi build is enabled by default if machine supports it */
pcms->acpi_build_enabled = PC_MACHINE_GET_CLASS(pcms)->has_acpi_build;
}
static void pc_machine_reset(void)

View File

@ -62,6 +62,8 @@ struct PCMachineState {
AcpiNVDIMMState acpi_nvdimm_state;
bool acpi_build_enabled;
/* RAM information (sizes, addresses, configuration): */
ram_addr_t below_4g_mem_size, above_4g_mem_size;

View File

@ -9,6 +9,7 @@
*/
#include "qemu/osdep.h"
#include "hw/i386/pc.h"
#include "hw/xen/xen_backend.h"
#include "qmp-commands.h"
#include "sysemu/char.h"
@ -114,6 +115,11 @@ static void xen_change_state_handler(void *opaque, int running,
static int xen_init(MachineState *ms)
{
PCMachineState *pcms = PC_MACHINE(ms);
/* Disable ACPI build because Xen handles it */
pcms->acpi_build_enabled = false;
xen_xc = xc_interface_open(0, 0, 0);
if (xen_xc == NULL) {
xen_pv_printf(NULL, 0, "can't open xen interface\n");