Add device listener interface
The Xen ioreq-server API, introduced in Xen 4.5, requires that PCI device models explicitly register with Xen for config space accesses. This patch adds a listener interface into qdev-core which can be used by the Xen interface code to monitor for arrival and departure of PCI devices. Signed-off-by: Paul Durrant <paul.durrant@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
committed by
Stefano Stabellini
parent
74acb99737
commit
707ff80021
@@ -165,6 +165,12 @@ struct DeviceState {
|
||||
int alias_required_for_version;
|
||||
};
|
||||
|
||||
struct DeviceListener {
|
||||
void (*realize)(DeviceListener *listener, DeviceState *dev);
|
||||
void (*unrealize)(DeviceListener *listener, DeviceState *dev);
|
||||
QTAILQ_ENTRY(DeviceListener) link;
|
||||
};
|
||||
|
||||
#define TYPE_BUS "bus"
|
||||
#define BUS(obj) OBJECT_CHECK(BusState, (obj), TYPE_BUS)
|
||||
#define BUS_CLASS(klass) OBJECT_CLASS_CHECK(BusClass, (klass), TYPE_BUS)
|
||||
@@ -376,4 +382,8 @@ static inline bool qbus_is_hotpluggable(BusState *bus)
|
||||
{
|
||||
return bus->hotplug_handler;
|
||||
}
|
||||
|
||||
void device_listener_register(DeviceListener *listener);
|
||||
void device_listener_unregister(DeviceListener *listener);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user