[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [XEN PATCH] mismatch between pyxc_methods flags and PyObject definitions


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "YOUNG, MICHAEL A." <m.a.young@xxxxxxxxxxxx>
  • Date: Tue, 17 Mar 2020 23:01:43 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=durham.ac.uk; dmarc=pass action=none header.from=durham.ac.uk; dkim=pass header.d=durham.ac.uk; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HdFL3rKVi8b52olVcwND3fEUb4BObevvdlewmOaU+/s=; b=iIthIeGa8JZqNkS7kEE9C/WtUL1Tj3/yyE50LdpiSjQlb6cIV3yGyflwQdM8QJfC2z2OsyDjrDzz6bMWWnKyqEptUvRZBWSQVvHXrGQHg++GpBWgo7rOtJBmQNV3un6aNV5SVa5bD2b2Ipx0/wQQkooSR6tHbzq+Ms/4enlRhN2UP4T0X6USrKCVxHN5DTJkchdOk/Ac/nb8THgHw6IOlsQT/IE6I3m9OtoOgOr+Wyx7T4P+1f148/6OtFxvW2BXjQ6nw1mwXjUSyGag8iDlkLRskTaoFm8xdt4+m9nXGcza5GhqLZG4SwDgPoGs2nAf4++vEvExamZaTeJbfYnNRQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EmSoWcnY00BnvTpQog8r2+o1S5TruneM1wwA/16niz/NVESfPWYsBgTv9WYHNGLtOX3ScuH1M6efSF8PjYozHMoCeZvipeOVhTmBgSVrK4CUQCqQp8lFGS8lG3e+wdFu4An8JZxQIimYnVkLDyrxkcZpSSk+xgL7BjbrfWUfYXFIHFLw+dwDQCP77J+B16A6tVkuoHci+AkCor07U77v5n4Zql825JLZ+BgzXp9bsQoGAHJp4H6mm64wFY60o17uHFZlYwuVxJHqelu3tm78DgilGbD+o4XQXOwKLFl+aNiexVjlQ898rZgV4c36IQCVzMUdyOdfFo5Jw9T+HZGNCg==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=m.a.young@xxxxxxxxxxxx;
  • Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>, Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, "YOUNG, MICHAEL A." <m.a.young@xxxxxxxxxxxx>
  • Delivery-date: Tue, 17 Mar 2020 23:02:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHV/LAGbNHF25I8tkGIuIUvn+oPgw==
  • Thread-topic: [XEN PATCH] mismatch between pyxc_methods flags and PyObject definitions

pygrub in xen-4.13.0 with python 3.8.2 fails with the error

Traceback (most recent call last):
  File "/usr/libexec/xen/bin/pygrub", line 21, in <module>
    import xen.lowlevel.xc
SystemError: bad call flags

This patch fixes mismatches in tools/python/xen/lowlevel/xc/xc.c
between the flag bits defined in pyxc_methods and the parameters passed
to the corresponding PyObject definitions.

With this patch applied pygrub works as expected.

Signed-off-by: Michael Young <m.a.young@xxxxxxxxxxxx>
---
 tools/python/xen/lowlevel/xc/xc.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tools/python/xen/lowlevel/xc/xc.c 
b/tools/python/xen/lowlevel/xc/xc.c
index ac0e26a742..8fde5f311f 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -2028,7 +2028,7 @@ static PyMethodDef pyxc_methods[] = {
 
     { "gnttab_hvm_seed",
       (PyCFunction)pyxc_gnttab_hvm_seed,
-      METH_KEYWORDS, "\n"
+      METH_VARARGS | METH_KEYWORDS, "\n"
       "Initialise HVM guest grant table.\n"
       " dom     [int]:      Identifier of domain to build into.\n"
       " console_gmfn [int]: \n"
@@ -2097,7 +2097,7 @@ static PyMethodDef pyxc_methods[] = {
 
     { "sched_credit_domain_set",
       (PyCFunction)pyxc_sched_credit_domain_set,
-      METH_KEYWORDS, "\n"
+      METH_VARARGS | METH_KEYWORDS, "\n"
       "Set the scheduling parameters for a domain when running with the\n"
       "SMP credit scheduler.\n"
       " domid     [int]:   domain id to set\n"
@@ -2115,7 +2115,7 @@ static PyMethodDef pyxc_methods[] = {
 
     { "sched_credit2_domain_set",
       (PyCFunction)pyxc_sched_credit2_domain_set,
-      METH_KEYWORDS, "\n"
+      METH_VARARGS | METH_KEYWORDS, "\n"
       "Set the scheduling parameters for a domain when running with the\n"
       "SMP credit2 scheduler.\n"
       " domid     [int]:   domain id to set\n"
@@ -2393,21 +2393,21 @@ static PyMethodDef pyxc_methods[] = {
 
     { "flask_context_to_sid",
       (PyCFunction)pyflask_context_to_sid,
-      METH_KEYWORDS, "\n"
+      METH_VARARGS | METH_KEYWORDS, "\n"
       "Convert a context string to a dynamic SID.\n"
       " context [str]: String specifying context to be converted\n"
       "Returns: [int]: Numeric SID on success; -1 on error.\n" },
 
     { "flask_sid_to_context",
       (PyCFunction)pyflask_sid_to_context,
-      METH_KEYWORDS, "\n"
+      METH_VARARGS | METH_KEYWORDS, "\n"
       "Convert a dynamic SID to context string.\n"
       " context [int]: SID to be converted\n"
       "Returns: [str]: Numeric SID on success; -1 on error.\n" },
 
     { "flask_load",
       (PyCFunction)pyflask_load,
-      METH_KEYWORDS, "\n"
+      METH_VARARGS | METH_KEYWORDS, "\n"
       "Loads a policy into the hypervisor.\n"
       " policy [str]: policy to be load\n"
       "Returns: [int]: 0 on success; -1 on failure.\n" }, 
@@ -2420,14 +2420,14 @@ static PyMethodDef pyxc_methods[] = {
 
     { "flask_setenforce",
       (PyCFunction)pyflask_setenforce,
-      METH_KEYWORDS, "\n"
+      METH_VARARGS | METH_KEYWORDS, "\n"
       "Modifies the current mode for the Flask XSM module.\n"
       " mode [int]: mode to change to\n"
       "Returns: [int]: 0 on success; -1 on failure.\n" }, 
 
     { "flask_access",
       (PyCFunction)pyflask_access,
-      METH_KEYWORDS, "\n"
+      METH_VARARGS | METH_KEYWORDS, "\n"
       "Returns whether a source context has access to target context based on \
        class and permissions requested.\n"
       " scon [str]: source context\n"
-- 
2.21.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.