mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
tools/python: fix python libxc bindings to pass a max grant version
Such max version should be provided by the caller, otherwise the
bindings will default to specifying a max version of 2, which is
inline with the current defaults in the hypervisor.
Fixes: 7379f9e10a ('gnttab: allow setting max version per-domain')
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <iwj@xenproject.org>
Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Release-Acked-by: Ian Jackson <iwj@xenproject.org>
This commit is contained in:
1 parent
27ece0dd52
commit
1cffc48f1e
1 file changed
+6
-4
@@ -116,7 +116,7 @@ static PyObject *pyxc_domain_create(XcObject *self,
|
||||
PyObject *args,
|
||||
PyObject *kwds)
|
||||
{
|
||||
uint32_t dom = 0, target = 0;
|
||||
uint32_t dom = 0, target = 0, max_grant_version = 2;
|
||||
int ret;
|
||||
size_t i;
|
||||
PyObject *pyhandle = NULL;
|
||||
@@ -132,12 +132,13 @@ static PyObject *pyxc_domain_create(XcObject *self,
|
||||
};
|
||||
|
||||
static char *kwd_list[] = { "domid", "ssidref", "handle", "flags",
|
||||
"target", "max_vcpus", NULL };
|
||||
"target", "max_vcpus", "max_grant_version",
|
||||
NULL };
|
||||
|
||||
if ( !PyArg_ParseTupleAndKeywords(args, kwds, "|iiOiii", kwd_list,
|
||||
if ( !PyArg_ParseTupleAndKeywords(args, kwds, "|iiOiiii", kwd_list,
|
||||
&dom, &config.ssidref, &pyhandle,
|
||||
&config.flags, &target,
|
||||
&config.max_vcpus) )
|
||||
&config.max_vcpus, &max_grant_version) )
|
||||
return NULL;
|
||||
if ( pyhandle != NULL )
|
||||
{
|
||||
@@ -162,6 +163,7 @@ static PyObject *pyxc_domain_create(XcObject *self,
|
||||
#else
|
||||
#error Architecture not supported
|
||||
#endif
|
||||
config.grant_opts = XEN_DOMCTL_GRANT_version(max_grant_version);
|
||||
|
||||
if ( (ret = xc_domain_create(self->xc_handle, &dom, &config)) < 0 )
|
||||
return pyxc_error_to_exception(self->xc_handle);
|
||||
|
||||