libxc: split xc_logdirty_control() from xc_shadow_control()

For log-dirty operations a 64-bit field is being truncated to become an
"int" return value. Seeing the large number of arguments the present
function takes, reduce its set of parameters to that needed for all
operations not involving the log-dirty bitmap, while introducing a new
wrapper for the log-dirty bitmap operations. This new function in turn
doesn't need an "mb" parameter, but has a 64-bit return type. (Using the
return value in favor of a pointer-type parameter is left as is, to
disturb callers as little as possible.)

While altering xc_shadow_control() anyway, also adjust the types of the
last two of the remaining parameters.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Christian Lindig <christian.lindig@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Acked-by: Ian Jackson <iwj@xenproject.org>
This commit is contained in:
Jan Beulich committed 2021-09-03 15:09:48 +02:00
1 parent 96607a8e68
commit 2107cc76db
8 files changed
+66 -42

No files matched your search

+3 -4
View File
@@ -1192,8 +1192,7 @@ static PyObject *pyxc_shadow_control(PyObject *self,
&dom, &op) )
return NULL;
if ( xc_shadow_control(xc->xc_handle, dom, op, NULL, 0, NULL, 0, NULL)
< 0 )
if ( xc_shadow_control(xc->xc_handle, dom, op, NULL, 0) < 0 )
return pyxc_error_to_exception(xc->xc_handle);
Py_INCREF(zero);
@@ -1208,7 +1207,7 @@ static PyObject *pyxc_shadow_mem_control(PyObject *self,
int op;
uint32_t dom;
int mbarg = -1;
unsigned long mb;
unsigned int mb;
static char *kwd_list[] = { "dom", "mb", NULL };
@@ -1223,7 +1222,7 @@ static PyObject *pyxc_shadow_mem_control(PyObject *self,
mb = mbarg;
op = XEN_DOMCTL_SHADOW_OP_SET_ALLOCATION;
}
if ( xc_shadow_control(xc->xc_handle, dom, op, NULL, 0, &mb, 0, NULL) < 0 )
if ( xc_shadow_control(xc->xc_handle, dom, op, &mb, 0) < 0 )
return pyxc_error_to_exception(xc->xc_handle);
mbarg = mb;
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.