[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 1 of 2] Move acpi_enabled out of hvm_info_table into xenstore



# HG changeset patch
# User Paul Durrant <paul.durrant@xxxxxxxxxx>
# Date 1321546881 0
# Node ID 447738ef67ea2690c8ea6684f2e0e0b3528ad446
# Parent  dbdc840f8f62db58321b5009e5e0f7833066386f
Move acpi_enabled out of hvm_info_table into xenstore

Since hvmloader has a xentore client, use a platform key in xenstore
to indicate whether ACPI is enabled or not rather than the shared
hvm_info_table structure.

Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx>

diff -r dbdc840f8f62 -r 447738ef67ea tools/firmware/hvmloader/hvmloader.c
--- a/tools/firmware/hvmloader/hvmloader.c      Wed Nov 16 18:21:14 2011 +0000
+++ b/tools/firmware/hvmloader/hvmloader.c      Thu Nov 17 16:21:21 2011 +0000
@@ -423,6 +423,7 @@ int main(void)
     const struct bios_config *bios;
     int option_rom_sz = 0, vgabios_sz = 0, etherboot_sz = 0;
     uint32_t etherboot_phys_addr = 0, option_rom_phys_addr = 0;
+    int acpi_enabled;
 
     /* Initialise hypercall stubs with RET, rendering them no-ops. */
     memset((void *)HYPERCALL_PHYSICAL_ADDRESS, 0xc3 /* RET */, PAGE_SIZE);
@@ -506,7 +507,9 @@ int main(void)
                                              option_rom_phys_addr);
     }
 
-    if ( hvm_info->acpi_enabled )
+    acpi_enabled = !strncmp(xenstore_read("platform/acpi", "1"), "1", 1);
+
+    if ( acpi_enabled )
     {
         struct xen_hvm_param p = {
             .domid = DOMID_SELF,
diff -r dbdc840f8f62 -r 447738ef67ea tools/libxc/xc_hvm_build.c
--- a/tools/libxc/xc_hvm_build.c        Wed Nov 16 18:21:14 2011 +0000
+++ b/tools/libxc/xc_hvm_build.c        Thu Nov 17 16:21:21 2011 +0000
@@ -67,7 +67,6 @@ static void build_hvm_info(void *hvm_inf
     hvm_info->length = sizeof(struct hvm_info_table);
 
     /* Sensible defaults: these can be overridden by the caller. */
-    hvm_info->acpi_enabled = 1;
     hvm_info->apic_mode = 1;
     hvm_info->nr_vcpus = 1;
     memset(hvm_info->vcpu_online, 0xff, sizeof(hvm_info->vcpu_online));
diff -r dbdc840f8f62 -r 447738ef67ea tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c        Wed Nov 16 18:21:14 2011 +0000
+++ b/tools/libxl/libxl_create.c        Thu Nov 17 16:21:21 2011 +0000
@@ -188,6 +188,11 @@ int libxl__domain_build(libxl__gc *gc,
         vments[3] = "hvm";
         vments[4] = "start_time";
         vments[5] = libxl__sprintf(gc, "%lu.%02d", 
start_time.tv_sec,(int)start_time.tv_usec/10000);
+
+        localents = libxl__calloc(gc, 3, sizeof(char *));
+        localents[0] = "platform/acpi";
+        localents[1] = (info->u.hvm.acpi) ? "1" : "0";
+
         break;
     case LIBXL_DOMAIN_TYPE_PV:
         ret = libxl__build_pv(gc, domid, info, state);
diff -r dbdc840f8f62 -r 447738ef67ea tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c   Wed Nov 16 18:21:14 2011 +0000
+++ b/tools/libxl/libxl_dom.c   Thu Nov 17 16:21:21 2011 +0000
@@ -248,7 +248,6 @@ static int hvm_build_set_params(xc_inter
         return -1;
 
     va_hvm = (struct hvm_info_table *)(va_map + HVM_INFO_OFFSET);
-    va_hvm->acpi_enabled = info->u.hvm.acpi;
     va_hvm->apic_mode = info->u.hvm.apic;
     va_hvm->nr_vcpus = info->max_vcpus;
     memcpy(va_hvm->vcpu_online, &info->cur_vcpus, sizeof(info->cur_vcpus));
diff -r dbdc840f8f62 -r 447738ef67ea tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c Wed Nov 16 18:21:14 2011 +0000
+++ b/tools/python/xen/lowlevel/xc/xc.c Thu Nov 17 16:21:21 2011 +0000
@@ -996,7 +996,6 @@ static PyObject *pyxc_hvm_build(XcObject
     if ( va_map == NULL )
         return PyErr_SetFromErrno(xc_error_obj);
     va_hvm = (struct hvm_info_table *)(va_map + HVM_INFO_OFFSET);
-    va_hvm->acpi_enabled = acpi;
     va_hvm->apic_mode    = apic;
     va_hvm->nr_vcpus     = vcpus;
     memcpy(va_hvm->vcpu_online, vcpu_avail, sizeof(vcpu_avail));
diff -r dbdc840f8f62 -r 447738ef67ea xen/include/public/hvm/hvm_info_table.h
--- a/xen/include/public/hvm/hvm_info_table.h   Wed Nov 16 18:21:14 2011 +0000
+++ b/xen/include/public/hvm/hvm_info_table.h   Thu Nov 17 16:21:21 2011 +0000
@@ -37,9 +37,6 @@ struct hvm_info_table {
     uint32_t    length;
     uint8_t     checksum;
 
-    /* Should firmware build ACPI tables? */
-    uint8_t     acpi_enabled;
-
     /* Should firmware build APIC descriptors (APIC MADT / MP BIOS)? */
     uint8_t     apic_mode;
 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.