aboutsummaryrefslogtreecommitdiff
path: root/include/hw/xen/xen-bus.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/hw/xen/xen-bus.h')
-rw-r--r--include/hw/xen/xen-bus.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/hw/xen/xen-bus.h b/include/hw/xen/xen-bus.h
index 85a75d8dec..df73674fcd 100644
--- a/include/hw/xen/xen-bus.h
+++ b/include/hw/xen/xen-bus.h
@@ -10,6 +10,11 @@
#include "hw/xen/xen_common.h"
#include "hw/sysbus.h"
+#include "qemu/notify.h"
+
+typedef void (*XenWatchHandler)(void *opaque);
+
+typedef struct XenWatch XenWatch;
typedef struct XenDevice {
DeviceState qdev;
@@ -18,10 +23,14 @@ typedef struct XenDevice {
char *backend_path, *frontend_path;
enum xenbus_state backend_state, frontend_state;
Notifier exit;
+ XenWatch *frontend_state_watch;
} XenDevice;
typedef char *(*XenDeviceGetName)(XenDevice *xendev, Error **errp);
typedef void (*XenDeviceRealize)(XenDevice *xendev, Error **errp);
+typedef void (*XenDeviceFrontendChanged)(XenDevice *xendev,
+ enum xenbus_state frontend_state,
+ Error **errp);
typedef void (*XenDeviceUnrealize)(XenDevice *xendev, Error **errp);
typedef struct XenDeviceClass {
@@ -32,6 +41,7 @@ typedef struct XenDeviceClass {
const char *device;
XenDeviceGetName get_name;
XenDeviceRealize realize;
+ XenDeviceFrontendChanged frontend_changed;
XenDeviceUnrealize unrealize;
} XenDeviceClass;
@@ -47,6 +57,7 @@ typedef struct XenBus {
BusState qbus;
domid_t backend_id;
struct xs_handle *xsh;
+ NotifierList watch_notifiers;
} XenBus;
typedef struct XenBusClass {
@@ -64,4 +75,8 @@ typedef struct XenBusClass {
void xen_bus_init(void);
+void xen_device_backend_set_state(XenDevice *xendev,
+ enum xenbus_state state);
+enum xenbus_state xen_device_backend_get_state(XenDevice *xendev);
+
#endif /* HW_XEN_BUS_H */