Page MenuHomeFreeBSD

bhyve: add helper struct for acpi device handling
ClosedPublic

Authored by corvink on Feb 1 2023, 11:09 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 23, 2:27 AM
Unknown Object (File)
Sat, Nov 16, 11:37 AM
Unknown Object (File)
Sat, Nov 16, 10:34 AM
Unknown Object (File)
Sat, Nov 16, 9:20 AM
Unknown Object (File)
Wed, Nov 13, 7:26 PM
Unknown Object (File)
Wed, Nov 13, 6:49 PM
Unknown Object (File)
Wed, Nov 13, 6:14 PM
Unknown Object (File)
Nov 7 2024, 7:59 PM

Details

Summary

To simplify the handling of different acpi devices like qemu fwcfg or a
tpm, add a helper struct. It will handle the reporting of acpi
resources.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

usr.sbin/bhyve/acpi_device.c
10

You don't need to add this to new files.

12

No need to include sys/types.h if you include sys/param.h. See style(9).

98

Don't you want to free the acpi_device itself?

  • fix includes
  • save copies of name and hid in acpi_device_create
  • properly free an acpi_device on acpi_device_destroy
usr.sbin/bhyve/acpi_device.c
101

Double free.

rew added inline comments.
usr.sbin/bhyve/acpi_device.c
101

I'm guessing its a typo since dev->name is strdup()'ed further up.

corvink added inline comments.
usr.sbin/bhyve/acpi_device.c
101

Yes, it was a typo.

This revision is now accepted and ready to land.Feb 10 2023, 4:06 PM
This revision was automatically updated to reflect the committed changes.
corvink marked an inline comment as done.