diff options
author | Gleb Natapov <gleb@redhat.com> | 2010-12-08 13:34:54 +0200 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2010-12-11 21:27:44 +0000 |
commit | 779206de677533616ec3558bae89ea06fb91fc84 (patch) | |
tree | f85efe1ffc71bf96366aa486aace956a7cc2bb6a /hw/qdev.h | |
parent | 1b3cba6e91ab55a158e49bc5398fd76e67c695a8 (diff) | |
download | qemu-779206de677533616ec3558bae89ea06fb91fc84.tar.gz qemu-779206de677533616ec3558bae89ea06fb91fc84.tar.bz2 qemu-779206de677533616ec3558bae89ea06fb91fc84.zip |
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 <gleb@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/qdev.h')
-rw-r--r-- | hw/qdev.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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; |