]> xenbits.xensource.com Git - people/pauldu/qemu.git/commit
xen: create xenstore areas for XenDevice-s
authorPaul Durrant <paul.durrant@citrix.com>
Mon, 12 Nov 2018 11:57:17 +0000 (11:57 +0000)
committerPaul Durrant <paul.durrant@citrix.com>
Mon, 17 Dec 2018 11:21:07 +0000 (11:21 +0000)
commit00b087aa66f0d7e3d436ef15ebf7f162c43ef5d2
tree47e6aa018043bd56bc98b730231062c5b0fd6e1a
parentcde8d0efd83af8a6961a615d387b066fd579b4ad
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>
---
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Max Reitz <mreitz@redhat.com>
v5:
 - Re-base

v3:
 - Add transaction id parameters to xen-bus-helper functions
 - Not added Anthony's R-b because of change

v2:
 - Fix boilerplate
 - Add error pointers to all xs_node... helpers
 - Add GCC_FMT_ATTR to declarations of printf-like helpers
hw/block/xen-block.c
hw/xen/Makefile.objs
hw/xen/trace-events
hw/xen/xen-bus-helper.c [new file with mode: 0644]
hw/xen/xen-bus.c
include/hw/xen/xen-bus-helper.h [new file with mode: 0644]
include/hw/xen/xen-bus.h