mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05:00
bhyve: add capability probing for ACPI
Bhyve used the '-A' flag to enable ACPI until it was deprecated by commit: https://cgit.freebsd.org/src/commit/?id=6a0e7f908802b86ca5d1c0b3c404b8391d0f626e With that, ACPI tables are always generated. As this change is relatively new and there are likely systems that have bhyve(8) that requires using the '-A' flag, add a capability probing for that, and use this flag if it's supported. Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
1 parent
fc52d176ce
commit
caf74fab50
5 files changed
+12
-2
No files matched your search
@@ -255,6 +255,9 @@ bhyveProbeCapsFromHelp(unsigned int *caps, char *binary)
|
||||
if (strstr(help, "-c vcpus") == NULL)
|
||||
*caps |= BHYVE_CAP_CPUTOPOLOGY;
|
||||
|
||||
if (strstr(help, "-A:") != NULL)
|
||||
*caps |= BHYVE_CAP_ACPI;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ typedef enum {
|
||||
BHYVE_CAP_VIRTIO_9P = 1 << 9,
|
||||
BHYVE_CAP_VIRTIO_RND = 1 << 10,
|
||||
BHYVE_CAP_NVME = 1 << 11,
|
||||
BHYVE_CAP_ACPI = 1 << 12,
|
||||
} virBhyveCapsFlags;
|
||||
|
||||
int virBhyveProbeGrubCaps(virBhyveGrubCapsFlags *caps);
|
||||
|
||||
@@ -949,7 +949,12 @@ virBhyveProcessBuildBhyveCmd(struct _bhyveConn *driver, virDomainDef *def,
|
||||
virCommandAddArg(cmd, "-S"); /* Wire guest memory */
|
||||
|
||||
/* Options */
|
||||
if (def->features[VIR_DOMAIN_FEATURE_ACPI] == VIR_TRISTATE_SWITCH_ON)
|
||||
if ((def->features[VIR_DOMAIN_FEATURE_ACPI] == VIR_TRISTATE_SWITCH_ON) &&
|
||||
(bhyveDriverGetBhyveCaps(driver) & BHYVE_CAP_ACPI))
|
||||
/* As of FreeBSD commit
|
||||
* https://cgit.freebsd.org/src/commit/?id=6a0e7f908802b86ca5d1c0b3c404b8391d0f626e
|
||||
* bhyve(8) generates ACPI tables unconditionally, so nothing needs to be done
|
||||
* if the capability is missing. */
|
||||
virCommandAddArg(cmd, "-A"); /* Create an ACPI table */
|
||||
if (def->features[VIR_DOMAIN_FEATURE_MSRS] == VIR_TRISTATE_SWITCH_ON) {
|
||||
if (def->msrs_features[VIR_DOMAIN_MSRS_UNKNOWN] == VIR_DOMAIN_MSRS_UNKNOWN_IGNORE)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
bhyve \
|
||||
-c 1 \
|
||||
-m 214 \
|
||||
-A \
|
||||
-u \
|
||||
-H \
|
||||
-P \
|
||||
|
||||
@@ -204,6 +204,8 @@ mymain(void)
|
||||
DO_TEST("base");
|
||||
DO_TEST("wired");
|
||||
DO_TEST("acpiapic");
|
||||
driver.bhyvecaps &= ~BHYVE_CAP_ACPI;
|
||||
DO_TEST_FAILURE("acpiapic");
|
||||
DO_TEST("disk-cdrom");
|
||||
DO_TEST("disk-virtio");
|
||||
DO_TEST("macaddr");
|
||||
|
||||
Reference in new issue
Block a user