libxc: wrappers for XENMEM {increase,decrease}_reservation and populate_physmap

Currently the wrappers for these hypercalls swallow partial success
and return failure to the caller.

In order to use these functions more widely instead of open-coding
uses of XENMEM_* and xc_memory_op add variants which return the actual
hypercall result.

Therefore add the following functions:
  xc_domain_increase_reservation
  xc_domain_decrease_reservation
  xc_domain_populate_physmap
and implement the existing semantics using these new functions as
  xc_domain_increase_reservation_exact
  xc_domain_decrease_reservation_exact
  xc_domain_populate_physmap_exact
replacing the existing xc_domain_memory_* functions.

Use these new functions to replace all open coded uses of
XENMEM_increase_reservation, XENMEM_decrease_reservation and
XENMEM_populate_physmap.

Also rename xc_domain_memory_*_pod_target to xc_domain_*_pod_target
for consistency.

Temporarily add a compatibility macro for
xc_domain_memory_populate_physmap to allow time for qemu to catch up.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
This commit is contained in:
Ian Campbell committed 2010-10-18 16:54:42 +01:00
1 parent f5c808b428
commit 2674a29698
11 files changed
+189 -137

No files matched your search

+2 -2
View File
@@ -1635,8 +1635,8 @@ static PyObject *pyxc_domain_set_target_mem(XcObject *self, PyObject *args)
mem_pages = mem_kb / 4;
if (xc_domain_memory_set_pod_target(self->xc_handle, dom, mem_pages,
NULL, NULL, NULL) != 0)
if (xc_domain_set_pod_target(self->xc_handle, dom, mem_pages,
NULL, NULL, NULL) != 0)
return pyxc_error_to_exception(self->xc_handle);
Py_INCREF(zero);
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.