tools/libs/store: add support to use watches with a depth parameter

Add a new xs_watch_depth() function to libxenstore allowing to limit
the scope of a Xenstore watch. It can be used only in case Xenstore is
supporting the XENSTORE_SERVER_FEATURE_WATCHDEPTH feature.

For convenience add a xs_watch_try_depth() wrapper, which will call
xs_watch_depth() if supported and xs_watch() otherwise.

Cache the supported features of Xenstore in order not having to get
them from Xenstore for each call of one of the new functions.

While touching xs.c fix a whitespace issue there.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
This commit is contained in:
Juergen Gross authored and Jan Beulich committed 2026-04-22 08:57:44 +02:00
1 parent cb8972017c
commit 27d908e74e
5 files changed
+116 -12

No files matched your search

+6
View File
@@ -740,6 +740,12 @@ Xenstore is capable to reconnect to a guest.
Xenstore will present an error value in case it disconnects due to an error
condition.
=item B<0x00000004>
Xenstore supports to set watches with a limited depth (depth 0 matches
only the watched node, depth 1 matches the node and its direct children,
etc.).
=back
The features supported by the running Xenstore instance can be retrieved
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.