mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
qdev: remove DeviceType
The only purpose DeviceType serves is creating a linked list of DeviceInfo structs. This removes DeviceType and add a next field to DeviceInfo instead, so the DeviceInfo structs can be changed that way. Elimitates a pointless extra level of indirection. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
10c4c98ab7
commit
042f84d0af
2 changed files with 18 additions and 27 deletions
|
@ -4,7 +4,7 @@
|
|||
#include "hw.h"
|
||||
#include "sys-queue.h"
|
||||
|
||||
typedef struct DeviceType DeviceType;
|
||||
typedef struct DeviceInfo DeviceInfo;
|
||||
|
||||
typedef struct DeviceProperty DeviceProperty;
|
||||
|
||||
|
@ -15,7 +15,7 @@ typedef struct BusInfo BusInfo;
|
|||
/* This structure should not be accessed directly. We declare it here
|
||||
so that it can be embedded in individual device state structures. */
|
||||
struct DeviceState {
|
||||
DeviceType *type;
|
||||
DeviceInfo *info;
|
||||
BusState *parent_bus;
|
||||
DeviceProperty *props;
|
||||
int num_gpio_out;
|
||||
|
@ -72,8 +72,6 @@ typedef struct {
|
|||
DevicePropType type;
|
||||
} DevicePropList;
|
||||
|
||||
typedef struct DeviceInfo DeviceInfo;
|
||||
|
||||
typedef void (*qdev_initfn)(DeviceState *dev, DeviceInfo *info);
|
||||
typedef void (*SCSIAttachFn)(DeviceState *host, BlockDriverState *bdrv,
|
||||
int unit);
|
||||
|
@ -86,6 +84,7 @@ struct DeviceInfo {
|
|||
/* Private to qdev / bus. */
|
||||
qdev_initfn init;
|
||||
BusInfo *bus_info;
|
||||
struct DeviceInfo *next;
|
||||
};
|
||||
|
||||
void qdev_register(DeviceInfo *info);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue