]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
libxl: use b_info->{acpi,acpi} when available
authorMarek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Thu, 10 Sep 2020 04:18:01 +0000 (06:18 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 18 Sep 2020 06:51:47 +0000 (08:51 +0200)
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>
12 files changed:
src/libxl/libxl_conf.c
tests/libxlxml2domconfigdata/basic-hvm.json
tests/libxlxml2domconfigdata/cpu-shares-hvm.json
tests/libxlxml2domconfigdata/fullvirt-acpi-slic.json
tests/libxlxml2domconfigdata/fullvirt-cpuid-legacy-nest.json
tests/libxlxml2domconfigdata/fullvirt-cpuid.json
tests/libxlxml2domconfigdata/max-eventchannels-hvm.json
tests/libxlxml2domconfigdata/max-gntframes-hvm.json
tests/libxlxml2domconfigdata/moredevs-hvm.json
tests/libxlxml2domconfigdata/variable-clock-hvm.json
tests/libxlxml2domconfigdata/vnuma-hvm-legacy-nest.json
tests/libxlxml2domconfigdata/vnuma-hvm.json

index befd5eb96548c9cb41511992082b6044c380ec8e..5b729a019a57c2dbd594759770543f0177f00724 100644 (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)
index ccd5853854b52d6cdda2f3442d9530d7e30a3b39..87f8cb7d8adba9ff09ad67756251bd5d488caf34 100644 (file)
         "sched_params": {
 
         },
+        "apic": "True",
+        "acpi": "True",
         "type.hvm": {
             "pae": "True",
-            "apic": "True",
-            "acpi": "True",
             "vga": {
                 "kind": "cirrus"
             },
index 2e647eada2bf574325db338e7812d1d02b695109..2aa97e88c575edf169754b9c3e6407fd67c34f38 100644 (file)
         "sched_params": {
             "weight": 1500
         },
+        "apic": "True",
+        "acpi": "True",
         "type.hvm": {
             "pae": "True",
-            "apic": "True",
-            "acpi": "True",
             "vga": {
                 "kind": "cirrus"
             },
index f16b4a971a2c6751564f605c3d57667685ecec9a..a2d46797aac4d2a3cc0f949b6d3dc70636760c5b 100644 (file)
         "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": {
index 094447615189e8a291a66d77a4febc245b4acedb..6290655c20871c8faab4adfb819cbfbf37b25375 100644 (file)
         ],
         "sched_params": {
         },
+        "apic": "True",
+        "acpi": "True",
         "type.hvm": {
             "pae": "True",
-            "apic": "True",
-            "acpi": "True",
             "nested_hvm": "False",
             "nographic": "True",
             "vga": {
index ddc423bca7af9f59272774dec93f665957a05ec6..811a4f0ac77e9fb07e94fd1d3d4d47b3399aec9b 100644 (file)
         "sched_params": {
         },
         "nested_hvm": "False",
+        "apic": "True",
+        "acpi": "True",
         "type.hvm": {
             "pae": "True",
-            "apic": "True",
-            "acpi": "True",
             "nographic": "True",
             "vga": {
                 "kind": "none"
index d5b351beb5a4a4befced7295847448e97402a623..4a5b0ca65f274d2bbdf040721db460957cc16164 100644 (file)
         "sched_params": {
 
         },
+        "apic": "True",
+        "acpi": "True",
         "type.hvm": {
             "pae": "True",
-            "apic": "True",
-            "acpi": "True",
             "vga": {
                 "kind": "cirrus"
             },
index ef602f09fc77aba7023729ba73603fabd63318c5..2883d057fff06a8fd0bf2508a90806eb77517c98 100644 (file)
         "sched_params": {
 
         },
+        "apic": "True",
+        "acpi": "True",
         "type.hvm": {
             "pae": "True",
-            "apic": "True",
-            "acpi": "True",
             "vga": {
                 "kind": "cirrus"
             },
index 474aa2cef644d0f7f4e1302cc5a778df5b9cb35d..58cf32a8d4f401a60c09c994cbd75a0f1a5a7fd8 100644 (file)
         "sched_params": {
 
         },
+        "apic": "True",
+        "acpi": "True",
         "type.hvm": {
             "pae": "True",
-            "apic": "True",
-            "acpi": "True",
             "hpet": "True",
             "vga": {
                 "kind": "cirrus"
index 69be9c64cbe429a0cd068d2d10b0324a53ec8eef..9a25d51da2a20a535de510ee19420a0d9a90804c 100644 (file)
         "sched_params": {
 
         },
+        "apic": "True",
+        "acpi": "True",
         "type.hvm": {
             "pae": "True",
-            "apic": "True",
-            "acpi": "True",
             "vga": {
                 "kind": "cirrus"
             },
index 3b2fc5f40fe522d66b253598db8decd227b90018..6cda8d0252b10c20d221591a90b052ea3b402cb4 100644 (file)
         "sched_params": {
 
         },
+        "apic": "True",
+        "acpi": "True",
         "type.hvm": {
             "pae": "True",
-            "apic": "True",
-            "acpi": "True",
             "nested_hvm": "True",
             "vga": {
                 "kind": "cirrus"
index 02c10a9deb4afe3b591136f3377ffa559de0d58f..f578ccd3d312a1db931a0a91202d038e735e45e1 100644 (file)
 
         },
         "nested_hvm": "True",
+        "apic": "True",
+        "acpi": "True",
         "type.hvm": {
             "pae": "True",
-            "apic": "True",
-            "acpi": "True",
             "vga": {
                 "kind": "cirrus"
             },