diff options
author | Paul Durrant <paul.durrant@citrix.com> | 2019-01-08 14:48:49 +0000 |
---|---|---|
committer | Anthony PERARD <anthony.perard@citrix.com> | 2019-01-14 13:45:40 +0000 |
commit | 094a22399f1b3e796727fc7e584c7a1f2beca24b (patch) | |
tree | 0847863e115f47588149d2cba3f049d0f1ede2e9 /hw/xen/trace-events | |
parent | 1a72d9ae31517b2f83ec7923c820daf1887fde50 (diff) | |
download | qemu-094a22399f1b3e796727fc7e584c7a1f2beca24b.zip qemu-094a22399f1b3e796727fc7e584c7a1f2beca24b.tar.gz qemu-094a22399f1b3e796727fc7e584c7a1f2beca24b.tar.bz2 |
xen: create xenstore areas for XenDevice-s
This patch adds a new source module, xen-bus-helper.c, which builds on
basic libxenstore primitives to provide functions to create (setting
permissions appropriately) and destroy xenstore areas, and functions to
'printf' and 'scanf' nodes therein. The main xen-bus code then uses
these primitives [1] to initialize and destroy the frontend and backend
areas for a XenDevice during realize and unrealize respectively.
The 'xen-block' implementation is extended with a 'get_name' method that
returns the VBD number. This number is required to 'name' the xenstore
areas.
NOTE: An exit handler is also added to make sure the xenstore areas are
cleaned up if QEMU terminates without devices being unrealized.
[1] The 'scanf' functions are actually not yet needed, but they will be
needed by code delivered in subsequent patches.
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-events | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/hw/xen/trace-events b/hw/xen/trace-events index 0172cd4..75dc226 100644 --- a/hw/xen/trace-events +++ b/hw/xen/trace-events @@ -16,5 +16,13 @@ xen_domid_restrict(int err) "err: %u" # include/hw/xen/xen-bus.c xen_bus_realize(void) "" xen_bus_unrealize(void) "" -xen_device_realize(const char *type) "type: %s" -xen_device_unrealize(const char *type) "type: %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" + +# 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" |