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

[Xen-devel] [RFC PATCH v2 06/16] libxl: Load guest ACPI table from file



The path to the ACPI tables blob can be override by xl's option
acpi_table_override or by acpi_tables_filename in the domain_build_info
struct for libxl user.

Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
---
 tools/libxl/libxl_dom.c     | 17 +++++++++++++++++
 tools/libxl/libxl_types.idl |  1 +
 tools/libxl/xl_cmdimpl.c    |  3 +++
 3 files changed, 21 insertions(+)

diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 27a0021..b340fa4 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -948,6 +948,7 @@ static int libxl__domain_firmware(libxl__gc *gc,
 
     if (info->device_model_version != LIBXL_DEVICE_MODEL_VERSION_NONE) {
         const char *bios_filename;
+        const char *acpi_tables_filename;
         // Look for BIOS and load it
         if (info->u.hvm.bios_filename) {
             bios_filename = info->u.hvm.bios_filename;
@@ -970,10 +971,26 @@ static int libxl__domain_firmware(libxl__gc *gc,
                 goto out;
             }
         }
+        if (info->u.hvm.acpi_tables_filename) {
+            acpi_tables_filename = info->u.hvm.acpi_tables_filename;
+        } else {
+            // this would depend on which machine we emulate
+            // this is going to be eathier qemu-trad or qemu-xen
+            // (later, there will be qemu-xen-q35)
+            acpi_tables_filename = libxl__abs_path(gc,
+                                                   "dsdt_anycpu_qemu_xen.aml",
+                                                   
libxl__xenfirmwaredir_path());
+        }
 
         rc = libxl__load_hvm_firmware_module(gc, bios_filename, "BIOS",
                                              &dom->bios_module);
         if (rc) goto out;
+
+        rc = libxl__load_hvm_firmware_module(gc,
+                                             acpi_tables_filename,
+                                             "ACPI tables",
+                                             &dom->acpi_table_module);
+        if (rc) goto out;
     }
 
     if (info->u.hvm.smbios_firmware) {
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index a3fbcab..d7eaa8d 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -469,6 +469,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
                 [("hvm", Struct(None, [("firmware",         string),
                                        ("bios",             libxl_bios_type),
                                        ("bios_filename",    string),
+                                       ("acpi_tables_filename", string),
                                        ("pae",              libxl_defbool),
                                        ("apic",             libxl_defbool),
                                        ("acpi",             libxl_defbool),
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 27d7c25..1fb1300 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1512,6 +1512,9 @@ static void parse_config_data(const char *config_source,
             fprintf(stderr, "WARNING: "
                     "bios_override given without specific bios name\n");
 
+        xlu_cfg_replace_string(config, "acpi_table_override",
+                               &b_info->u.hvm.acpi_tables_filename, 0);
+
         xlu_cfg_get_defbool(config, "pae", &b_info->u.hvm.pae, 0);
         xlu_cfg_get_defbool(config, "apic", &b_info->u.hvm.apic, 0);
         xlu_cfg_get_defbool(config, "acpi", &b_info->u.hvm.acpi, 0);
-- 
Anthony PERARD


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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