]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
src: introduce 'raw' and 'rawset' ACPI table types
authorDaniel P. Berrangé <berrange@redhat.com>
Wed, 26 Feb 2025 18:39:18 +0000 (18:39 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Fri, 7 Mar 2025 13:00:10 +0000 (13:00 +0000)
The QEMU driver has only accepted type=slic even though QEMU is able to
accept individual tables of any type, without needing to specify a
signature. Introduce type=raw to address this usage scenario. Contrary
to other types, this one may appear multiple times.

The Xen driver has mistakenly accepted type=slic and use it to set the
Xen acpi_firmware setting, which performs a simple passthrough of
multiple concatenated data table. Introduce type=rawset to address
this usage scenario.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
docs/formatdomain.rst
src/conf/domain_conf.c
src/conf/domain_conf.h
src/conf/schemas/domaincommon.rng
src/libxl/libxl_domain.c
src/qemu/qemu_command.c
src/qemu/qemu_validate.c

index 79abae15af16fd5b191930ccf4aa5ae65e28b79e..e914fa8ee624a8d76c2f1c5dcf55e68365f2d3d5 100644 (file)
@@ -490,9 +490,22 @@ These options apply to any form of booting of the guest OS.
    ...
 
 ``acpi``
-   The ``table`` element contains a fully-qualified path to the ACPI table. The
-   ``type`` attribute contains the ACPI table type (currently only ``slic`` is
-   supported) :since:`Since 1.3.5 (QEMU)` :since:`Since 5.9.0 (Xen)`
+   The ``table`` element contains a fully-qualified path to the ACPI table,
+   with the ``type`` attribute dictating what data must be present in the
+   file:
+
+   * ``raw``: a single ACPI table with header and data, with ACPI
+     signature auto-detected from header (:since:`Since 11.2.0`).
+   * ``rawset``: concatenation of multiple ACPI tables with header
+     and data, each with any ACPI signature, auto-detected from header
+     (:since:`Since 11.2.0`).
+   * ``slic``: a single ACPI table with header and data, providing
+     software licensing information. The ACPI table signature in the
+     header will be forced to ``SLIC`` (:since:`Since 1.3.5 (QEMU)`,
+     mis-interpreted as ``rawset`` :since:`Since 5.9.0 (Xen)`).
+
+   Each type may be used only once, except for ``raw`` which can
+   appear multiple times.
 
 
 SMBIOS System Information
index 40c6914fa985e6ee7edf662d75f3c06a96593049..700ed232df4c2f6946eecd94123178fffc7a0799 100644 (file)
@@ -1459,6 +1459,8 @@ VIR_ENUM_IMPL(virDomainOsDefFirmwareFeature,
 
 VIR_ENUM_IMPL(virDomainOsACPITable,
               VIR_DOMAIN_OS_ACPI_TABLE_TYPE_LAST,
+              "raw",
+              "rawset",
               "slic",
 );
 
@@ -17900,7 +17902,8 @@ virDomainDefParseBootAcpiOptions(virDomainDef *def,
             goto error;
 
         for (j = 0; j < i; j++) {
-            if (tables[j]->type == type) {
+            if (tables[j]->type == type &&
+                type != VIR_DOMAIN_OS_ACPI_TABLE_TYPE_RAW) {
                 virReportError(VIR_ERR_XML_ERROR,
                                _("ACPI table type '%1$s' may only appear once"),
                                virDomainOsACPITableTypeToString(type));
index c0fe0c6e753a6954efb24120a79a6df514c9415e..8b7877ece7455d814b7ec7ed77ea1d1c2c512146 100644 (file)
@@ -2482,6 +2482,8 @@ typedef enum {
 VIR_ENUM_DECL(virDomainOsDefFirmwareFeature);
 
 typedef enum {
+    VIR_DOMAIN_OS_ACPI_TABLE_TYPE_RAW,
+    VIR_DOMAIN_OS_ACPI_TABLE_TYPE_RAWSET,
     VIR_DOMAIN_OS_ACPI_TABLE_TYPE_SLIC,
 
     VIR_DOMAIN_OS_ACPI_TABLE_TYPE_LAST
index 824da9d0662f0b7e1c1392b0eae96806a521aa4d..b5eaf7c23317f1139b2e893abf52d48211dd0b11 100644 (file)
       <zeroOrMore>
         <element name="table">
           <attribute name="type">
-            <value>slic</value>
+            <choice>
+              <value>raw</value>
+              <value>rawset</value>
+              <value>slic</value>
+            </choice>
           </attribute>
           <ref name="absFilePath"/>
         </element>
index ff76ba3b77f8c80d0e6cf8d13338d9319377057c..ddfbe9b2ea80cbe5077a2a45166878f1354d70b5 100644 (file)
@@ -334,6 +334,13 @@ libxlDomainDefValidate(const virDomainDef *def,
         case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_SLIC:
             break;
 
+        case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_RAW:
+        case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_RAWSET:
+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                           _("ACPI table type '%1$s' is not supported"),
+                           virDomainOsACPITableTypeToString(def->os.acpiTables[i]->type));
+            return -1;
+
         default:
         case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_LAST:
             virReportEnumRangeError(virDomainOsACPITable,
index 6048c755fc0ca34fda7ebfc84571f900869555ee..bef06049ec53338586bec6e6866b073034dca2da 100644 (file)
@@ -130,6 +130,8 @@ VIR_ENUM_IMPL(qemuNumaPolicy,
 VIR_ENUM_DECL(qemuACPITableSIG);
 VIR_ENUM_IMPL(qemuACPITableSIG,
               VIR_DOMAIN_OS_ACPI_TABLE_TYPE_LAST,
+              "", /* raw */
+              "", /* rawset */
               "SLIC");
 
 
index 1759ab4e6e5cd8cb0e205ef87c35cd17bb2af2f3..de36bfc7ea07008be88493ed2cebdf1c5a9cb89d 100644 (file)
@@ -747,6 +747,13 @@ qemuValidateDomainDefBoot(const virDomainDef *def,
         case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_SLIC:
             break;
 
+        case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_RAW:
+        case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_RAWSET:
+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                           _("ACPI table type '%1$s' is not supported"),
+                           virDomainOsACPITableTypeToString(def->os.acpiTables[i]->type));
+            return -1;
+
         default:
         case VIR_DOMAIN_OS_ACPI_TABLE_TYPE_LAST:
             virReportEnumRangeError(virDomainOsACPITable,