|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen staging] tools/libxc: Delete ENOSYS squashing in xc_domain_claim_pages()
commit 7672602df6c0f7a3d030f130a2372f1772d5ac4e
Author: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Mon Dec 15 18:09:33 2025 +0000
Commit: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Wed Dec 17 17:35:24 2025 +0000
tools/libxc: Delete ENOSYS squashing in xc_domain_claim_pages()
It's not acceptable to hide this from the caller; the effect of doing so is
to
break an atomicity expectation.
Only the caller can know what the appropriate safety action is in the case
that the claim hypercall isn't available. Ignoring it might be the right
thing to do, but xc_domain_claim_pages() cannot make this decision on behalf
of all callers.
Fixes: fc67e9dc0c1f ("xc: use XENMEM_claim_pages hypercall during guest
creation.")
Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
tools/libs/ctrl/xc_domain.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/tools/libs/ctrl/xc_domain.c b/tools/libs/ctrl/xc_domain.c
index 2ddc3f4f42..01c0669c88 100644
--- a/tools/libs/ctrl/xc_domain.c
+++ b/tools/libs/ctrl/xc_domain.c
@@ -1074,7 +1074,6 @@ int xc_domain_claim_pages(xc_interface *xch,
uint32_t domid,
unsigned long nr_pages)
{
- int err;
struct xen_memory_reservation reservation = {
.nr_extents = nr_pages,
.extent_order = 0,
@@ -1082,13 +1081,7 @@ int xc_domain_claim_pages(xc_interface *xch,
.domid = domid
};
- set_xen_guest_handle(reservation.extent_start, HYPERCALL_BUFFER_NULL);
-
- err = xc_memory_op(xch, XENMEM_claim_pages, &reservation,
sizeof(reservation));
- /* Ignore it if the hypervisor does not support the call. */
- if (err == -1 && errno == ENOSYS)
- err = errno = 0;
- return err;
+ return xc_memory_op(xch, XENMEM_claim_pages, &reservation,
sizeof(reservation));
}
int xc_domain_populate_physmap(xc_interface *xch,
--
generated by git-patchbot for /home/xen/git/xen.git#staging
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |