Skip to content

Add missing NUMA stub function#16

Open
edwintorok wants to merge 1 commit intomasterfrom
private/edvint/fix-build
Open

Add missing NUMA stub function#16
edwintorok wants to merge 1 commit intomasterfrom
private/edvint/fix-build

Conversation

@edwintorok
Copy link
Member

If this is missing and you have a new enough Xen with the headers that defines this NUMA stub, then linking the XAPI unit tests would fail with:

File "ocaml/xenopsd/xc/dune", line 83, characters 7-21:
83 |  (name xenops_xc_main)
            ^^^^^^^^^^^^^^
/usr/bin/ld: ocaml/libs/xenctrl-ext/libxenctrl_ext_stubs.a(xenctrlext_stubs.o): in function `stub_xc_domain_numa_get_node_pages_wrapper':
/home/edvint-670/git/xen-api/_build/default/ocaml/libs/xenctrl-ext/xenctrlext_stubs.c:762:(.text+0x1d61): undefined reference to `stub_xc_domain_numa_get_node_pages'

The implementation of that function would be in xenctrl_stubs.c, but the mock xenctrl here replaces that (the headers come from the real xenctrl, and declare that this function is implemented).

The way this stub is implemented in xenctrlext in xenopsd is unusual, because it directly calls another C stub implemented in another library. None of the other stubs work that way: they usually implement the functionality themselves.

If this is missing *and* you have a new enough Xen with the headers
that defines this NUMA stub,  then linking the XAPI unit tests would
fail with:
```
File "ocaml/xenopsd/xc/dune", line 83, characters 7-21:
83 |  (name xenops_xc_main)
            ^^^^^^^^^^^^^^
/usr/bin/ld: ocaml/libs/xenctrl-ext/libxenctrl_ext_stubs.a(xenctrlext_stubs.o): in function `stub_xc_domain_numa_get_node_pages_wrapper':
/home/edvint-670/git/xen-api/_build/default/ocaml/libs/xenctrl-ext/xenctrlext_stubs.c:762:(.text+0x1d61): undefined reference to `stub_xc_domain_numa_get_node_pages'
```

The implementation of that function would be in xenctrl_stubs.c, but the
mock xenctrl here replaces that (the headers come from the real xenctrl,
and declare that this function is implemented).

The way this stub is implemented in xenctrlext in xenopsd is unusual,
because it directly calls another C stub implemented in another library.
None of the other stubs work that way: they usually implement the
functionality themselves.

Signed-off-by: Edwin Török <edwin.torok@citrix.com>
@edwintorok
Copy link
Member Author

edwintorok commented Mar 13, 2026

Previously this worked because I had an old Xen RPM installed (which didn't declare this function in its headers). But now I have a new Xen RPM installed on another dev VM, and there XAPI would fail to build its unit tests. This PR fixes it.

@edwintorok edwintorok requested a review from mg12 March 13, 2026 17:30
CAMLprim value stub_xc_domain_numa_get_node_pages(value v1, value v2)
{
CAMLparam2(v1, v2);
caml_failwith(__func__);
Copy link
Contributor

Choose a reason for hiding this comment

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

This function breaks the pattern established by the other functions above. Should they use CAMLnoreturn as well and use caml_failwith(__func__)?

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.

2 participants