summaryrefslogtreecommitdiffstats
path: root/hw/xen/trace-events
diff options
context:
space:
mode:
authorPaul Durrant2019-01-08 15:48:50 +0100
committerAnthony PERARD2019-01-14 14:45:40 +0100
commit82a29e304841e464ddb6a8a2c0240196b0ee3887 (patch)
treefae912b7e3a1e479077cda6f48c769414613d50d /hw/xen/trace-events
parentxen: create xenstore areas for XenDevice-s (diff)
downloadqemu-82a29e304841e464ddb6a8a2c0240196b0ee3887.tar.gz
qemu-82a29e304841e464ddb6a8a2c0240196b0ee3887.tar.xz
qemu-82a29e304841e464ddb6a8a2c0240196b0ee3887.zip
xen: add xenstore watcher infrastructure
A Xen PV frontend communicates its state to the PV backend by writing to the 'state' key in the frontend area in xenstore. It is therefore necessary for a XenDevice implementation to be notified whenever the value of this key changes. This patch adds code to do this as follows: - an 'fd handler' is registered on the libxenstore handle which will be triggered whenever a 'watch' event occurs - primitives are added to xen-bus-helper to add or remove watch events - a list of Notifier objects is added to XenBus to provide a mechanism to call the appropriate 'watch handler' when its associated event occurs The xen-block implementation is extended with a 'frontend_changed' method, which calls as-yet stub 'connect' and 'disconnect' functions when the relevant frontend state transitions occur. A subsequent patch will supply a full implementation for these functions. 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>
Diffstat (limited to 'hw/xen/trace-events')
-rw-r--r--hw/xen/trace-events6
1 files changed, 6 insertions, 0 deletions
diff --git a/hw/xen/trace-events b/hw/xen/trace-events
index 75dc226d75..22055b5894 100644
--- a/hw/xen/trace-events
+++ b/hw/xen/trace-events
@@ -16,13 +16,19 @@ xen_domid_restrict(int err) "err: %u"
# include/hw/xen/xen-bus.c
xen_bus_realize(void) ""
xen_bus_unrealize(void) ""
+xen_bus_add_watch(const char *node, const char *key, char *token) "node: %s key: %s token: %s"
+xen_bus_remove_watch(const char *node, const char *key, char *token) "node: %s key: %s token: %s"
+xen_bus_watch(const char *token) "token: %s"
xen_device_realize(const char *type, char *name) "type: %s name: %s"
xen_device_unrealize(const char *type, char *name) "type: %s name: %s"
xen_device_backend_state(const char *type, char *name, const char *state) "type: %s name: %s -> %s"
xen_device_frontend_state(const char *type, char *name, const char *state) "type: %s name: %s -> %s"
+xen_device_frontend_changed(const char *type, char *name) "type: %s name: %s"
# include/hw/xen/xen-bus-helper.c
xs_node_create(const char *node) "%s"
xs_node_destroy(const char *node) "%s"
xs_node_vprintf(char *path, char *value) "%s %s"
xs_node_vscanf(char *path, char *value) "%s %s"
+xs_node_watch(char *path) "%s"
+xs_node_unwatch(char *path) "%s"