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, Jun 22, 7:23 PM
Unknown Object (File)
Fri, Jun 7, 5:19 AM
Unknown Object (File)
Fri, Jun 7, 5:19 AM
Unknown Object (File)
Fri, Jun 7, 5:19 AM
Unknown Object (File)
Fri, Jun 7, 5:19 AM
Unknown Object (File)
Fri, Jun 7, 5:19 AM
Unknown Object (File)
Thu, Jun 6, 1:09 AM
Unknown Object (File)
May 9 2024, 7:36 AM

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.