tools/xenstore: fire watches only when removing a specific node
authorJuergen Gross <jgross@suse.com>
Tue, 15 Dec 2020 12:34:50 +0000 (13:34 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 15 Dec 2020 12:34:50 +0000 (13:34 +0100)
commit1e5815697f941d57fbdc81d0e973a00692adfad3
tree1d7b5977d7b4617551d72a067918000fbcb62c15
parent297f209636d89ca5bfe2b91accfdf0dc1b922779
tools/xenstore: fire watches only when removing a specific node

Instead of firing all watches for removing a subtree in one go, do so
only when the related node is being removed.

The watches for the top-most node being removed include all watches
including that node, while watches for nodes below that are only fired
if they are matching exactly. This avoids firing any watch more than
once when removing a subtree.

This is part of XSA-115.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Paul Durrant <paul@xen.org>
tools/xenstore/xenstored_core.c
tools/xenstore/xenstored_watch.c
tools/xenstore/xenstored_watch.h