]> www.infradead.org Git - users/dwmw2/qemu.git/commit
hw/xen: Implement XenStore watches
authorDavid Woodhouse <dwmw@amazon.co.uk>
Sun, 22 Jan 2023 18:38:23 +0000 (18:38 +0000)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Wed, 1 Feb 2023 14:10:45 +0000 (14:10 +0000)
commit11f466ace460f5e3d5cbea2c8d63e434108a8117
tree735661bd09e071d73ec797d2c988ffbaa8af70c0
parent8171ba328fcf3f24f9ff54f0a2325a17f4a71e2b
hw/xen: Implement XenStore watches

Starts out fairly simple: a hash table of watches based on the path.

Except there can be multiple watches on the same path, so the watch ends
up being a simple linked list, and the head of that list is in the hash
table. Which makes removal a bit of a PITA but it's not so bad; we just
special-case "I had to remove the head of the list and now I have to
replace it in / remove it from the hash table". And if we don't remove
the head, it's a simple linked-list operation.

We do need to fire watches on *deleted* nodes, so instead of just a simple
xs_node_unref() on the topmost victim, we need to recurse down and fire
watches on them all.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
hw/i386/kvm/xenstore_impl.c
tests/unit/test-xs-node.c