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
F102540362: D38327.id117181.diff
Wed, Nov 13, 7:26 PM
F102538456: D38327.id116332.diff
Wed, Nov 13, 6:49 PM
F102536717: D38327.id.diff
Wed, Nov 13, 6:14 PM
Unknown Object (File)
Thu, Nov 7, 7:59 PM
Unknown Object (File)
Thu, Nov 7, 11:52 AM
Unknown Object (File)
Oct 11 2024, 7:49 AM
Unknown Object (File)
Oct 8 2024, 6:43 AM
Unknown Object (File)
Sep 28 2024, 11:25 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.