libxl: use b_info->{acpi,acpi} when available

b_info->u.hvm.{acpi,apic} are deprecated. But also, on recent libxl
version (4.14) the old one seems to be broken. While libxl part should
be fixed too, update the usage here and at some point drop support for
the old version.
b_info->acpi was added in Xen 4.8
b_info->apic was added in Xen 4.10
Xen 4.10 is the oldest version that still has security support (until
December 2020).

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
This commit is contained in:
Marek Marczykowski-Górecki 2020-09-10 06:18:01 +02:00 committed by Michal Privoznik
parent cf6cc86cd2
commit f253dc90f5
12 changed files with 35 additions and 22 deletions

View File

@ -508,12 +508,25 @@ libxlMakeDomBuildInfo(virDomainDefPtr def,
libxl_defbool_set(&b_info->u.hvm.pae,
def->features[VIR_DOMAIN_FEATURE_PAE] ==
VIR_TRISTATE_SWITCH_ON);
#ifdef LIBXL_HAVE_BUILDINFO_APIC
libxl_defbool_set(&b_info->apic,
def->features[VIR_DOMAIN_FEATURE_APIC] ==
VIR_TRISTATE_SWITCH_ON);
/*
* Strictly speaking b_info->acpi was introduced earlier (Xen 4.8), but
* there is no separate #define in libxl.h.
*/
libxl_defbool_set(&b_info->acpi,
def->features[VIR_DOMAIN_FEATURE_ACPI] ==
VIR_TRISTATE_SWITCH_ON);
#else
libxl_defbool_set(&b_info->u.hvm.apic,
def->features[VIR_DOMAIN_FEATURE_APIC] ==
VIR_TRISTATE_SWITCH_ON);
libxl_defbool_set(&b_info->u.hvm.acpi,
def->features[VIR_DOMAIN_FEATURE_ACPI] ==
VIR_TRISTATE_SWITCH_ON);
#endif
/* copy SLIC table path to acpi_firmware */
if (def->os.slic_table)

View File

@ -21,10 +21,10 @@
"sched_params": {
},
"apic": "True",
"acpi": "True",
"type.hvm": {
"pae": "True",
"apic": "True",
"acpi": "True",
"vga": {
"kind": "cirrus"
},

View File

@ -21,10 +21,10 @@
"sched_params": {
"weight": 1500
},
"apic": "True",
"acpi": "True",
"type.hvm": {
"pae": "True",
"apic": "True",
"acpi": "True",
"vga": {
"kind": "cirrus"
},

View File

@ -14,10 +14,10 @@
"shadow_memkb": 5656,
"sched_params": {
},
"apic": "True",
"acpi": "True",
"type.hvm": {
"pae": "True",
"apic": "True",
"acpi": "True",
"acpi_firmware": "/path/to/slic.dat",
"nographic": "True",
"vga": {

View File

@ -21,10 +21,10 @@
],
"sched_params": {
},
"apic": "True",
"acpi": "True",
"type.hvm": {
"pae": "True",
"apic": "True",
"acpi": "True",
"nested_hvm": "False",
"nographic": "True",
"vga": {

View File

@ -22,10 +22,10 @@
"sched_params": {
},
"nested_hvm": "False",
"apic": "True",
"acpi": "True",
"type.hvm": {
"pae": "True",
"apic": "True",
"acpi": "True",
"nographic": "True",
"vga": {
"kind": "none"

View File

@ -22,10 +22,10 @@
"sched_params": {
},
"apic": "True",
"acpi": "True",
"type.hvm": {
"pae": "True",
"apic": "True",
"acpi": "True",
"vga": {
"kind": "cirrus"
},

View File

@ -22,10 +22,10 @@
"sched_params": {
},
"apic": "True",
"acpi": "True",
"type.hvm": {
"pae": "True",
"apic": "True",
"acpi": "True",
"vga": {
"kind": "cirrus"
},

View File

@ -23,10 +23,10 @@
"sched_params": {
},
"apic": "True",
"acpi": "True",
"type.hvm": {
"pae": "True",
"apic": "True",
"acpi": "True",
"hpet": "True",
"vga": {
"kind": "cirrus"

View File

@ -23,10 +23,10 @@
"sched_params": {
},
"apic": "True",
"acpi": "True",
"type.hvm": {
"pae": "True",
"apic": "True",
"acpi": "True",
"vga": {
"kind": "cirrus"
},

View File

@ -109,10 +109,10 @@
"sched_params": {
},
"apic": "True",
"acpi": "True",
"type.hvm": {
"pae": "True",
"apic": "True",
"acpi": "True",
"nested_hvm": "True",
"vga": {
"kind": "cirrus"

View File

@ -110,10 +110,10 @@
},
"nested_hvm": "True",
"apic": "True",
"acpi": "True",
"type.hvm": {
"pae": "True",
"apic": "True",
"acpi": "True",
"vga": {
"kind": "cirrus"
},