aboutsummaryrefslogtreecommitdiff
path: root/include/hw/acpi/vmgenid.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/hw/acpi/vmgenid.h')
-rw-r--r--include/hw/acpi/vmgenid.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/include/hw/acpi/vmgenid.h b/include/hw/acpi/vmgenid.h
index c49d913f3e..aff574df5f 100644
--- a/include/hw/acpi/vmgenid.h
+++ b/include/hw/acpi/vmgenid.h
@@ -4,8 +4,9 @@
#include "hw/acpi/bios-linker-loader.h"
#include "hw/qdev-core.h"
#include "qemu/uuid.h"
+#include "qom/object.h"
-#define VMGENID_DEVICE "vmgenid"
+#define TYPE_VMGENID "vmgenid"
#define VMGENID_GUID "guid"
#define VMGENID_GUID_FW_CFG_FILE "etc/vmgenid_guid"
#define VMGENID_ADDR_FW_CFG_FILE "etc/vmgenid_addr"
@@ -15,18 +16,20 @@
* OVMF SDT Header Probe Supressor
*/
-#define VMGENID(obj) OBJECT_CHECK(VmGenIdState, (obj), VMGENID_DEVICE)
+typedef struct VmGenIdState VmGenIdState;
+DECLARE_INSTANCE_CHECKER(VmGenIdState, VMGENID,
+ TYPE_VMGENID)
-typedef struct VmGenIdState {
+struct VmGenIdState {
DeviceClass parent_obj;
QemuUUID guid; /* The 128-bit GUID seen by the guest */
uint8_t vmgenid_addr_le[8]; /* Address of the GUID (little-endian) */
-} VmGenIdState;
+};
/* returns NULL unless there is exactly one device */
static inline Object *find_vmgenid_dev(void)
{
- return object_resolve_path_type("", VMGENID_DEVICE, NULL);
+ return object_resolve_path_type("", TYPE_VMGENID, NULL);
}
void vmgenid_build_acpi(VmGenIdState *vms, GArray *table_data, GArray *guid,