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
F166704576: D38327.id117181.diff
Sat, Aug 15, 7:02 PM
Unknown Object (File)
Sat, Aug 8, 5:04 PM
Unknown Object (File)
Sat, Aug 8, 5:03 PM
Unknown Object (File)
Sat, Aug 8, 4:33 PM
Unknown Object (File)
Sat, Aug 8, 4:21 PM
Unknown Object (File)
Sat, Aug 8, 11:06 AM
Unknown Object (File)
Thu, Aug 6, 10:18 PM
Unknown Object (File)
Thu, Aug 6, 10:18 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 49588
Build 46478: arc lint + arc unit

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.