From 82a29e304841e464ddb6a8a2c0240196b0ee3887 Mon Sep 17 00:00:00 2001 From: Paul Durrant Date: Tue, 8 Jan 2019 14:48:50 +0000 Subject: 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 Reviewed-by: Anthony Perard Signed-off-by: Anthony PERARD --- hw/block/trace-events | 2 ++ 1 file changed, 2 insertions(+) (limited to 'hw/block/trace-events') diff --git a/hw/block/trace-events b/hw/block/trace-events index 4afbd62a88..89e258319c 100644 --- a/hw/block/trace-events +++ b/hw/block/trace-events @@ -130,6 +130,8 @@ xen_disk_free(char *name) "%s" # hw/block/xen-block.c xen_block_realize(const char *type, uint32_t disk, uint32_t partition) "%s d%up%u" +xen_block_connect(const char *type, uint32_t disk, uint32_t partition) "%s d%up%u" +xen_block_disconnect(const char *type, uint32_t disk, uint32_t partition) "%s d%up%u" xen_block_unrealize(const char *type, uint32_t disk, uint32_t partition) "%s d%up%u" xen_disk_realize(void) "" xen_disk_unrealize(void) "" -- cgit v1.2.3