hw/xen: Add emulated implementation of XenStore operations
authorDavid Woodhouse <dwmw@amazon.co.uk>
Thu, 19 Jan 2023 00:04:31 +0000 (00:04 +0000)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Tue, 7 Mar 2023 17:04:30 +0000 (17:04 +0000)
commit032475127225e5949c021dcb1dfcc0ffec400157
tree7a38c417e416225ee9e0b6f1b4addb619f7ff2b1
parentb08d88e30f061d5d8ae080a453a078214d4b462a
hw/xen: Add emulated implementation of XenStore operations

Now that we have an internal implementation of XenStore, we can populate
the xenstore_backend_ops to allow PV backends to talk to it.

Watches can't be processed with immediate callbacks because that would
call back into XenBus code recursively. Defer them to a QEMUBH to be run
as appropriate from the main loop. We use a QEMUBH per XS handle, and it
walks all the watches (there shouldn't be many per handle) to fire any
which have pending events. We *could* have done it differently but this
allows us to use the same struct watch_event as we have for the guest
side, and keeps things relatively simple.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
hw/i386/kvm/xen_xenstore.c