|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [RFC PATCH v1 03/25] hw/xen: Implement XenStore watches
On 02/03/2023 15:34, David Woodhouse wrote: From: David Woodhouse <dwmw@xxxxxxxxxxxx> 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@xxxxxxxxxxxx> --- hw/i386/kvm/xenstore_impl.c | 253 +++++++++++++++++++++++++++++++++--- tests/unit/test-xs-node.c | 85 ++++++++++++ 2 files changed, 323 insertions(+), 15 deletions(-) Reviewed-by: Paul Durrant <paul@xxxxxxx> ... with one suggestion... [snip] I think you could stash a tail pointer here... ... to avoid the duplicate hash lookup here.
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |