mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
libxc: add xc_hvm_param_get/set() to get/set 64-bit values
HVMOP_get_param and HVMOP_set_param take a uint32_t for the parameter index and a uint64_t for the value. So add xc_hvm_param_get() and xc_hvm_param_set() that take the same types. The existing xc_get_hvm_param() and xc_set_hvm_param() are retained for compatibility but are deprecated. Signed-off-by: David Vrabel <david.vrabel@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> [ ijc -- dropped one hunk against xen-access.c which didn't apply due to intervening changes ]
This commit is contained in:
1 parent
18b2061a13
commit
0a9daad380
12 files changed
+102
-92
No files matched your search
@@ -546,27 +546,27 @@ static PyObject *pyxc_linux_build(XcObject *self,
|
||||
return pyxc_error_to_exception(self->xc_handle);
|
||||
}
|
||||
|
||||
static PyObject *pyxc_get_hvm_param(XcObject *self,
|
||||
static PyObject *pyxc_hvm_param_get(XcObject *self,
|
||||
PyObject *args,
|
||||
PyObject *kwds)
|
||||
{
|
||||
uint32_t dom;
|
||||
int param;
|
||||
unsigned long value;
|
||||
uint64_t value;
|
||||
|
||||
static char *kwd_list[] = { "domid", "param", NULL };
|
||||
if ( !PyArg_ParseTupleAndKeywords(args, kwds, "ii", kwd_list,
|
||||
&dom, ¶m) )
|
||||
return NULL;
|
||||
|
||||
if ( xc_get_hvm_param(self->xc_handle, dom, param, &value) != 0 )
|
||||
if ( xc_hvm_param_get(self->xc_handle, dom, param, &value) != 0 )
|
||||
return pyxc_error_to_exception(self->xc_handle);
|
||||
|
||||
return PyLong_FromUnsignedLong(value);
|
||||
return PyLong_FromUnsignedLongLong(value);
|
||||
|
||||
}
|
||||
|
||||
static PyObject *pyxc_set_hvm_param(XcObject *self,
|
||||
static PyObject *pyxc_hvm_param_set(XcObject *self,
|
||||
PyObject *args,
|
||||
PyObject *kwds)
|
||||
{
|
||||
@@ -579,7 +579,7 @@ static PyObject *pyxc_set_hvm_param(XcObject *self,
|
||||
&dom, ¶m, &value) )
|
||||
return NULL;
|
||||
|
||||
if ( xc_set_hvm_param(self->xc_handle, dom, param, value) != 0 )
|
||||
if ( xc_hvm_param_set(self->xc_handle, dom, param, value) != 0 )
|
||||
return pyxc_error_to_exception(self->xc_handle);
|
||||
|
||||
Py_INCREF(zero);
|
||||
@@ -2482,7 +2482,7 @@ static PyMethodDef pyxc_methods[] = {
|
||||
"Returns: None on sucess. Raises exception on error.\n" },
|
||||
|
||||
{ "hvm_get_param",
|
||||
(PyCFunction)pyxc_get_hvm_param,
|
||||
(PyCFunction)pyxc_hvm_param_get,
|
||||
METH_VARARGS | METH_KEYWORDS, "\n"
|
||||
"get a parameter of HVM guest OS.\n"
|
||||
" dom [int]: Identifier of domain to build into.\n"
|
||||
@@ -2490,7 +2490,7 @@ static PyMethodDef pyxc_methods[] = {
|
||||
"Returns: [long] value of the param.\n" },
|
||||
|
||||
{ "hvm_set_param",
|
||||
(PyCFunction)pyxc_set_hvm_param,
|
||||
(PyCFunction)pyxc_hvm_param_set,
|
||||
METH_VARARGS | METH_KEYWORDS, "\n"
|
||||
"set a parameter of HVM guest OS.\n"
|
||||
" dom [int]: Identifier of domain to build into.\n"
|
||||
|
||||