mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
qdev: integrate with QEMU Object Model (v2)
This is a very shallow integration. We register a TYPE_DEVICE but only use QOM as basically a memory allocator. This will make all devices show up as QOM objects but they will all carry the TYPE_DEVICE. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> --- v1 -> v2 - update for new location of object.h
This commit is contained in:
parent
2f28d2ff9d
commit
32fea4025b
2 changed files with 35 additions and 2 deletions
10
hw/qdev.h
10
hw/qdev.h
|
@ -6,6 +6,7 @@
|
|||
#include "qemu-char.h"
|
||||
#include "qemu-option.h"
|
||||
#include "qapi/qapi-visit-core.h"
|
||||
#include "qemu/object.h"
|
||||
|
||||
typedef struct Property Property;
|
||||
|
||||
|
@ -66,9 +67,18 @@ typedef struct DeviceProperty
|
|||
QTAILQ_ENTRY(DeviceProperty) node;
|
||||
} DeviceProperty;
|
||||
|
||||
#define TYPE_DEVICE "device"
|
||||
#define DEVICE(obj) OBJECT_CHECK(DeviceState, (obj), TYPE_DEVICE)
|
||||
|
||||
typedef struct DeviceClass {
|
||||
ObjectClass parent_class;
|
||||
} DeviceClass;
|
||||
|
||||
/* This structure should not be accessed directly. We declare it here
|
||||
so that it can be embedded in individual device state structures. */
|
||||
struct DeviceState {
|
||||
Object parent_obj;
|
||||
|
||||
const char *id;
|
||||
enum DevState state;
|
||||
QemuOpts *opts;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue