From 779206de677533616ec3558bae89ea06fb91fc84 Mon Sep 17 00:00:00 2001 From: Gleb Natapov Date: Wed, 8 Dec 2010 13:34:54 +0200 Subject: Introduce fw_name field to DeviceInfo structure. Add "fw_name" to DeviceInfo to use in device path building. In contrast to "name" "fw_name" should refer to functionality device provides instead of particular device model like "name" does. Signed-off-by: Gleb Natapov Signed-off-by: Blue Swirl --- hw/qdev.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'hw/qdev.h') diff --git a/hw/qdev.h b/hw/qdev.h index 3fac364c6b..bc7111089e 100644 --- a/hw/qdev.h +++ b/hw/qdev.h @@ -141,6 +141,7 @@ typedef void (*qdev_resetfn)(DeviceState *dev); struct DeviceInfo { const char *name; + const char *fw_name; const char *alias; const char *desc; size_t size; @@ -306,6 +307,11 @@ void qdev_prop_set_defaults(DeviceState *dev, Property *props); void qdev_prop_register_global_list(GlobalProperty *props); void qdev_prop_set_globals(DeviceState *dev); +static inline const char *qdev_fw_name(DeviceState *dev) +{ + return dev->info->fw_name ? : dev->info->alias ? : dev->info->name; +} + /* This is a nasty hack to allow passing a NULL bus to qdev_create. */ extern struct BusInfo system_bus_info; -- cgit v1.2.3-55-g7522