mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
qdev: make DeviceInfo private
Introduce accessors and remove any code that directly accesses DeviceInfo members. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
ba02430f1a
commit
4be9f0d11c
4 changed files with 48 additions and 23 deletions
24
hw/qdev.h
24
hw/qdev.h
|
@ -405,22 +405,8 @@ void qdev_prop_set_globals(DeviceState *dev);
|
|||
void error_set_from_qdev_prop_error(Error **errp, int ret, DeviceState *dev,
|
||||
Property *prop, const char *value);
|
||||
|
||||
DeviceInfo *qdev_get_info(DeviceState *dev);
|
||||
|
||||
static inline const char *qdev_fw_name(DeviceState *dev)
|
||||
{
|
||||
DeviceInfo *info = qdev_get_info(dev);
|
||||
|
||||
if (info->fw_name) {
|
||||
return info->fw_name;
|
||||
} else if (info->alias) {
|
||||
return info->alias;
|
||||
}
|
||||
|
||||
return object_get_typename(OBJECT(dev));
|
||||
}
|
||||
|
||||
char *qdev_get_fw_dev_path(DeviceState *dev);
|
||||
|
||||
/* This is a nasty hack to allow passing a NULL bus to qdev_create. */
|
||||
extern struct BusInfo system_bus_info;
|
||||
|
||||
|
@ -668,4 +654,12 @@ void qdev_machine_init(void);
|
|||
*/
|
||||
void device_reset(DeviceState *dev);
|
||||
|
||||
const VMStateDescription *qdev_get_vmsd(DeviceState *dev);
|
||||
|
||||
const char *qdev_fw_name(DeviceState *dev);
|
||||
|
||||
BusInfo *qdev_get_bus_info(DeviceState *dev);
|
||||
|
||||
Property *qdev_get_props(DeviceState *dev);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue