Ring feature cleanup, advertise WATCHDEPTH feature bit#27
Merged
Conversation
Contributor
Author
|
The other new bit defined here ( |
lindig
approved these changes
Mar 20, 2026
These were defined upstream in https://xenbits.xen.org/docs/unstable/misc/xenstore-ring.txt Since only a single feature bit existed before, this requires refactoring the code to properly construct a bitmap from the set of features and the other way around. No functional change - only the Reconnected bit is still advertised in xb.ml Also add an .mli file to make sure internal functions are not used outside of the module. Signed-off-by: Andrii Sultanov <andriy.sultanov@vates.tech>
The new 'depth' parameter for watches has been implemented in e60981d (and iterated on further) It is also verified in the unit tests (test_watches_depth, test_special_watches_depth). Since a pending upstream patch series (https://lore.kernel.org/xen-devel/20260313074751.2904215-3-jgross@suse.com/) requires the feature bit to be available for the depth feature to work, advertise it in the xenstore ring. Signed-off-by: Andrii Sultanov <andriy.sultanov@vates.tech>
These were added upstream in https://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=0fd49cc7dbdfc13faced294ccc970e7a57d08907 and implemented in https://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=d239b81a171676c8473e203ff06313de6fd7d21a (GET,SET_QUOTA command implementations are still pending on the mailing list, so they are not defined here) No functional change, these commands are still not handled and will error out. SET_PERMS doesn't have side-effects (can't be the reason for a failed transaction), since it only has effect before the domain is INTRODUCE'd and is rejected afterwards. Signed-off-by: Andrii Sultanov <andriy.sultanov@vates.tech>
This allows some carefully set up unit tests to temporarily enable behaviour that otherwise relies on xen being available. Signed-off-by: Andrii Sultanov <andriy.sultanov@vates.tech>
To test advertised features, we need to have an actual xenstore ring. So allocate a page to fake the ring through unsafe_stub, without having to rely on xen. Signed-off-by: Andrii Sultanov <andriy.sultanov@vates.tech>
Signed-off-by: Andrii Sultanov <andriy.sultanov@vates.tech>
These currently verify that the calls are not implemented and return ENOSYS Signed-off-by: Andrii Sultanov <andriy.sultanov@vates.tech>
722e018 to
63ba135
Compare
lindig
reviewed
Mar 31, 2026
| assert (geteuid () != 0); | ||
| CAMLreturn (Val_unit); | ||
|
|
||
| struct xenstore_domain_interface *addr = calloc (1, 4096); |
Contributor
There was a problem hiding this comment.
How is this memory freed? Does the abstract tag not come with a finaliser that would take care of this?
Contributor
Author
There was a problem hiding this comment.
it's not freed, this is only used in short-running unit tests where it's fine (hence the unsafe name of the function)
psafont
approved these changes
Apr 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds new feature bits defined upstream, advertises one more feature we already implement (WATCHDEPTH), adds unit tests verifying ring feature advertisement, adds
{GET,SET}_FEATUREcommands without implementing them yet.The only functional change is the new advertised feature bit.