Skip to content

Ring feature cleanup, advertise WATCHDEPTH feature bit#27

Merged
last-genius merged 7 commits into
xapi-project:mainfrom
last-genius:asv/features
Apr 7, 2026
Merged

Ring feature cleanup, advertise WATCHDEPTH feature bit#27
last-genius merged 7 commits into
xapi-project:mainfrom
last-genius:asv/features

Conversation

@last-genius
Copy link
Copy Markdown
Contributor

Adds new feature bits defined upstream, advertises one more feature we already implement (WATCHDEPTH), adds unit tests verifying ring feature advertisement, adds {GET,SET}_FEATURE commands without implementing them yet.

The only functional change is the new advertised feature bit.

@last-genius
Copy link
Copy Markdown
Contributor Author

last-genius commented Mar 20, 2026

The other new bit defined here (Error_indicator) is not advertised since oxenstored does not implement it: #26

Comment thread xenbus/xs_ring.ml Outdated
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>
Comment thread gnt/gnttab_stubs.c
assert (geteuid () != 0);
CAMLreturn (Val_unit);

struct xenstore_domain_interface *addr = calloc (1, 4096);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this memory freed? Does the abstract tag not come with a finaliser that would take care of this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not freed, this is only used in short-running unit tests where it's fine (hence the unsafe name of the function)

@last-genius last-genius merged commit 9d46ec0 into xapi-project:main Apr 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants