extends xm info with xen version and various others information.

exports version hypercall to userspace

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
This commit is contained in:
vh249@arcadians.cl.cam.ac.uk committed 2005-08-31 10:39:53 +00:00
1 parent 186d3d4f1d
commit 251e6d181b
7 files changed
+100 -2

No files matched your search

+40
View File
@@ -707,6 +707,39 @@ static PyObject *pyxc_physinfo(PyObject *self,
"cpu_khz", info.cpu_khz);
}
static PyObject *pyxc_xeninfo(PyObject *self,
PyObject *args,
PyObject *kwds)
{
XcObject *xc = (XcObject *)self;
xen_extraversion_t xen_extra;
xen_compile_info_t xen_cc;
xen_changeset_info_t xen_chgset;
long xen_version;
xen_version = xc_version(xc->xc_handle, XENVER_version, NULL);
if ( xc_version(xc->xc_handle, XENVER_extraversion, &xen_extra) != 0 )
return PyErr_SetFromErrno(xc_error);
if ( xc_version(xc->xc_handle, XENVER_compile_info, &xen_cc) != 0 )
return PyErr_SetFromErrno(xc_error);
if ( xc_version(xc->xc_handle, XENVER_changeset, &xen_chgset) != 0 )
return PyErr_SetFromErrno(xc_error);
return Py_BuildValue("{s:i,s:i,s:s,s:s,s:s,s:s,s:s,s:s}",
"xen_major", xen_version >> 16,
"xen_minor", (xen_version & 0xffff),
"xen_extra", xen_extra,
"xen_changeset", xen_chgset,
"cc_compiler", xen_cc.compiler,
"cc_compile_by", xen_cc.compile_by,
"cc_compile_domain", xen_cc.compile_domain,
"cc_compile_date", xen_cc.compile_date);
}
static PyObject *pyxc_sedf_domain_set(PyObject *self,
PyObject *args,
PyObject *kwds)
@@ -1089,6 +1122,13 @@ static PyMethodDef pyxc_methods[] = {
"Returns [dict]: information about the hardware"
" [None]: on failure.\n" },
{ "xeninfo",
(PyCFunction)pyxc_xeninfo,
METH_VARARGS, "\n"
"Get information about the Xen host\n"
"Returns [dict]: information about Xen"
" [None]: on failure.\n" },
{ "shadow_control",
(PyCFunction)pyxc_shadow_control,
METH_VARARGS | METH_KEYWORDS, "\n"
+11 -2
View File
@@ -46,7 +46,7 @@ class XendNode:
return self.xc.bvtsched_global_get()
def info(self):
return self.nodeinfo() + self.physinfo()
return self.nodeinfo() + self.physinfo() + self.xeninfo()
def nodeinfo(self):
(sys, host, rel, ver, mch) = os.uname()
@@ -65,7 +65,16 @@ class XendNode:
['free_memory', pinfo['free_pages']/256]]
return info
def xeninfo(self):
xinfo = self.xc.xeninfo()
return [['xen_major', xinfo['xen_major']],
['xen_minor', xinfo['xen_minor']],
['xen_extra', xinfo['xen_extra']],
['xen_changeset', xinfo['xen_changeset']],
['cc_compiler', xinfo['cc_compiler']],
['cc_compile_by', xinfo['cc_compile_by']],
['cc_compile_domain', xinfo['cc_compile_domain']],
['cc_compile_date', xinfo['cc_compile_date']]]
def instance():
global inst
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.