mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
libxc/libxl/python/xenstat/ocaml: Use new XEN_VERSION hypercall
We change the xen_version libxc code to use the new hypercall. Which of course means every user in the code base has to be changed over. It is important to note that the xc_version_op has a different return semantic than the previous one. It returns negative values on error (like the old one), but it also returns an positive value on success (unlike the old one). The positive value is the number of bytes copied in. Note that both Ocaml and xenstat use tabs instead of four spaces so they look quite odd. Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> Tested-by: Andrew Cooper <andrew.cooper3@citrix.com> [for the Ocaml stubs] Acked-by: George Dunlap <george.dunlap@eu.citrix.com> [xenctx bits] Acked-by: Wei Liu <wei.liu2@citrix.com>
This commit is contained in:
1 parent
2716d87537
commit
d275ec9ca8
14 files changed
+175
-146
No files matched your search
@@ -1204,34 +1204,40 @@ static PyObject *pyxc_xeninfo(XcObject *self)
|
||||
xen_capabilities_info_t xen_caps;
|
||||
xen_platform_parameters_t p_parms;
|
||||
xen_commandline_t xen_commandline;
|
||||
long xen_version;
|
||||
long xen_pagesize;
|
||||
xen_version_op_val_t xen_version;
|
||||
xen_version_op_val_t xen_pagesize;
|
||||
char str[128];
|
||||
|
||||
xen_version = xc_version(self->xc_handle, XENVER_version, NULL);
|
||||
|
||||
if ( xc_version(self->xc_handle, XENVER_extraversion, &xen_extra) != 0 )
|
||||
if ( xc_version(self->xc_handle, XEN_VERSION_version, &xen_version,
|
||||
sizeof(xen_version)) < 0 )
|
||||
return pyxc_error_to_exception(self->xc_handle);
|
||||
|
||||
if ( xc_version(self->xc_handle, XENVER_compile_info, &xen_cc) != 0 )
|
||||
if ( xc_version(self->xc_handle, XEN_VERSION_extraversion, &xen_extra,
|
||||
sizeof(xen_extra)) < 0 )
|
||||
return pyxc_error_to_exception(self->xc_handle);
|
||||
|
||||
if ( xc_version(self->xc_handle, XENVER_changeset, &xen_chgset) != 0 )
|
||||
memset(&xen_cc, 0, sizeof(xen_cc));
|
||||
|
||||
if ( xc_version(self->xc_handle, XEN_VERSION_changeset, &xen_chgset,
|
||||
sizeof(xen_chgset)) < 0 )
|
||||
return pyxc_error_to_exception(self->xc_handle);
|
||||
|
||||
if ( xc_version(self->xc_handle, XENVER_capabilities, &xen_caps) != 0 )
|
||||
if ( xc_version(self->xc_handle, XEN_VERSION_capabilities, &xen_caps,
|
||||
sizeof(xen_caps)) < 0 )
|
||||
return pyxc_error_to_exception(self->xc_handle);
|
||||
|
||||
if ( xc_version(self->xc_handle, XENVER_platform_parameters, &p_parms) != 0 )
|
||||
if ( xc_version(self->xc_handle, XEN_VERSION_platform_parameters,
|
||||
&p_parms, sizeof(p_parms)) < 0 )
|
||||
return pyxc_error_to_exception(self->xc_handle);
|
||||
|
||||
if ( xc_version(self->xc_handle, XENVER_commandline, &xen_commandline) != 0 )
|
||||
if ( xc_version(self->xc_handle, XEN_VERSION_commandline,
|
||||
&xen_commandline, sizeof(xen_commandline)) < 0 )
|
||||
return pyxc_error_to_exception(self->xc_handle);
|
||||
|
||||
snprintf(str, sizeof(str), "virt_start=0x%"PRI_xen_ulong, p_parms.virt_start);
|
||||
|
||||
xen_pagesize = xc_version(self->xc_handle, XENVER_pagesize, NULL);
|
||||
if (xen_pagesize < 0 )
|
||||
if ( xc_version(self->xc_handle, XEN_VERSION_pagesize, &xen_pagesize,
|
||||
sizeof(xen_pagesize)) < 0 )
|
||||
return pyxc_error_to_exception(self->xc_handle);
|
||||
|
||||
return Py_BuildValue("{s:i,s:i,s:s,s:s,s:i,s:s,s:s,s:s,s:s,s:s,s:s,s:s}",
|
||||
|
||||