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)
Tue, Oct 8, 6:43 AM
Unknown Object (File)
Sat, Sep 28, 11:25 AM
Unknown Object (File)
Sat, Sep 28, 9:36 AM
Unknown Object (File)
Wed, Sep 18, 3:54 AM
Unknown Object (File)
Tue, Sep 17, 7:14 PM
Unknown Object (File)
Mon, Sep 16, 11:05 AM
Unknown Object (File)
Sep 9 2024, 1:26 AM
Unknown Object (File)
Sep 5 2024, 7:29 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.