From patchwork Tue Mar 17 23:01:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Young X-Patchwork-Id: 11444193 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 72F75913 for ; Tue, 17 Mar 2020 23:03:40 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4E66A206EC for ; Tue, 17 Mar 2020 23:03:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=durhamuniversity.onmicrosoft.com header.i=@durhamuniversity.onmicrosoft.com header.b="XobC5wVN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4E66A206EC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=durham.ac.uk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jELDZ-0000pR-JP; Tue, 17 Mar 2020 23:01:49 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jELDX-0000pM-U9 for xen-devel@lists.xenproject.org; Tue, 17 Mar 2020 23:01:48 +0000 X-Inumbo-ID: 45c1d800-68a3-11ea-92cf-bc764e2007e4 Received: from GBR01-CWL-obe.outbound.protection.outlook.com (unknown [40.107.11.103]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 45c1d800-68a3-11ea-92cf-bc764e2007e4; Tue, 17 Mar 2020 23:01:45 +0000 (UTC) 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== 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-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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=durhamuniversity.onmicrosoft.com; s=selector2-durhamuniversity-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HdFL3rKVi8b52olVcwND3fEUb4BObevvdlewmOaU+/s=; b=XobC5wVNBctmi0mTaFy1y3J8tTmkfKMV4nOBo3gAv/1nOzDdahoeg4ZYdZSS6zxvm7i1FiUNWWk8FbFHp2Phv2y+QCIK3NwdgSgUcJqizrvw2mbzkG6Vi64jExaIKSQ/Vv2exNUvLaK4DgQvGtuW2yMFHvByx9KaG0eip9TUdHo= Received: from CWLP265MB1218.GBRP265.PROD.OUTLOOK.COM (20.176.36.147) by CWLP265MB0740.GBRP265.PROD.OUTLOOK.COM (10.166.26.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.17; Tue, 17 Mar 2020 23:01:43 +0000 Received: from CWLP265MB1218.GBRP265.PROD.OUTLOOK.COM ([fe80::1045:ca69:5894:1e84]) by CWLP265MB1218.GBRP265.PROD.OUTLOOK.COM ([fe80::1045:ca69:5894:1e84%5]) with mapi id 15.20.2814.021; Tue, 17 Mar 2020 23:01:43 +0000 Received: from austen3.home (2a00:23c4:921a:2100:1097:224c:243b:f186) by LO2P265CA0413.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a0::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.19 via Frontend Transport; Tue, 17 Mar 2020 23:01:43 +0000 From: "YOUNG, MICHAEL A." To: "xen-devel@lists.xenproject.org" Thread-Topic: [XEN PATCH] mismatch between pyxc_methods flags and PyObject definitions Thread-Index: AQHV/LAGbNHF25I8tkGIuIUvn+oPgw== Date: Tue, 17 Mar 2020 23:01:43 +0000 Message-ID: <27a883ea723d5d123cb3a10d2a6092ad54a6171e.1584485918.git.m.a.young@durham.ac.uk> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [2a00:23c4:921a:2100:1097:224c:243b:f186] x-mailer: git-send-email 2.21.1 x-clientproxiedby: LO2P265CA0413.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a0::17) To CWLP265MB1218.GBRP265.PROD.OUTLOOK.COM (2603:10a6:401:2e::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=m.a.young@durham.ac.uk; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f056395c-d865-4143-dc48-08d7cac72935 x-ms-traffictypediagnostic: CWLP265MB0740: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-forefront-prvs: 0345CFD558 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6029001)(4636009)(366004)(39860400002)(376002)(346002)(396003)(136003)(199004)(2616005)(6916009)(81156014)(81166006)(6512007)(54906003)(8676002)(4326008)(2906002)(316002)(6506007)(71200400001)(786003)(52116002)(16526019)(86362001)(186003)(64756008)(66446008)(66556008)(66476007)(478600001)(66946007)(5660300002)(36756003)(6486002)(8886007)(8936002); DIR:OUT; SFP:1102; SCL:1; SRVR:CWLP265MB0740; H:CWLP265MB1218.GBRP265.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; received-spf: None (protection.outlook.com: durham.ac.uk does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 1cH6Nrw3CSHYSo9ShYb+mxRf3QBwD8Mcf4b4qEfe2twAGcynqeTWFV04QmiRuPkutGFBdl3U/Xt6NKu3F3WdGDaiIdFAs4hN9oO3adh3Lvt8YDlRnCAPh9GJRC4JePJgCQ2QceUJQi1/TMzcdflcEazpf5aUs1LVdo0Hs1bOdGYfbuy6klxf03KbiLx46mI07Z2S28JdUUS9jf8sF2/bUDqc8Bwyb1gleCCIW74530SiafS2wiytKIwTBteQW7WNMxrxMUvpKv7Hgh7ix32B3s9LGJXRQ05fuLf5bbbgYFi3+pN89hmBSZ9W8Ra9OOUOm6oHX9DLpbezfQOzO4uYkAx/wKtYGZY9Of+kxXrNE05IDJQ2LWx0oR050k7nSKA8EYAJfIPJEmTk5x0cU9y1MC6UdL7LjArPSM+Kbm6zJWoakE5DcY3g4TAtXoua7rOd x-ms-exchange-antispam-messagedata: WEHrhQKth+BPxuQG63nteACrN4o3civ+2k69MTqz10p1UElkaOIhFGS5P4oXfPCyXbQjQhe0kj0PsETATegQwqPt5tJGhqAIwun4gHnkqfHVfxdsHtJFsYS1eN08hFGv9OASjZhKn0dX/gX7aQH1cw3eKl/4/Ri3m0J0skDzeZ59E+bC05hED78soAc1pjja32edGlLK/RtC5vPgZjnW/A== MIME-Version: 1.0 X-OriginatorOrg: durham.ac.uk X-MS-Exchange-CrossTenant-Network-Message-Id: f056395c-d865-4143-dc48-08d7cac72935 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Mar 2020 23:01:43.6981 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 7250d88b-4b68-4529-be44-d59a2d8a6f94 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: XwR+i/TsXEqxpAkKwurNO1eOiHcodNR4lcBv1kOwmpZ5Jgvj3dU8VnS3P7v45mgW1z4B5b95VPMJEvbPSh1lZw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CWLP265MB0740 Subject: [Xen-devel] [XEN PATCH] mismatch between pyxc_methods flags and PyObject definitions X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson , =?iso-8859-1?q?Marek_Marczykows?= =?iso-8859-1?q?ki-G=F3recki?= , Wei Liu , "YOUNG, MICHAEL A." Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" 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 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 Reviewed-by: Wei Liu Acked-by: Marek Marczykowski-Górecki --- 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"