1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

src: introduce 'raw' and 'rawset' ACPI table types

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>
This commit is contained in:
Daniel P. Berrangé 2025-02-26 18:39:18 +00:00
parent 3d94587655
commit 513ef8f028
7 changed files with 43 additions and 5 deletions

View 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

View 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));

View 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

View File

@ -7180,7 +7180,11 @@
<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>

View 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,

View 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");

View 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,