108f7bba15
This patch adds the basic boilerplate for a 'XenBus' object that will act as a parent to 'XenDevice' PV backends. A new 'XenBridge' object is also added to connect XenBus to the system bus. The XenBus object is instantiated by a new xen_bus_init() function called from the same sites as the legacy xen_be_init() function. Subsequent patches will flesh-out the functionality of these objects. Signed-off-by: Paul Durrant <paul.durrant@citrix.com> Reviewed-by: Anthony Perard <anthony.perard@citrix.com> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
56 lines
1.4 KiB
C
56 lines
1.4 KiB
C
/*
|
|
* Copyright (c) 2018 Citrix Systems Inc.
|
|
*
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
* See the COPYING file in the top-level directory.
|
|
*/
|
|
|
|
#ifndef HW_XEN_BUS_H
|
|
#define HW_XEN_BUS_H
|
|
|
|
#include "hw/sysbus.h"
|
|
|
|
typedef struct XenDevice {
|
|
DeviceState qdev;
|
|
} XenDevice;
|
|
|
|
typedef void (*XenDeviceRealize)(XenDevice *xendev, Error **errp);
|
|
typedef void (*XenDeviceUnrealize)(XenDevice *xendev, Error **errp);
|
|
|
|
typedef struct XenDeviceClass {
|
|
/*< private >*/
|
|
DeviceClass parent_class;
|
|
/*< public >*/
|
|
XenDeviceRealize realize;
|
|
XenDeviceUnrealize unrealize;
|
|
} XenDeviceClass;
|
|
|
|
#define TYPE_XEN_DEVICE "xen-device"
|
|
#define XEN_DEVICE(obj) \
|
|
OBJECT_CHECK(XenDevice, (obj), TYPE_XEN_DEVICE)
|
|
#define XEN_DEVICE_CLASS(class) \
|
|
OBJECT_CLASS_CHECK(XenDeviceClass, (class), TYPE_XEN_DEVICE)
|
|
#define XEN_DEVICE_GET_CLASS(obj) \
|
|
OBJECT_GET_CLASS(XenDeviceClass, (obj), TYPE_XEN_DEVICE)
|
|
|
|
typedef struct XenBus {
|
|
BusState qbus;
|
|
} XenBus;
|
|
|
|
typedef struct XenBusClass {
|
|
/*< private >*/
|
|
BusClass parent_class;
|
|
} XenBusClass;
|
|
|
|
#define TYPE_XEN_BUS "xen-bus"
|
|
#define XEN_BUS(obj) \
|
|
OBJECT_CHECK(XenBus, (obj), TYPE_XEN_BUS)
|
|
#define XEN_BUS_CLASS(class) \
|
|
OBJECT_CLASS_CHECK(XenBusClass, (class), TYPE_XEN_BUS)
|
|
#define XEN_BUS_GET_CLASS(obj) \
|
|
OBJECT_GET_CLASS(XenBusClass, (obj), TYPE_XEN_BUS)
|
|
|
|
void xen_bus_init(void);
|
|
|
|
#endif /* HW_XEN_BUS_H */
|