From nobody Sat May 18 20:15:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1678803364; cv=none; d=zohomail.com; s=zohoarc; b=KbmA3IwGUo3WlLoljheQsfhiuSvrSEPbJKcE6+5KpsUeHaBF3k2jNW5v/+NY7/7usU3o+5HUvqZfIPmUgbl0X3nS7p/ftQL//uGfDrQc792cUSRO+tv+apXoq+jDJzyPVXiavVNFwmp/b7wnIXEwmpPdZ7FPl0r5tvaY28UvtPQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678803364; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/q+hZWDamNvuzwYFEva3jk90qekkhJz7Ai2wBWOsxqI=; b=EoKg6TNA0m7KcEq3RR3eStB2sGZSkoCAlF4m2pQvsD5Y0ywBuea4l0gRxuTxn4R8v0dKqriY2EZumZBmENf3yA9K4WVShRQQyauSmbXkPc8pSBHEfcjet9TXFjpN97Z4bLqOJNkr2LFDROCWHEq0OcrGauCBBVdSuF/jRqUBTvQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1678803364889455.3776217397949; Tue, 14 Mar 2023 07:16:04 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.509630.785741 (Exim 4.92) (envelope-from ) id 1pc5RA-0004ac-Ga; Tue, 14 Mar 2023 14:15:36 +0000 Received: by outflank-mailman (output) from mailman id 509630.785741; Tue, 14 Mar 2023 14:15:36 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pc5RA-0004aR-DW; Tue, 14 Mar 2023 14:15:36 +0000 Received: by outflank-mailman (input) for mailman id 509630; Tue, 14 Mar 2023 14:15:35 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pc5R9-0004aK-2L for xen-devel@lists.xenproject.org; Tue, 14 Mar 2023 14:15:35 +0000 Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com [216.71.145.153]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id ab5188f5-c272-11ed-b464-930f4c7d94ae; Tue, 14 Mar 2023 15:15:30 +0100 (CET) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: ab5188f5-c272-11ed-b464-930f4c7d94ae DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1678803330; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Fko8ktTbERl+jnx1rVxdYJjeLy3W6/ckaPihOkE2uPs=; b=dkt14CsydKusQBZOghsOhLNQLGfCzN6KZfdYY5zRoKGljaxH9EB3q7VM Ccydosv5wmR97MJSm0sF8wIINcykLl7XXKcYqjAisYxDviqy9basC9py0 /Y+fChcHVaxPUEfqB1PX+TjLzSYIbT+zGansz6dLlzJGmhnLug18IyFTo M=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 100695472 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.123 X-Policy: $RELAYED IronPort-Data: A9a23:6PJpTqiy6lDVZUk7R4aVGYjwX161fhAKZh0ujC45NGQN5FlHY01je htvXD2EbPmKZmLzct92Oomy/BkOu8DQm4VhQQQ4rSsxRnsb9cadCdqndUqhZCn6wu8v7q5Ex 55HNoSfdpBcolv0/ErF3m3J9CEkvU2wbuOgTrWCYmYpHlUMpB4J0XpLg/Q+jpNjne+3CgaMv cKai8DEMRqu1iUc3lg8sspvkzsy+qWi0N8klgZmP6sT5waCzyN94K83fsldEVOpGuG4IcbiL wrz5OnR1n/U+R4rFuSknt7TGqHdauePVeQmoiM+t5mK2nCulARrukoIHKN0hXNsoyeIh7hMJ OBl7vRcf+uL0prkw4zxWzEAe8130DYvFLXveRBTuuTLp6HKnueFL1yDwyjaMKVBktubD12i+ tQIeSAAShWB39ummrm4T+Viqt4BdNPkadZ3VnFIlVk1DN4jSJHHBa7L+cVZzHE7gcUm8fT2P pRDL2A1NVKZPkMJYw1MYH49tL7Aan3XWjtUsl+K44Ew5HDe1ldZ27nxKtvFPNeNQK25m27B/ jqYrjmlXUty2Nq3yxuG0ij9is70zSrefYBNGrCmxOF4qQjGroAUIEJPDgbqyRWjsWauVtQaJ 0EK9y4Gqakp6FftXtT7Rwe/onOPolgbQdU4O/I+wBGAzOzT+QnxLm0NVDtIctElnM4wWz0x1 1WNks/pBDpgq7mcQzSW8bL8kN+pEXFLdylYP3ZCFFZbpYC5++nfky4jUP5zQb64qtj3QQjgm TuJqSQwq68x1dQEgvDTEU/8vxqgoZ3ATwgQ7wrRX3644g4RWLNJd7BE+nCAs68ecd/xok2p+ SFdxpPAtLxm4YSlznTlfQkbIF2+Cx9p2hX4iEUnIZQu/i/FF5WLLdEJu2EWyKuE3685ld7Vj K374145CHx7ZiHCgUpLj2WZWqwXIVDIT4iNaxwtRoMmjmJNXAGG5jpyQkWbwnrglkMh+YlmZ 8jLLp32UixAVP0+pNZTewv6+e5D+8zD7TmLGcCTI+qPiNJym0J5uZ9aaQDTP4jVHYuPoRnP8 sY3CvZmPy53CbWkCgGOqN57ELz/BSRjbXwAg5ANJ7Hrz8sPMD1JNsI9Npt6K9Q0xvQIyLqYl px/M2cBoGfCabT8AV3iQhhehHnHB/6TcVpT0fQQAGuV IronPort-HdrOrdr: A9a23:JiJSDa/N4mpD1f1lhIRuk+AEI+orL9Y04lQ7vn2ZKCYlCfBw8v rEoB1173HJYVoqNU3I2urwXJVoOEm8yXct2+ks1NSZLWvbUQmTXflfBOLZqlWLJ8SZzJ856U 4KScdD4bPLYWSSwvyKhzVQvuxQpuWv4eSDv8+b5XFoVARrY6Zr40NCDBqBGEEefngkOXN8Lu vk2vZ6 X-IronPort-AV: E=Sophos;i="5.98,260,1673931600"; d="scan'208";a="100695472" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Wei Liu , "Anthony PERARD" , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Bernhard Kaindl Subject: [PATCH 1/7] tools/python: Drop pylintrc Date: Tue, 14 Mar 2023 14:15:14 +0000 Message-ID: <20230314141520.3652451-2-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230314141520.3652451-1-andrew.cooper3@citrix.com> References: <20230314141520.3652451-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1678803368621100003 This was added in 2004 in c/s b7d4a69f0ccb5 and has never been referenced since. Given the the commit message of simply "Added .", it was quite possibly a mistake in the first place. Signed-off-by: Andrew Cooper Acked-by: Anthony PERARD Acked-by: Marek Marczykowski-G=C3=B3recki --- CC: Wei Liu CC: Anthony PERARD CC: Marek Marczykowski-G=C3=B3recki CC: Bernhard Kaindl --- tools/python/pylintrc | 307 ------------------------------------------ 1 file changed, 307 deletions(-) delete mode 100644 tools/python/pylintrc diff --git a/tools/python/pylintrc b/tools/python/pylintrc deleted file mode 100644 index efc4b0b3b2dd..000000000000 --- a/tools/python/pylintrc +++ /dev/null @@ -1,307 +0,0 @@ -# lint Python modules using external checkers. =20 -# = =20 -# This is the main checker controling the other ones and the reports = =20 -# generation. It is itself both a raw checker and an astng checker in = order =20 -# to: = =20 -# * handle message activation / deactivation at the module level = =20 -# * handle some basic but necessary stats'data (number of classes, met= hods...) -# = =20 -# This checker also defines the following reports: = =20 -# * R0001: Total errors / warnings = =20 -# * R0002: % errors / warnings by module = =20 -# * R0003: Messages = =20 -# * R0004: Global evaluation = =20 -#=20 -[MASTER] -# Add to the black list. It should be a base name, not= a -# path. You may set this option multiple times. -ignore=3DCVS - -# Pickle collected data for later comparisons. -persistent=3Dyes - -# Set the cache size for astng objects. -cache-size=3D500 - - - -[REPORTS] -# Tells wether to display a full report or only the messages -reports=3Dyes - -# Use HTML as output format instead of text -html=3Dno - -# Use a parseable text output format, so your favorite text editor will be= able -# to jump to the line corresponding to a message. -parseable=3Dno - -# Colorizes text output using ansi escape codes -color=3Dno - -# Put messages in a separate file for each module / package specified on t= he -# command line instead of printing them on stdout. Reports (if any) will be -# written in a file name "pylint_global.[txt|html]". -files-output=3Dno - -# Python expression which should return a note less than 10 (10 is the hig= hest -# note).You have access to the variables errors warning, statement which -# respectivly contain the number of errors / warnings messages and the tot= al -# number of statements analyzed. This is used by the global evaluation rep= ort -# (R0004). -evaluation=3D10.0 - ((float(5 * error + warning + refactor + convention) /= statement) * 10) - -# Add a comment according to your evaluation note. This is used by the glo= bal -# evaluation report (R0004). -comment=3Dno - -# Include message's id in output -include-ids=3Dyes - - - -# checks for =20 -# * unused variables / imports = =20 -# * undefined variables = =20 -# * redefinition of variable from builtins or from an outer scope = =20 -# * use of variable before assigment = =20 -# =20 -[VARIABLES] -# Enable / disable this checker -enable-variables=3Dyes - -# Tells wether we should check for unused import in __init__ files. -init-import=3Dno - -# List of variable names used for dummy variables (i.e. not used). -dummy-variables=3D_,_1,_2,_3,_4,_5,dummy - - - -# checks for : =20 -# * doc strings = =20 -# * modules / classes / functions / methods / arguments / variables na= me =20 -# * number of arguments, local variables, branchs, returns and stateme= nts in -# functions, methods =20 -# * required module attributes = =20 -# * dangerous default values as arguments = =20 -# * redefinition of function / method / class = =20 -# * uses of the global statement = =20 -# = =20 -# This checker also defines the following reports: = =20 -# * R0101: Statistics by type = =20 -#=20 -[BASIC] -# Enable / disable this checker -enable-basic=3Dyes - -# Required attributes for module, separated by a comma -required-attributes=3D - -# Regular expression which should only match functions or classes name whi= ch do -# not require a docstring -no-docstring-rgx=3D.* - -# Minimal length for module / class / function / method / argument / varia= ble -# names -min-name-length=3D1 - -# Regular expression which should only match correct module names -module-rgx=3D(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ - -# Regular expression which should only match correct class names -class-rgx=3D[A-Z_][a-zA-Z0-9]+$ - -# Regular expression which should only match correct function names -function-rgx=3D[a-z_][A-Za-z0-9_]*$ - -# Regular expression which should only match correct method names -method-rgx=3D[a-z_][A-Za-z0-9_]*$ - -# Regular expression which should only match correct argument names -argument-rgx=3D[a-z_][A-Za-z0-9_]*$ - -# Regular expression which should only match correct variable names -variable-rgx=3D[a-z_][A-Za-z0-9_]*$ - -# Good variable names which should always be accepted, separated by a comma -good-names=3Di,j,k,ex,Run,_ - -# Bad variable names which should always be refused, separated by a comma -bad-names=3Dfoo,bar,baz,toto,tutu,tata - -# List of builtins function names that should not be used, separated by a = comma -bad-functions=3Dapply,input - - - -# checks for sign of poor/misdesign: =20 -# * number of methods, attributes, local variables... = =20 -# * size, complexity of functions, methods = =20 -# =20 -[DESIGN] -# Enable / disable this checker -enable-design=3Dyes - -# Maximum number of arguments for function / method -max-args=3D15 - -# Maximum number of locals for function / method body -max-locals=3D15 - -# Maximum number of return / yield for function / method body -max-returns=3D6 - -# Maximum number of branch for function / method body -max-branchs=3D12 - -# Maximum number of statements in function / method body -max-statements=3D50 - -# Maximum number of parents for a class (see R0901). -max-parents=3D7 - -# Maximum number of attributes for a class (see R0902). -max-attributes=3D7 - -# Minimum number of public methods for a class (see R0903). -min-public-methods=3D2 - -# Maximum number of public methods for a class (see R0904). -max-public-methods=3D20 - - - -# checks for : =20 -# * methods without self as first argument = =20 -# * overriden methods signature = =20 -# * access only to existant members via self = =20 -# * attributes not defined in the __init__ method = =20 -# * supported interfaces implementation = =20 -# * unreachable code = =20 -# =20 -[CLASSES] -# Enable / disable this checker -enable-classes=3Dyes - -# List of interface methods to ignore, separated by a comma. This is used = for -# instance to not check methods defines in Zope's Interface base class. -ignore-iface-methods=3DisImplementedBy,deferred,extends,names,namesAndDesc= riptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getT= aggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplemen= tedByInstancesOf,adaptWith,is_implemented_by - -# Tells wether missing members accessed in mixin class should be ignored. A -# mixin class is detected if its name ends with "mixin" (case insensitive). -ignore-mixin-members=3Dyes - - - -# checks for =20 -# * external modules dependencies = =20 -# * relative / wildcard imports = =20 -# * cyclic imports = =20 -# * uses of deprecated modules -# = =20 -# This checker also defines the following reports: = =20 -# * R0401: External dependencies = =20 -# * R0402: Modules dependencies graph = =20 -#=20 -[IMPORTS] -# Enable / disable this checker -enable-imports=3Dno - -# Deprecated modules which should not be used, separated by a comma -deprecated-modules=3Dregsub,string,TERMIOS,Bastion,rexec - -# Create a graph of every (i.e. internal and external) dependencies in the= given -# file (report R0402 must not be disabled) -import-graph=3D - -# Create a graph of external dependencies in the given file (report R0402 = must -# not be disabled) -ext-import-graph=3D - -# Create a graph of internal dependencies in the given file (report R0402 = must -# not be disabled) -int-import-graph=3D - - - -# checks for =20 -# * excepts without exception filter = =20 -# * string exceptions = =20 -# =20 -[EXCEPTIONS] -# Enable / disable this checker -enable-exceptions=3Dyes - - - -# checks for : =20 -# * unauthorized constructions = =20 -# * strict indentation = =20 -# * line length = =20 -# * use of <> instead of !=3D -# =20 -[FORMAT] -# Enable / disable this checker -enable-format=3Dno - -# Maximum number of characters on a single line. -max-line-length=3D80 - -# Maximum number of lines in a module -max-module-lines=3D1000 - -# String used as indentation unit. This is usually " " (4 spaces) or "\t" = (1 tab). -indent-string=3D' ' - - - -# does not check anything but gives some raw metrics : =20 -# * total number of lines = =20 -# * total number of code lines = =20 -# * total number of docstring lines = =20 -# * total number of comments lines = =20 -# * total number of empty lines = =20 -# = =20 -# This checker also defines the following reports: = =20 -# * R0701: Raw metrics = =20 -#=20 -[METRICS] -# Enable / disable this checker -enable-metrics=3Dyes - - - -# checks for: =20 -# * warning notes in the code like FIXME, XXX = =20 -# * PEP 263: source code with non ascii character but no encoding decl= aration -# =20 -[MISCELLANEOUS] -# Enable / disable this checker -enable-miscellaneous=3Dyes - -# List of note tags to take in consideration, separated by a comma. Defaul= t to -# FIXME, XXX, TODO -notes=3DFIXME,XXX,TODO - - - -# checks for similarities and duplicated code. This computation may be -# memory / CPU intensive, so you should disable it if you experiments = some -# problems. -# = =20 -# This checker also defines the following reports: = =20 -# * R0801: Duplication = =20 -#=20 -[SIMILARITIES] -# Enable / disable this checker -enable-similarities=3Dyes - -# Minimum lines number of a similarity. -min-similarity-lines=3D4 - -# Ignore comments when computing similarities. -ignore-comments=3Dyes - - - --=20 2.30.2 From nobody Sat May 18 20:15:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1678803363; cv=none; d=zohomail.com; s=zohoarc; b=eCPVCreBnUw5tZo+S2fvmoT+oAx5jQAFYNhdcq67n0vh/WrKD5I4yOdG1Kqy4VuPsf9kkVMUYLM1sNEDbnw4LGnSAzn0QTUfvmoVeSPaoJed0aSCze1j95saHFjyqEqZS9RsOey4Jzo5a0KH5szNazTIiN9643ZO2yg6bzEnxTU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678803363; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZCezn+gSuKgDirOOvnqmwe59BnNu64/uHK5xPIrjsR0=; b=iGuadm3UuH2VjdBnJ+jOjY9BvyW9SDZ2R7jrrBG9hbx7dE356orpPYMkKIq22PuAtXW6OQAhHKNs0gwcssslOmRC3DqkSxikTNRtIoyG+IMsSZca3EBAG/JpJa7dThI6QjJHVGkTVsDQr4B3o9A+vH+4Hht8FdmVvAzhZ8AyUYw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1678803363461881.3885827024807; Tue, 14 Mar 2023 07:16:03 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.509632.785756 (Exim 4.92) (envelope-from ) id 1pc5RC-0004sr-6J; Tue, 14 Mar 2023 14:15:38 +0000 Received: by outflank-mailman (output) from mailman id 509632.785756; Tue, 14 Mar 2023 14:15:38 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pc5RC-0004s6-1t; Tue, 14 Mar 2023 14:15:38 +0000 Received: by outflank-mailman (input) for mailman id 509632; Tue, 14 Mar 2023 14:15:36 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pc5RA-0004aK-MC for xen-devel@lists.xenproject.org; Tue, 14 Mar 2023 14:15:36 +0000 Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com [216.71.145.153]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id af7f90c4-c272-11ed-b464-930f4c7d94ae; Tue, 14 Mar 2023 15:15:34 +0100 (CET) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: af7f90c4-c272-11ed-b464-930f4c7d94ae DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1678803334; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=C0d3uxwMv1ov6KcfS5c7XJ6RUpKJXLIQRNm/aiuPRhQ=; b=GLGGJStEgr947sAazjsV46aQxlzy+EGfbKfCQz8KDvLeL4ptXKqK7unp e4RjmNg+a6DMuB3an7O22NDM3ntyA0mUo15zLGPAZ4iI/qGGrYDLyYv8E rR7GNaAMYe55H+QfIBeAt4fSXiKIaDIaoSa+spm8zELizwI9cYhtLzKdo c=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 100695473 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.123 X-Policy: $RELAYED IronPort-Data: A9a23:+whBGqP1iDsp+LzvrR27l8FynXyQoLVcMsEvi/4bfWQNrUpz1jFWy WceD2+DMq3bMWLxc9sna423pExUvJbQz95gSQto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v 63yTvGacajYm1eF/k/F3oDJ9CU6jufQAOKnUoYoAwgpLSd8UiAtlBl/rOAwh49skLCRDhiE/ Nj/uKUzAnf8s9JPGj9SuvLrRC9H5qyo42tD5wBmP5ingXeF/5UrJMNHTU2OByOQrrl8RoaSW +vFxbelyWLVlz9F5gSNy+uTnuUiG9Y+DCDW4pZkc/HKbitq/0Te5p0TJvsEAXq7vh3S9zxHJ HehgrTrIeshFvWkdO3wyHC0GQkmVUFN0OevzXRSLaV/ZqAJGpfh66wGMa04AWEX0vYmEWxq8 P5AESBXZROGi+ya2pDjUOY506zPLOGzVG8eknRpzDWfBvc6W5HTBa7N4Le03h9p2JoIR6yHI ZNEN3w2Nk+ojx5nYz/7DLoXmuuyi2a5WDpfsF+P/oI84nTJzRw327/oWDbQUoXSHZsEwxrH/ Qoq+UypIT4GL/i57Qab0WCmo97SnyTLdKs7QejQGvlC3wTImz175ActfUu2p7y1h1CzX/pbK lcI4Ww+oK4q7kupQ9LhGRqirxasoRo0S9dWVeog52mlz6PO5g+DC2ssTzhfaccnvss7WTwr0 FCSm9rjQzdotdWopWm1r+nO62noYG5McDFEPHVfJecY3zX9iJFinh/rS9Q7Kb7vhd7wFT/c2 RLStidr0t3/kvU3/6m8+FnGhRelqZ7IUhM5623rY4610u9qTNX7PtL1sDA3+d4Fdd/EFQfZ4 BDojuDEtIgz4YexeDthqQnnNJWg/L67PTLVmjaD9LFxpm32qxZPkW29iQySxXuF0O5eJFcFg 2eJ42u9AaO/21P7BZKbm6rrV6wXIVHITLwJrMz8YNtUeYRWfwSa5ixobkP49zmzzxhzyvtgY 83GKJ/E4ZMm5UNPnVKLqxo1i+d3lkjSO0uKLXwE8/hX+eXHPyPEIVv0GFCPcvo4/Mu5nekhy P4Gb5Hi40wGAIXDjtz/rdZ7waYicSJqWvgbaqV/Koa+H+aRMDpxU66Ike5/JtwNcmY8vr6gw 0xRk3RwkDLX7UAr4y3QApy/QNsDhapCkE8= IronPort-HdrOrdr: A9a23:2K8jCqwLB7s/RBTtDKsUKrPw8L1zdoMgy1knxilNoH1uA7elfq WV98jzuiWbtN98YhwdcJO7Sc29qArnlKKduLNwAV7AZniFhILLFvAb0WKK+VSJcREWkNQtsJ uIGJIQNDSfNzRHZInBkW6F+nsbsb+62bHtr933i11qSRhua6lm5Qs8MACGCUd7LTM2ZqbRUK Dsn/Z6mw== X-IronPort-AV: E=Sophos;i="5.98,260,1673931600"; d="scan'208";a="100695473" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Wei Liu , "Anthony PERARD" , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Bernhard Kaindl Subject: [PATCH 2/7] tools/misc: Drop xencons Date: Tue, 14 Mar 2023 14:15:15 +0000 Message-ID: <20230314141520.3652451-3-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230314141520.3652451-1-andrew.cooper3@citrix.com> References: <20230314141520.3652451-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1678803367676100001 This is a python script which has it's shebang modified by be python3, but was never converted to be python3 compatible. The most recent reference I can find to this script (which isn't incidental adjustments in the makefile) is from the Xen book, fileish 561e30b80402 whi= ch says %% Alternatively, if the %% Xen machine is connected to a serial-port server then we supply a %% dumb TCP terminal client, {\tt xencons}. So this a not-invented-here version of telnet. Delete it. Signed-off-by: Andrew Cooper Acked-by: Anthony PERARD Acked-by: Marek Marczykowski-G=C3=B3recki --- CC: Wei Liu CC: Anthony PERARD CC: Marek Marczykowski-G=C3=B3recki CC: Bernhard Kaindl --- tools/misc/Makefile | 2 - tools/misc/xencons | 92 --------------------------------------------- 2 files changed, 94 deletions(-) delete mode 100755 tools/misc/xencons diff --git a/tools/misc/Makefile b/tools/misc/Makefile index 1c6e1d6a0471..233a7948c050 100644 --- a/tools/misc/Makefile +++ b/tools/misc/Makefile @@ -12,7 +12,6 @@ CFLAGS +=3D $(CFLAGS_libxenstore) # Everything to be installed in regular bin/ INSTALL_BIN-$(CONFIG_X86) +=3D xen-cpuid INSTALL_BIN-$(CONFIG_X86) +=3D xen-detect -INSTALL_BIN +=3D xencons INSTALL_BIN +=3D xencov_split INSTALL_BIN +=3D $(INSTALL_BIN-y) =20 @@ -44,7 +43,6 @@ INSTALL_PRIVBIN +=3D xenpvnetboot TARGETS_ALL :=3D $(INSTALL_BIN) $(INSTALL_SBIN) $(INSTALL_PRIVBIN) =20 # Everything which only needs copying to install -TARGETS_COPY +=3D xencons TARGETS_COPY +=3D xencov_split TARGETS_COPY +=3D xenpvnetboot =20 diff --git a/tools/misc/xencons b/tools/misc/xencons deleted file mode 100755 index 8bd3178eab4e..000000000000 --- a/tools/misc/xencons +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/env python - -############################################## -# Console client for Xen guest OSes -# Copyright (c) 2004, K A Fraser -############################################## - -import errno, os, signal, socket, struct, sys - -from termios import * -# Indexes into termios.tcgetattr() list. -IFLAG =3D 0 -OFLAG =3D 1 -CFLAG =3D 2 -LFLAG =3D 3 -ISPEED =3D 4 -OSPEED =3D 5 -CC =3D 6 - -def __child_death(signum, frame): - global stop - stop =3D True - -def __recv_from_sock(sock): - global stop - stop =3D False - while not stop: - try: - data =3D sock.recv(1024) - except socket.error, error: - if error[0] !=3D errno.EINTR: - raise - else: - try: - os.write(1, data) - except os.error, error: - if error[0] !=3D errno.EINTR: - raise - os.wait() - -def __send_to_sock(sock): - while 1: - try: - data =3D os.read(0,1024) - except os.error, error: - if error[0] !=3D errno.EINTR: - raise - else: - if ord(data[0]) =3D=3D ord(']')-64: - break - try: - sock.send(data) - except socket.error, error: - if error[0] =3D=3D errno.EPIPE: - sys.exit(0) - if error[0] !=3D errno.EINTR: - raise - sys.exit(0) - -def connect(host,port): - sock =3D socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0) - sock.connect((host,port)) - - oattrs =3D tcgetattr(0) - nattrs =3D tcgetattr(0) - nattrs[IFLAG] =3D nattrs[IFLAG] & ~(BRKINT | ICRNL | INPCK | ISTRIP | = IXON) - nattrs[OFLAG] =3D nattrs[OFLAG] & ~(OPOST) - nattrs[CFLAG] =3D nattrs[CFLAG] & ~(CSIZE | PARENB) - nattrs[CFLAG] =3D nattrs[CFLAG] | CS8 - nattrs[LFLAG] =3D nattrs[LFLAG] & ~(ECHO | ICANON | IEXTEN | ISIG) - nattrs[CC][VMIN] =3D 1 - nattrs[CC][VTIME] =3D 0 - - if os.fork(): - signal.signal(signal.SIGCHLD, __child_death) - print "************ REMOTE CONSOLE: CTRL-] TO QUIT ********" - tcsetattr(0, TCSAFLUSH, nattrs) - try: - __recv_from_sock(sock) - finally: - tcsetattr(0, TCSAFLUSH, oattrs) - print - print "************ REMOTE CONSOLE EXITED *****************" - else: - signal.signal(signal.SIGPIPE, signal.SIG_IGN) - __send_to_sock(sock) - -if __name__ =3D=3D '__main__': - if len(sys.argv) !=3D 3: - print sys.argv[0] + " " - sys.exit(1) - connect(str(sys.argv[1]),int(sys.argv[2])) --=20 2.30.2 From nobody Sat May 18 20:15:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1678803396; cv=none; d=zohomail.com; s=zohoarc; b=QvdAU2/lYlECAG/zsy7/jN3HWNbzGZB6b/5re+7Fk/axv9OVNWy1t0rMuq9yw0B0Tz7VoLnuavpOc4rin3h15hQ98Az8KS3k3wQn64xlEEnWQgKV5MpYHzyr266JaU88TfW1TbraijiUqk1pTA+F5oiofoQANNA4TEmviEHDXKE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678803396; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2ZUWtlFR1XmlSoIHVC7aW+LAceLljHEfapam5P+2pzo=; b=hEDuro73t8hVzfm01Gj5Yuo1BjM8drUPuPxVpznOhnXuZJLF3Xy5WlntLyafEAh9mSUJLKXdIKdK29LRf4fkQ9Vr8tnPQs0FgIPcmIb7hmSDZA9Wpw2DjkZ98w1rFQIYVuVjr/TtGwBcI4YL1YUah0hxhk9EKKMHuHDu4hfLpc8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1678803396454778.5748411232023; Tue, 14 Mar 2023 07:16:36 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.509639.785812 (Exim 4.92) (envelope-from ) id 1pc5Rb-0007AA-MD; Tue, 14 Mar 2023 14:16:03 +0000 Received: by outflank-mailman (output) from mailman id 509639.785812; Tue, 14 Mar 2023 14:16:03 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pc5Rb-0007A0-Ha; Tue, 14 Mar 2023 14:16:03 +0000 Received: by outflank-mailman (input) for mailman id 509639; Tue, 14 Mar 2023 14:16:02 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pc5RZ-0004aK-MN for xen-devel@lists.xenproject.org; Tue, 14 Mar 2023 14:16:02 +0000 Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com [216.71.155.175]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id bd795609-c272-11ed-b464-930f4c7d94ae; Tue, 14 Mar 2023 15:15:58 +0100 (CET) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: bd795609-c272-11ed-b464-930f4c7d94ae DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1678803358; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=DJSzXqkcYWpvV0c3oOG1hdU17ww0JumRTjIT/Z/grms=; b=fqYVpw/sOejUaL/Oz/nkw/Q015Xz38k1Kw0XL6cK7L8DZBzh3/pGL1x8 Ed5X2+mp9MHj3fxm6CS2V3G9Fvncdizz3Piw6jyPeYAuciiDj8smRKyx9 zBnFSsVvZD/YeKrd5x9Q++zyjnG/91K6Sfv2VU9Q26CVimWbNV+oXUu/9 s=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 100156185 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.123 X-Policy: $RELAYED IronPort-Data: A9a23:7hxAza1iBCzSqEZHdfbD5ctxkn2cJEfYwER7XKvMYLTBsI5bpzQDn TMXDGCDPvbYYDf1fY8iOd/loRsB65aHx95gSgtspC1hF35El5HIVI+TRqvS04F+DeWYFR46s J9OAjXkBJppJpMJjk71atANlVEliefTAOK6ULWeUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo tq3qMDEULOf82cc3lk8tuTS+HuDgNyo4GlD5gdnOagR1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL 87fwbew+H/u/htFIrtJRZ6iLyXm6paLVeS/oiI+t5qK23CulQRrukoPD9IOaF8/ttm8t4sZJ OOhF3CHYVxB0qXkwIzxWvTDes10FfUuFLTveRBTvSEPpqFvnrSFL/hGVSkL0YMkFulfWkgN5 NpAFwE2TEq7h8SL7ZS8eu5tv5F2RCXrFNt3VnBIyDjYCbAtQIzZQrWM7thdtNsyrpkQR7CEP ZNfMGcxKk2aOHWjOX9OYH46tM6uimPybHtzr1WNqLBsy2PS0BZwwP7mN9+9ltmiHJ0NxxvG/ zKbl4j/Kg40EfGa0z6Py2+DluqewAbLe6QwKqLto5aGh3XMnzdOWXX6T2CTsfS/z0KzRd9bA 0gV4TY167g/8lSxSdvwVAH+p2SL1jYDX/JAHut87xuCooLR6hycD3IJTRZAbsInr848QTE21 l6PkMjtDDYpu7qQIU9x7Z/N82n0Y3JMazZfO2ldF1BtD8TfTJ8b1TuMX/A7L5+OrIfNGRfN7 haNnC8/vuBG5SIU7JmT8VfCijOqg5HGSA8p+wnaNl6YAhNFiJ2NPNLxtwWChRpUBMPAFwTa4 iBY8ySLxLpWZaxhghBhVwnk8FuBw/+eeAPRjld0d3XK32T8oiXzFWy8DdwXGauIDirmUWW0C KMwkVkLjHO2AJdNRf4fXm5JI552pZUM7Py8PhwuUvJAY4JqaCiM9zx0aEib0gjFyRZzwf5kY 8jBK5v1VB727JiLKxLnL9rxLJdxnnxurY8tbcmTI+ubPUq2OyfOFOZt3KqmZeEl9qKUyDjoH yJkH5LSkX13CbSuChQ7BKZPdTjm21BnX8GpwyGWH8bfSjdb9JYJUK+JkOpxJtI4z8y4VI7gp xmAZ6OR83Kn7VWvFOlAQik7M9sDgb4XQaoHABER IronPort-HdrOrdr: A9a23:cLYCVK5HhzV+GS33UgPXwM3XdLJyesId70hD6qkRc20yTiX2rb HLoB1273/JYU8qOU3I+urwX5VoI0m3yXcd2+B4VotKOjOW21dAR7sSiLcKrQeQeREWwdQx6U 6wScZD4IyZNzdHZZiT2mWFL+o= X-IronPort-AV: E=Sophos;i="5.98,260,1673931600"; d="scan'208";a="100156185" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Wei Liu , "Anthony PERARD" , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Bernhard Kaindl Subject: [PATCH 3/7] tools: Delete trailing whitespace in python scripts Date: Tue, 14 Mar 2023 14:15:16 +0000 Message-ID: <20230314141520.3652451-4-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230314141520.3652451-1-andrew.cooper3@citrix.com> References: <20230314141520.3652451-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1678803398852100001 No functional change. Signed-off-by: Andrew Cooper Acked-by: Marek Marczykowski-G=C3=B3recki Reviewed-by: Anthony PERARD --- CC: Wei Liu CC: Anthony PERARD CC: Marek Marczykowski-G=C3=B3recki CC: Bernhard Kaindl --- tools/misc/xencov_split | 1 - tools/pygrub/src/ExtLinuxConf.py | 2 +- tools/pygrub/src/GrubConf.py | 30 ++--- tools/pygrub/src/fsimage/fsimage.c | 8 +- tools/pygrub/src/pygrub | 44 +++---- tools/python/xen/lowlevel/xc/xc.c | 200 ++++++++++++++--------------- tools/python/xen/lowlevel/xs/xs.c | 4 +- tools/xenmon/xenmon.py | 44 +++---- 8 files changed, 166 insertions(+), 167 deletions(-) diff --git a/tools/misc/xencov_split b/tools/misc/xencov_split index 5771f6cfc285..e4f68ebb6eda 100755 --- a/tools/misc/xencov_split +++ b/tools/misc/xencov_split @@ -94,4 +94,3 @@ if __name__ =3D=3D "__main__": sys.exit(1) except KeyboardInterrupt: sys.exit(1) - diff --git a/tools/pygrub/src/ExtLinuxConf.py b/tools/pygrub/src/ExtLinuxCo= nf.py index 9fd635b9cf7a..4e990a9304b6 100644 --- a/tools/pygrub/src/ExtLinuxConf.py +++ b/tools/pygrub/src/ExtLinuxConf.py @@ -207,7 +207,7 @@ class ExtLinuxConfigFile(object): "f1": None, "f2": None, } - =20 + if __name__ =3D=3D "__main__": if len(sys.argv) < 2: raise RuntimeError("Need a configuration file to read") diff --git a/tools/pygrub/src/GrubConf.py b/tools/pygrub/src/GrubConf.py index 73f1bbed2f54..580c9628ca64 100644 --- a/tools/pygrub/src/GrubConf.py +++ b/tools/pygrub/src/GrubConf.py @@ -95,7 +95,7 @@ class _GrubImage(object): self.title =3D title.strip() =20 def __repr__(self): - return ("title: %s\n"=20 + return ("title: %s\n" " root: %s\n" " kernel: %s\n" " args: %s\n" @@ -140,7 +140,7 @@ class _GrubImage(object): class GrubImage(_GrubImage): def __init__(self, title, lines): _GrubImage.__init__(self, title, lines) - =20 + def set_from_line(self, line, replace =3D None): (com, arg) =3D grub_exact_split(line, 2) =20 @@ -265,7 +265,7 @@ class _GrubConfigFile(object): class GrubConfigFile(_GrubConfigFile): def __init__(self, fn =3D None): _GrubConfigFile.__init__(self,fn) - =20 + def new_image(self, title, lines): return GrubImage(title, lines) =20 @@ -297,7 +297,7 @@ class GrubConfigFile(_GrubConfigFile): img =3D [] title =3D l[6:] continue - =20 + if img is not None: img.append(l) continue @@ -310,7 +310,7 @@ class GrubConfigFile(_GrubConfigFile): logging.info("Ignored directive %s" %(com,)) else: logging.warning("Unknown directive %s" %(com,)) - =20 + if img: self.add_image(GrubImage(title, img)) =20 @@ -322,7 +322,7 @@ def grub2_handle_set(arg): com=3D"set:" + com m =3D re.match("([\"\'])(.*)\\1", arg) if m is not None: - arg=3Dm.group(2)=20 + arg=3Dm.group(2) return (com,arg) =20 class Grub2Image(_GrubImage): @@ -334,7 +334,7 @@ class Grub2Image(_GrubImage): =20 if com =3D=3D "set": (com,arg) =3D grub2_handle_set(arg) - =20 + if com in self.commands: if self.commands[com] is not None: setattr(self, self.commands[com], arg.strip()) @@ -351,7 +351,7 @@ class Grub2Image(_GrubImage): else: self.lines.pop(replace) self.lines.insert(replace, line) - =20 + commands =3D {'set:root': 'root', 'linux': 'kernel', 'linux16': 'kernel', @@ -360,14 +360,14 @@ class Grub2Image(_GrubImage): 'echo': None, 'insmod': None, 'search': None} - =20 + class Grub2ConfigFile(_GrubConfigFile): def __init__(self, fn =3D None): _GrubConfigFile.__init__(self, fn) - =20 + def new_image(self, title, lines): return Grub2Image(title, lines) -=20 + def parse(self, buf =3D None): if buf is None: if self.filename is None: @@ -431,10 +431,10 @@ class Grub2ConfigFile(_GrubConfigFile): continue =20 (com, arg) =3D grub_exact_split(l, 2) - =20 + if com =3D=3D "set": (com,arg) =3D grub2_handle_set(arg) - =20 + if com in self.commands: if self.commands[com] is not None: arg_strip =3D arg.strip() @@ -448,7 +448,7 @@ class Grub2ConfigFile(_GrubConfigFile): pass else: logging.warning("Unknown directive %s" %(com,)) - =20 + if img is not None: raise RuntimeError("syntax error: end of file with open menuen= try(%d %s)" % (len(img),img)) =20 @@ -466,7 +466,7 @@ class Grub2ConfigFile(_GrubConfigFile): 'if': None, 'fi': None, } - =20 + if __name__ =3D=3D "__main__": if len(sys.argv) < 3: raise RuntimeError('Need a grub version ("grub" or "grub2") and a = grub.conf or grub.cfg to read') diff --git a/tools/pygrub/src/fsimage/fsimage.c b/tools/pygrub/src/fsimage/= fsimage.c index 2ebbbe35df92..fdcfa1a3c040 100644 --- a/tools/pygrub/src/fsimage/fsimage.c +++ b/tools/pygrub/src/fsimage/fsimage.c @@ -31,7 +31,7 @@ typedef struct fsimage_fs { fsi_t *fs; } fsimage_fs_t; =20 -typedef struct fsimage_file {=20 +typedef struct fsimage_file { PyObject_HEAD fsimage_fs_t *fs; fsi_file_t *file; @@ -47,7 +47,7 @@ fsimage_file_read(fsimage_file_t *file, PyObject *args, P= yObject *kwargs) ssize_t bytesread =3D 0; PyObject * buffer; =20 - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|iL", kwlist,=20 + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|iL", kwlist, &size, &offset)) return (NULL); =20 @@ -62,7 +62,7 @@ fsimage_file_read(fsimage_file_t *file, PyObject *args, P= yObject *kwargs) =20 if (buffer =3D=3D NULL) return (NULL); -=20 + while (1) { int err; void *buf =3D @@ -255,7 +255,7 @@ fsimage_open(PyObject *o, PyObject *args, PyObject *kwa= rgs) uint64_t offset =3D 0; fsimage_fs_t *fs; =20 - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|Ls", kwlist,=20 + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|Ls", kwlist, &name, &offset, &options)) return (NULL); =20 diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub index ce7ab0eb8cf3..a759d90ade5e 100755 --- a/tools/pygrub/src/pygrub +++ b/tools/pygrub/src/pygrub @@ -46,7 +46,7 @@ def enable_cursor(ison): val =3D 2 else: val =3D 0 - =20 + try: curses.curs_set(val) except _curses.error: @@ -114,7 +114,7 @@ FDISK_PART_GPT=3D0xee def get_partition_offsets(file): image_type =3D identify_disk_image(file) if image_type =3D=3D DISK_TYPE_RAW: - # No MBR: assume whole disk filesystem, which is like a=20 + # No MBR: assume whole disk filesystem, which is like a # single partition starting at 0 return [0] elif image_type =3D=3D DISK_TYPE_HYBRIDISO: @@ -135,7 +135,7 @@ def get_partition_offsets(file): partbuf =3D buf[poff:poff+16] offset =3D struct.unpack(" self.start_image + maxy: @@ -329,7 +329,7 @@ class Grub: l =3D img.lines[idx].expandtabs().ljust(70) if len(l) > 70: l =3D l[:69] + ">" - =20 + self.entry_win.addstr(idp, 2, l) if idx =3D=3D curline: self.entry_win.attroff(curses.A_REVERSE) @@ -367,7 +367,7 @@ class Grub: self.command_line_mode() if self.isdone: return - =20 + # bound at the top and bottom if curline < 0: curline =3D 0 @@ -400,7 +400,7 @@ class Grub: lines =3D [] while 1: t =3D GrubLineEditor(self.screen, y, 2) - enable_cursor(True) =20 + enable_cursor(True) ret =3D t.edit() if ret: if ret in ("quit", "return"): @@ -410,7 +410,7 @@ class Grub: lines.append(ret) continue =20 - # if we got boot, then we want to boot the entered image=20 + # if we got boot, then we want to boot the entered image img =3D self.cf.new_image("entered", lines) self.cf.add_image(img) self.selected_image =3D len(self.cf.images) - 1 @@ -423,7 +423,7 @@ class Grub: def read_config(self, fn, fs =3D None): """Read the given file to parse the config. If fs =3D None, then we're being given a raw config file rather than a disk image.""" - =20 + if not os.access(fn, os.R_OK): raise RuntimeError("Unable to access %s" %(fn,)) =20 @@ -499,7 +499,7 @@ class Grub: while not self.isdone: self.run_main(timeout) timeout =3D -1 - =20 + return self.selected_image =20 def run_main(self, timeout =3D -1): @@ -529,7 +529,7 @@ class Grub: self.start_image =3D 0 while (timeout =3D=3D -1 or mytime < int(timeout)): draw() - if timeout !=3D -1 and mytime !=3D -1:=20 + if timeout !=3D -1 and mytime !=3D -1: self.screen.addstr(20, 5, "Will boot selected entry in %2d= seconds" %(int(timeout) - mytime)) else: @@ -600,7 +600,7 @@ class Grub: self.selected_image =3D 0 elif self.selected_image >=3D len(self.cf.images): self.selected_image =3D len(self.cf.images) - 1 - =20 + def get_entry_idx(cf, entry): # first, see if the given entry is numeric try: @@ -697,10 +697,10 @@ def sniff_solaris(fs, cfg): # Unpleasant. Typically we'll have 'root=3Dfoo -k' or 'root=3Dfoo /ker= nel -k', # and we need to maintain Xen properties (root=3D and ip=3D) and the k= ernel # before any user args. - =20 + xenargs =3D "" userargs =3D "" - =20 + if not cfg["args"]: cfg["args"] =3D cfg["kernel"] else: @@ -712,7 +712,7 @@ def sniff_solaris(fs, cfg): cfg["args"] =3D xenargs + " " + cfg["kernel"] + " " + userargs =20 return cfg -=20 + def sniff_netware(fs, cfg): if not fs.file_exists("/nwserver/xnloader.sys"): return cfg @@ -729,7 +729,7 @@ def format_sxp(kernel, ramdisk, args): if args: s +=3D "(args %s)" % repr(args) return s - =20 + def format_simple(kernel, ramdisk, args, sep): for check in (kernel, ramdisk, args): if check is not None and sep in check: @@ -744,7 +744,7 @@ def format_simple(kernel, ramdisk, args, sep): =20 if __name__ =3D=3D "__main__": sel =3D None - =20 + def usage(): print("Usage: %s [-q|--quiet] [-i|--interactive] [-l|--list-entrie= s] [-n|--not-really] [--output=3D] [--kernel=3D] [--ramdisk=3D] [--args=3D]= [--entry=3D] [--output-directory=3D] [--output-format=3Dsxp|simple|simple0= ] [--offset=3D] " %(sys.argv[0],), file=3Dsys.stderr) =20 @@ -783,7 +783,7 @@ if __name__ =3D=3D "__main__": opts, args =3D getopt.gnu_getopt(sys.argv[1:], 'qilnh::', ["quiet", "interactive", "list-entries"= , "not-really", "help", "output=3D", "output-format=3D", "outp= ut-directory=3D", "offset=3D", - "entry=3D", "kernel=3D",=20 + "entry=3D", "kernel=3D", "ramdisk=3D", "args=3D", "isconfig", "= debug"]) except getopt.GetoptError: usage() @@ -967,4 +967,4 @@ if __name__ =3D=3D "__main__": os.write(fd, ostring) else: os.write(fd, ostring.encode()) - =20 + diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/= xc/xc.c index cfb2734a992b..e3a0c13bac31 100644 --- a/tools/python/xen/lowlevel/xc/xc.c +++ b/tools/python/xen/lowlevel/xc/xc.c @@ -1,6 +1,6 @@ /*************************************************************************= ***** * Xc.c - *=20 + * * Copyright (c) 2003-2004, K A Fraser (University of Cambridge) */ =20 @@ -108,7 +108,7 @@ static PyObject *pyxc_domain_dumpcore(XcObject *self, P= yObject *args) =20 if ( xc_domain_dumpcore(self->xc_handle, dom, corefile) !=3D 0 ) return pyxc_error_to_exception(self->xc_handle); - =20 + Py_INCREF(zero); return zero; } @@ -143,7 +143,7 @@ static PyObject *pyxc_domain_create(XcObject *self, return NULL; if ( pyhandle !=3D NULL ) { - if ( !PyList_Check(pyhandle) ||=20 + if ( !PyList_Check(pyhandle) || (PyList_Size(pyhandle) !=3D sizeof(xen_domain_handle_t)) ) goto out_exception; =20 @@ -191,7 +191,7 @@ static PyObject *pyxc_domain_max_vcpus(XcObject *self, = PyObject *args) =20 if (xc_domain_max_vcpus(self->xc_handle, dom, max) !=3D 0) return pyxc_error_to_exception(self->xc_handle); - =20 + Py_INCREF(zero); return zero; } @@ -226,7 +226,7 @@ static PyObject *pyxc_domain_shutdown(XcObject *self, P= yObject *args) =20 if ( xc_domain_shutdown(self->xc_handle, dom, reason) !=3D 0 ) return pyxc_error_to_exception(self->xc_handle); - =20 + Py_INCREF(zero); return zero; } @@ -258,7 +258,7 @@ static PyObject *pyxc_vcpu_setaffinity(XcObject *self, =20 static char *kwd_list[] =3D { "domid", "vcpu", "cpumap", NULL }; =20 - if ( !PyArg_ParseTupleAndKeywords(args, kwds, "i|iO", kwd_list,=20 + if ( !PyArg_ParseTupleAndKeywords(args, kwds, "i|iO", kwd_list, &dom, &vcpu, &cpulist) ) return NULL; =20 @@ -272,7 +272,7 @@ static PyObject *pyxc_vcpu_setaffinity(XcObject *self, =20 if ( (cpulist !=3D NULL) && PyList_Check(cpulist) ) { - for ( i =3D 0; i < PyList_Size(cpulist); i++ )=20 + for ( i =3D 0; i < PyList_Size(cpulist); i++ ) { long cpu =3D PyLongOrInt_AsLong(PyList_GetItem(cpulist, i)); if ( cpu < 0 || cpu >=3D nr_cpus ) @@ -285,7 +285,7 @@ static PyObject *pyxc_vcpu_setaffinity(XcObject *self, cpumap[cpu / 8] |=3D 1 << (cpu % 8); } } - =20 + if ( xc_vcpu_setaffinity(self->xc_handle, dom, vcpu, cpumap, NULL, XEN_VCPUAFFINITY_HARD) !=3D 0 ) { @@ -293,7 +293,7 @@ static PyObject *pyxc_vcpu_setaffinity(XcObject *self, return pyxc_error_to_exception(self->xc_handle); } Py_INCREF(zero); - free(cpumap);=20 + free(cpumap); return zero; } =20 @@ -307,7 +307,7 @@ static PyObject *pyxc_domain_sethandle(XcObject *self, = PyObject *args) if (!PyArg_ParseTuple(args, "iO", &dom, &pyhandle)) return NULL; =20 - if ( !PyList_Check(pyhandle) ||=20 + if ( !PyList_Check(pyhandle) || (PyList_Size(pyhandle) !=3D sizeof(xen_domain_handle_t)) ) { goto out_exception; @@ -323,7 +323,7 @@ static PyObject *pyxc_domain_sethandle(XcObject *self, = PyObject *args) =20 if (xc_domain_sethandle(self->xc_handle, dom, handle) < 0) return pyxc_error_to_exception(self->xc_handle); - =20 + Py_INCREF(zero); return zero; =20 @@ -345,7 +345,7 @@ static PyObject *pyxc_domain_getinfo(XcObject *self, xc_dominfo_t *info; =20 static char *kwd_list[] =3D { "first_dom", "max_doms", NULL }; - =20 + if ( !PyArg_ParseTupleAndKeywords(args, kwds, "|ii", kwd_list, &first_dom, &max_doms) ) return NULL; @@ -418,7 +418,7 @@ static PyObject *pyxc_vcpu_getinfo(XcObject *self, int nr_cpus; =20 static char *kwd_list[] =3D { "domid", "vcpu", NULL }; - =20 + if ( !PyArg_ParseTupleAndKeywords(args, kwds, "i|i", kwd_list, &dom, &vcpu) ) return NULL; @@ -473,7 +473,7 @@ static PyObject *pyxc_hvm_param_get(XcObject *self, int param; uint64_t value; =20 - static char *kwd_list[] =3D { "domid", "param", NULL };=20 + static char *kwd_list[] =3D { "domid", "param", NULL }; if ( !PyArg_ParseTupleAndKeywords(args, kwds, "ii", kwd_list, &dom, ¶m) ) return NULL; @@ -493,7 +493,7 @@ static PyObject *pyxc_hvm_param_set(XcObject *self, int param; uint64_t value; =20 - static char *kwd_list[] =3D { "domid", "param", "value", NULL };=20 + static char *kwd_list[] =3D { "domid", "param", "value", NULL }; if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiL", kwd_list, &dom, ¶m, &value) ) return NULL; @@ -663,7 +663,7 @@ static PyObject *pyxc_get_device_group(XcObject *self, =20 if ( rc < 0 ) { - free(sdev_array);=20 + free(sdev_array); return pyxc_error_to_exception(self->xc_handle); } =20 @@ -786,7 +786,7 @@ static PyObject *pyxc_physdev_pci_access_modify(XcObjec= t *self, =20 static char *kwd_list[] =3D { "domid", "bus", "dev", "func", "enable",= NULL }; =20 - if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiiii", kwd_list,=20 + if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiiii", kwd_list, &dom, &bus, &dev, &func, &enable) ) return NULL; =20 @@ -901,7 +901,7 @@ static PyObject *pyxc_physinfo(XcObject *self) "nr_nodes", pinfo.nr_nodes, "threads_per_core", pinfo.threads_per_core, "cores_per_socket", pinfo.cores_per_socket, - "nr_cpus", pinfo.nr_cpus,=20 + "nr_cpus", pinfo.nr_cpus, "total_memory", pages_to_kib(pinfo.total_p= ages), "free_memory", pages_to_kib(pinfo.free_pa= ges), "scrub_memory", pages_to_kib(pinfo.scrub_p= ages), @@ -1191,13 +1191,13 @@ static PyObject *pyxc_shadow_control(PyObject *self, =20 static char *kwd_list[] =3D { "dom", "op", NULL }; =20 - if ( !PyArg_ParseTupleAndKeywords(args, kwds, "i|i", kwd_list,=20 + if ( !PyArg_ParseTupleAndKeywords(args, kwds, "i|i", kwd_list, &dom, &op) ) return NULL; - =20 + if ( xc_shadow_control(xc->xc_handle, dom, op, NULL, 0) < 0 ) return pyxc_error_to_exception(xc->xc_handle); - =20 + Py_INCREF(zero); return zero; } @@ -1214,26 +1214,26 @@ static PyObject *pyxc_shadow_mem_control(PyObject *= self, =20 static char *kwd_list[] =3D { "dom", "mb", NULL }; =20 - if ( !PyArg_ParseTupleAndKeywords(args, kwds, "i|i", kwd_list,=20 + if ( !PyArg_ParseTupleAndKeywords(args, kwds, "i|i", kwd_list, &dom, &mbarg) ) return NULL; - =20 - if ( mbarg < 0 )=20 + + if ( mbarg < 0 ) op =3D XEN_DOMCTL_SHADOW_OP_GET_ALLOCATION; - else=20 + else { mb =3D mbarg; op =3D XEN_DOMCTL_SHADOW_OP_SET_ALLOCATION; } if ( xc_shadow_control(xc->xc_handle, dom, op, &mb, 0) < 0 ) return pyxc_error_to_exception(xc->xc_handle); - =20 + mbarg =3D mb; return Py_BuildValue("i", mbarg); } =20 static PyObject *pyxc_sched_id_get(XcObject *self) { - =20 + int sched_id; if (xc_sched_id(self->xc_handle, &sched_id) !=3D 0) return PyErr_SetFromErrno(xc_error_obj); @@ -1251,10 +1251,10 @@ static PyObject *pyxc_sched_credit_domain_set(XcObj= ect *self, static char *kwd_list[] =3D { "domid", "weight", "cap", NULL }; static char kwd_type[] =3D "I|HH"; struct xen_domctl_sched_credit sdom; - =20 + weight =3D 0; cap =3D (uint16_t)~0U; - if( !PyArg_ParseTupleAndKeywords(args, kwds, kwd_type, kwd_list,=20 + if( !PyArg_ParseTupleAndKeywords(args, kwds, kwd_type, kwd_list, &domid, &weight, &cap) ) return NULL; =20 @@ -1272,10 +1272,10 @@ static PyObject *pyxc_sched_credit_domain_get(XcObj= ect *self, PyObject *args) { uint32_t domid; struct xen_domctl_sched_credit sdom; - =20 + if( !PyArg_ParseTuple(args, "I", &domid) ) return NULL; - =20 + if ( xc_sched_credit_domain_get(self->xc_handle, domid, &sdom) !=3D 0 ) return pyxc_error_to_exception(self->xc_handle); =20 @@ -1336,7 +1336,7 @@ static PyObject *pyxc_domain_setmaxmem(XcObject *self= , PyObject *args) =20 if (xc_domain_setmaxmem(self->xc_handle, dom, maxmem_kb) !=3D 0) return pyxc_error_to_exception(self->xc_handle); - =20 + Py_INCREF(zero); return zero; } @@ -1349,12 +1349,12 @@ static PyObject *pyxc_domain_set_target_mem(XcObjec= t *self, PyObject *args) if (!PyArg_ParseTuple(args, "ii", &dom, &mem_kb)) return NULL; =20 - mem_pages =3D mem_kb / 4;=20 + mem_pages =3D mem_kb / 4; =20 if (xc_domain_set_pod_target(self->xc_handle, dom, mem_pages, NULL, NULL, NULL) !=3D 0) return pyxc_error_to_exception(self->xc_handle); - =20 + Py_INCREF(zero); return zero; } @@ -1369,7 +1369,7 @@ static PyObject *pyxc_domain_set_memmap_limit(XcObjec= t *self, PyObject *args) =20 if ( xc_domain_set_memmap_limit(self->xc_handle, dom, maplimit_kb) != =3D 0 ) return pyxc_error_to_exception(self->xc_handle); - =20 + Py_INCREF(zero); return zero; } @@ -1383,7 +1383,7 @@ static PyObject *pyxc_domain_ioport_permission(XcObje= ct *self, =20 static char *kwd_list[] =3D { "domid", "first_port", "nr_ports", "allo= w_access", NULL }; =20 - if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiii", kwd_list,=20 + if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiii", kwd_list, &dom, &first_port, &nr_ports, &allow= _access) ) return NULL; =20 @@ -1406,7 +1406,7 @@ static PyObject *pyxc_domain_irq_permission(PyObject = *self, =20 static char *kwd_list[] =3D { "domid", "pirq", "allow_access", NULL }; =20 - if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iii", kwd_list,=20 + if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iii", kwd_list, &dom, &pirq, &allow_access) ) return NULL; =20 @@ -1429,7 +1429,7 @@ static PyObject *pyxc_domain_iomem_permission(PyObjec= t *self, =20 static char *kwd_list[] =3D { "domid", "first_pfn", "nr_pfns", "allow_= access", NULL }; =20 - if ( !PyArg_ParseTupleAndKeywords(args, kwds, "illi", kwd_list,=20 + if ( !PyArg_ParseTupleAndKeywords(args, kwds, "illi", kwd_list, &dom, &first_pfn, &nr_pfns, &allow_a= ccess) ) return NULL; =20 @@ -1480,7 +1480,7 @@ static PyObject *pyxc_domain_send_trigger(XcObject *s= elf, =20 static char *kwd_list[] =3D { "domid", "trigger", "vcpu", NULL }; =20 - if ( !PyArg_ParseTupleAndKeywords(args, kwds, "ii|i", kwd_list,=20 + if ( !PyArg_ParseTupleAndKeywords(args, kwds, "ii|i", kwd_list, &dom, &trigger, &vcpu) ) return NULL; =20 @@ -1534,7 +1534,7 @@ static PyObject *pyxc_dom_set_memshr(XcObject *self, = PyObject *args) =20 if (xc_memshr_control(self->xc_handle, dom, enable) !=3D 0) return pyxc_error_to_exception(self->xc_handle); - =20 + Py_INCREF(zero); return zero; } @@ -1758,11 +1758,11 @@ static PyObject *pyflask_sid_to_context(PyObject *s= elf, PyObject *args, if (!xc_handle) { return PyErr_SetFromErrno(xc_error_obj); } - =20 + ret =3D xc_flask_sid_to_context(xc_handle, sid, ctx, ctx_len); - =20 + xc_interface_close(xc_handle); - =20 + if ( ret !=3D 0 ) { errno =3D -ret; return PyErr_SetFromErrno(xc_error_obj); @@ -1779,7 +1779,7 @@ static PyObject *pyflask_load(PyObject *self, PyObjec= t *args, PyObject *kwds) int ret; =20 static char *kwd_list[] =3D { "policy", NULL }; - =20 + if( !PyArg_ParseTupleAndKeywords(args, kwds, "s#", kwd_list, &policy, = &len) ) return NULL; =20 @@ -1809,11 +1809,11 @@ static PyObject *pyflask_getenforce(PyObject *self) if (!xc_handle) { return PyErr_SetFromErrno(xc_error_obj); } - =20 + ret =3D xc_flask_getenforce(xc_handle); - =20 + xc_interface_close(xc_handle); - =20 + if ( ret < 0 ) { errno =3D -ret; return PyErr_SetFromErrno(xc_error_obj); @@ -1839,11 +1839,11 @@ static PyObject *pyflask_setenforce(PyObject *self,= PyObject *args, if (!xc_handle) { return PyErr_SetFromErrno(xc_error_obj); } - =20 + ret =3D xc_flask_setenforce(xc_handle, mode); - =20 + xc_interface_close(xc_handle); - =20 + if ( ret !=3D 0 ) { errno =3D -ret; return PyErr_SetFromErrno(xc_error_obj); @@ -1861,7 +1861,7 @@ static PyObject *pyflask_access(PyObject *self, PyObj= ect *args, uint32_t req, allowed, decided, auditallow, auditdeny, seqno; int ret; =20 - static char *kwd_list[] =3D { "src_context", "tar_context",=20 + static char *kwd_list[] =3D { "src_context", "tar_context", "tar_class", "req_permissions", "decided", "auditallow","auditdeny", "seqno", NULL }; @@ -1875,10 +1875,10 @@ static PyObject *pyflask_access(PyObject *self, PyO= bject *args, if (!xc_handle) { return PyErr_SetFromErrno(xc_error_obj); } - =20 + ret =3D xc_flask_access(xc_handle, scon, tcon, tclass, req, &allowed, = &decided, &auditallow, &auditdeny, &seqno); - =20 + xc_interface_close(xc_handle); =20 if ( ret !=3D 0 ) { @@ -1890,14 +1890,14 @@ static PyObject *pyflask_access(PyObject *self, PyO= bject *args, } =20 static PyMethodDef pyxc_methods[] =3D { - { "domain_create",=20 - (PyCFunction)pyxc_domain_create,=20 + { "domain_create", + (PyCFunction)pyxc_domain_create, METH_VARARGS | METH_KEYWORDS, "\n" "Create a new domain.\n" " dom [int, 0]: Domain identifier to use (allocated if zer= o).\n" "Returns: [int] new domain identifier; -1 on error.\n" }, =20 - { "domain_max_vcpus",=20 + { "domain_max_vcpus", (PyCFunction)pyxc_domain_max_vcpus, METH_VARARGS, "\n" "Set the maximum number of VCPUs a domain may create.\n" @@ -1905,43 +1905,43 @@ static PyMethodDef pyxc_methods[] =3D { " max [int, 0]: New maximum number of VCPUs in domain.\n" "Returns: [int] 0 on success; -1 on error.\n" }, =20 - { "domain_dumpcore",=20 - (PyCFunction)pyxc_domain_dumpcore,=20 + { "domain_dumpcore", + (PyCFunction)pyxc_domain_dumpcore, METH_VARARGS, "\n" "Dump core of a domain.\n" " dom [int]: Identifier of domain to dump core of.\n" " corefile [string]: Name of corefile to be created.\n\n" "Returns: [int] 0 on success; -1 on error.\n" }, =20 - { "domain_pause",=20 - (PyCFunction)pyxc_domain_pause,=20 + { "domain_pause", + (PyCFunction)pyxc_domain_pause, METH_VARARGS, "\n" "Temporarily pause execution of a domain.\n" " dom [int]: Identifier of domain to be paused.\n\n" "Returns: [int] 0 on success; -1 on error.\n" }, =20 - { "domain_unpause",=20 - (PyCFunction)pyxc_domain_unpause,=20 + { "domain_unpause", + (PyCFunction)pyxc_domain_unpause, METH_VARARGS, "\n" "(Re)start execution of a domain.\n" " dom [int]: Identifier of domain to be unpaused.\n\n" "Returns: [int] 0 on success; -1 on error.\n" }, =20 - { "domain_destroy",=20 - (PyCFunction)pyxc_domain_destroy,=20 + { "domain_destroy", + (PyCFunction)pyxc_domain_destroy, METH_VARARGS, "\n" "Destroy a domain.\n" " dom [int]: Identifier of domain to be destroyed.\n\n" "Returns: [int] 0 on success; -1 on error.\n" }, =20 - { "domain_destroy_hook",=20 - (PyCFunction)pyxc_domain_destroy_hook,=20 + { "domain_destroy_hook", + (PyCFunction)pyxc_domain_destroy_hook, METH_VARARGS, "\n" "Add a hook for arch stuff before destroy a domain.\n" " dom [int]: Identifier of domain to be destroyed.\n\n" "Returns: [int] 0 on success; -1 on error.\n" }, =20 - { "domain_resume",=20 + { "domain_resume", (PyCFunction)pyxc_domain_resume, METH_VARARGS, "\n" "Resume execution of a suspended domain.\n" @@ -1949,7 +1949,7 @@ static PyMethodDef pyxc_methods[] =3D { " fast [int]: Use cooperative resume.\n\n" "Returns: [int] 0 on success; -1 on error.\n" }, =20 - { "domain_shutdown",=20 + { "domain_shutdown", (PyCFunction)pyxc_domain_shutdown, METH_VARARGS, "\n" "Shutdown a domain.\n" @@ -1957,8 +1957,8 @@ static PyMethodDef pyxc_methods[] =3D { " reason [int, 0]: Reason for shutdown.\n" "Returns: [int] 0 on success; -1 on error.\n" }, =20 - { "vcpu_setaffinity",=20 - (PyCFunction)pyxc_vcpu_setaffinity,=20 + { "vcpu_setaffinity", + (PyCFunction)pyxc_vcpu_setaffinity, METH_VARARGS | METH_KEYWORDS, "\n" "Pin a VCPU to a specified set CPUs.\n" " dom [int]: Identifier of domain to which VCPU belongs.\n" @@ -1966,7 +1966,7 @@ static PyMethodDef pyxc_methods[] =3D { " cpumap [list, []]: list of usable CPUs.\n\n" "Returns: [int] 0 on success; -1 on error.\n" }, =20 - { "domain_sethandle",=20 + { "domain_sethandle", (PyCFunction)pyxc_domain_sethandle, METH_VARARGS, "\n" "Set domain's opaque handle.\n" @@ -1974,8 +1974,8 @@ static PyMethodDef pyxc_methods[] =3D { " handle [list of 16 ints]: New opaque handle.\n" "Returns: [int] 0 on success; -1 on error.\n" }, =20 - { "domain_getinfo",=20 - (PyCFunction)pyxc_domain_getinfo,=20 + { "domain_getinfo", + (PyCFunction)pyxc_domain_getinfo, METH_VARARGS | METH_KEYWORDS, "\n" "Get information regarding a set of domains, in increasing id order.= \n" " first_dom [int, 0]: First domain to retrieve info about.\n" @@ -2000,8 +2000,8 @@ static PyMethodDef pyxc_methods[] =3D { "reason why it shut itself down.\n" " cpupool [int] Id of cpupool domain is bound to.\n" }, =20 - { "vcpu_getinfo",=20 - (PyCFunction)pyxc_vcpu_getinfo,=20 + { "vcpu_getinfo", + (PyCFunction)pyxc_vcpu_getinfo, METH_VARARGS | METH_KEYWORDS, "\n" "Get information regarding a VCPU.\n" " dom [int]: Domain to retrieve info about.\n" @@ -2025,7 +2025,7 @@ static PyMethodDef pyxc_methods[] =3D { " xenstore_domid [int]: \n" "Returns: None on success. Raises exception on error.\n" }, =20 - { "hvm_get_param",=20 + { "hvm_get_param", (PyCFunction)pyxc_hvm_param_get, METH_VARARGS | METH_KEYWORDS, "\n" "get a parameter of HVM guest OS.\n" @@ -2033,7 +2033,7 @@ static PyMethodDef pyxc_methods[] =3D { " param [int]: No. of HVM param.\n" "Returns: [long] value of the param.\n" }, =20 - { "hvm_set_param",=20 + { "hvm_set_param", (PyCFunction)pyxc_hvm_param_set, METH_VARARGS | METH_KEYWORDS, "\n" "set a parameter of HVM guest OS.\n" @@ -2076,12 +2076,12 @@ static PyMethodDef pyxc_methods[] =3D { " dom [int]: Domain to deassign device from.\n" " pci_str [str]: PCI devices.\n" "Returns: [int] 0 on success, or device bdf that can't be deassigne= d.\n" }, - =20 + { "sched_id_get", (PyCFunction)pyxc_sched_id_get, METH_NOARGS, "\n" "Get the current scheduler type in use.\n" - "Returns: [int] sched_id.\n" }, =20 + "Returns: [int] sched_id.\n" }, =20 { "sched_credit_domain_set", (PyCFunction)pyxc_sched_credit_domain_set, @@ -2119,7 +2119,7 @@ static PyMethodDef pyxc_methods[] =3D { "Returns: [dict]\n" " weight [short]: domain's scheduling weight\n"}, =20 - { "evtchn_alloc_unbound",=20 + { "evtchn_alloc_unbound", (PyCFunction)pyxc_evtchn_alloc_unbound, METH_VARARGS | METH_KEYWORDS, "\n" "Allocate an unbound port that will await a remote connection.\n" @@ -2127,7 +2127,7 @@ static PyMethodDef pyxc_methods[] =3D { " remote_dom [int]: Remote domain to accept connections from.\n\n" "Returns: [int] Unbound event-channel port.\n" }, =20 - { "evtchn_reset",=20 + { "evtchn_reset", (PyCFunction)pyxc_evtchn_reset, METH_VARARGS | METH_KEYWORDS, "\n" "Reset all connections.\n" @@ -2152,9 +2152,9 @@ static PyMethodDef pyxc_methods[] =3D { " func [int]: PCI function\n" " enable [int]: Non-zero means enable access; else disable access\n\= n" "Returns: [int] 0 on success; -1 on error.\n" }, -=20 - { "readconsolering",=20 - (PyCFunction)pyxc_readconsolering,=20 + + { "readconsolering", + (PyCFunction)pyxc_readconsolering, METH_VARARGS | METH_KEYWORDS, "\n" "Read Xen's console ring.\n" " clear [int, 0]: Bool - clear the ring after reading from it?\n\n" @@ -2202,40 +2202,40 @@ static PyMethodDef pyxc_methods[] =3D { "Returns [str]: Xen buildid" " [None]: on failure.\n" }, =20 - { "shadow_control",=20 - (PyCFunction)pyxc_shadow_control,=20 + { "shadow_control", + (PyCFunction)pyxc_shadow_control, METH_VARARGS | METH_KEYWORDS, "\n" "Set parameter for shadow pagetable interface\n" " dom [int]: Identifier of domain.\n" " op [int, 0]: operation\n\n" "Returns: [int] 0 on success; -1 on error.\n" }, =20 - { "shadow_mem_control",=20 - (PyCFunction)pyxc_shadow_mem_control,=20 + { "shadow_mem_control", + (PyCFunction)pyxc_shadow_mem_control, METH_VARARGS | METH_KEYWORDS, "\n" "Set or read shadow pagetable memory use\n" " dom [int]: Identifier of domain.\n" " mb [int, -1]: MB of shadow memory this domain should have.\n\n" "Returns: [int] MB of shadow memory in use by this domain.\n" }, =20 - { "domain_setmaxmem",=20 - (PyCFunction)pyxc_domain_setmaxmem,=20 + { "domain_setmaxmem", + (PyCFunction)pyxc_domain_setmaxmem, METH_VARARGS, "\n" "Set a domain's memory limit\n" " dom [int]: Identifier of domain.\n" " maxmem_kb [int]: .\n" "Returns: [int] 0 on success; -1 on error.\n" }, =20 - { "domain_set_target_mem",=20 - (PyCFunction)pyxc_domain_set_target_mem,=20 + { "domain_set_target_mem", + (PyCFunction)pyxc_domain_set_target_mem, METH_VARARGS, "\n" "Set a domain's memory target\n" " dom [int]: Identifier of domain.\n" " mem_kb [int]: .\n" "Returns: [int] 0 on success; -1 on error.\n" }, =20 - { "domain_set_memmap_limit",=20 - (PyCFunction)pyxc_domain_set_memmap_limit,=20 + { "domain_set_memmap_limit", + (PyCFunction)pyxc_domain_set_memmap_limit, METH_VARARGS, "\n" "Set a domain's physical memory mapping limit\n" " dom [int]: Identifier of domain.\n" @@ -2309,7 +2309,7 @@ static PyMethodDef pyxc_methods[] =3D { "Inject debug keys into Xen.\n" " keys [str]: String of keys to inject.\n" }, =20 - { "dom_set_memshr",=20 + { "dom_set_memshr", (PyCFunction)pyxc_dom_set_memshr, METH_VARARGS, "\n" "Enable/disable memory sharing for the domain.\n" @@ -2391,20 +2391,20 @@ static PyMethodDef pyxc_methods[] =3D { 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" },=20 - =20 + "Returns: [int]: 0 on success; -1 on failure.\n" }, + { "flask_getenforce", (PyCFunction)pyflask_getenforce, METH_NOARGS, "\n" "Returns the current mode of the Flask XSM module.\n" - "Returns: [int]: 0 for permissive; 1 for enforcing; -1 on failure.\n= " },=20 + "Returns: [int]: 0 for permissive; 1 for enforcing; -1 on failure.\n= " }, =20 { "flask_setenforce", (PyCFunction)pyflask_setenforce, 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" },=20 + "Returns: [int]: 0 on success; -1 on failure.\n" }, =20 { "flask_access", (PyCFunction)pyflask_access, @@ -2423,7 +2423,7 @@ static PyMethodDef pyxc_methods[] =3D { " auditdeny [int] permissions set to audit on deny\n" " seqno [int] not used\n" "Returns: [int]: 0 on all permission granted; -1 if any permissions = are \ - denied\n" },=20 + denied\n" }, =20 { NULL, NULL, 0, NULL } }; diff --git a/tools/python/xen/lowlevel/xs/xs.c b/tools/python/xen/lowlevel/= xs/xs.c index 3ba5a8b893d9..87f1187bb116 100644 --- a/tools/python/xen/lowlevel/xs/xs.c +++ b/tools/python/xen/lowlevel/xs/xs.c @@ -1,4 +1,4 @@ -/*=20 +/* * Python interface to the Xen Store Daemon. * * This library is free software; you can redistribute it and/or @@ -859,7 +859,7 @@ static void remove_watch(XsHandle *self, PyObject *toke= n) * Parse transaction and path arguments from the given args and kwds, * convert the given self value to an xs_handle, and return all three by * reference. - *=20 + * * @return 1 on success, in which case *xh, *th, and *path are valid, or 0= on * failure. */ diff --git a/tools/xenmon/xenmon.py b/tools/xenmon/xenmon.py index 977ada688771..1b357aed5127 100644 --- a/tools/xenmon/xenmon.py +++ b/tools/xenmon/xenmon.py @@ -13,12 +13,12 @@ # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; under version 2 of the License. -#=20 +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -#=20 +# # You should have received a copy of the GNU General Public License # along with this program; If not, see . ##################################################################### @@ -79,7 +79,7 @@ def setup_cmdline_parser(): parser.add_option("-p", "--prefix", dest=3D"prefix", default =3D "log", help=3D"prefix to use for output = files") parser.add_option("-t", "--time", dest=3D"duration", - action=3D"store", type=3D"int", default=3D10,=20 + action=3D"store", type=3D"int", default=3D10, help=3D"stop logging to file after this much time has elapsed = (in seconds). set to 0 to keep logging indefinitely") parser.add_option("-i", "--interval", dest=3D"interval", action=3D"store", type=3D"int", default=3D1000, @@ -179,7 +179,7 @@ class DomainInfo(object): return [total/(float(passed)/10**9), avg] =20 def stats(self, passed): - return [self.gotten_stats(passed), self.allocated_stats(passed), s= elf.blocked_stats(passed),=20 + return [self.gotten_stats(passed), self.allocated_stats(passed), s= elf.blocked_stats(passed), self.waited_stats(passed), self.ec_stats(passed), self.io_= stats(passed)] =20 # report values over desired interval @@ -187,13 +187,13 @@ def summarize(startat, endat, duration, samples): dominfos =3D {} for i in range(0, NDOMAINS): dominfos[i] =3D DomainInfo() - =20 + passed =3D 1 # to prevent zero division curid =3D startat numbuckets =3D 0 lost_samples =3D [] ffp_samples =3D [] - =20 + while passed < duration: for i in range(0, NDOMAINS): if dom_in_use[i]: @@ -203,7 +203,7 @@ def summarize(startat, endat, duration, samples): dominfos[i].blocked_sum +=3D samples[curid][3*NDOMAINS + i] dominfos[i].exec_count +=3D samples[curid][4*NDOMAINS + i] dominfos[i].iocount_sum +=3D samples[curid][5*NDOMAINS + i] - =20 + passed +=3D samples[curid][6*NDOMAINS] lost_samples.append(samples[curid][6*NDOMAINS + 2]) ffp_samples.append(samples[curid][6*NDOMAINS + 3]) @@ -271,7 +271,7 @@ def show_livestats(cpu): cpu_10sec_usage =3D 0.0 heartbeat =3D 1 global dom_in_use, options - =20 + # mmap the (the first chunk of the) file shmf =3D open(SHM_FILE, "r+") shm =3D mmap.mmap(shmf.fileno(), QOS_DATA_SIZE) @@ -284,7 +284,7 @@ def show_livestats(cpu): stdscr.keypad(1) stdscr.timeout(1000) [maxy, maxx] =3D stdscr.getmaxyx() - =20 + # display in a loop while True: =20 @@ -342,7 +342,7 @@ def show_livestats(cpu): cpuidx =3D cpuidx + 1 =20 # calculate starting and ending datapoints; never look at "next" s= ince - # it represents live data that may be in transition.=20 + # it represents live data that may be in transition. startat =3D next - 1 if next + 10 < NSAMPLES: endat =3D next + 10 @@ -374,7 +374,7 @@ def show_livestats(cpu): =20 if h1[dom][0][1] > 0 or domain_id[dom] =3D=3D IDLE_DOMAIN: # display gotten - row +=3D 1=20 + row +=3D 1 col =3D 2 display_domain_id(stdscr, row, col, domain_id[dom]) col +=3D 4 @@ -396,7 +396,7 @@ def show_livestats(cpu): =20 if dom !=3D IDLE_DOMAIN: cpu_1sec_usage =3D cpu_1sec_usage + h1[dom][0][1] - =20 + # display allocated if options.allocated: row +=3D 1 @@ -454,7 +454,7 @@ def show_livestats(cpu): row +=3D 1 col =3D 2 display_domain_id(stdscr, row, col, domain_id[dom]) - =20 + col +=3D 28 display(stdscr, row, col, "%d/s" % h2[dom][4]) col +=3D 42 @@ -490,14 +490,14 @@ def show_livestats(cpu): display(stdscr, row, 1, star) display(stdscr, row, 2, TOTALS % (total_h2_cpu, total_h1_cpu)) row +=3D 1 -# display(stdscr, row, 2,=20 -# "\tFFP: %d (Min: %d, Max: %d)\t\t\tFFP: %d (Min: %d, Max = %d)" %=20 +# display(stdscr, row, 2, +# "\tFFP: %d (Min: %d, Max: %d)\t\t\tFFP: %d (Min: %d, Max = %d)" % # (math.ceil(f2[1]), f2[0], f2[2], math.ceil(f1[1]), f1[0],= f1[2]), _c.A_BOLD) =20 if l1[1] > 1 : row +=3D 1 - display(stdscr, row, 2,=20 - "\tRecords lost: %d (Min: %d, Max: %d)\t\t\tRecords lo= st: %d (Min: %d, Max %d)" %=20 + display(stdscr, row, 2, + "\tRecords lost: %d (Min: %d, Max: %d)\t\t\tRecords lo= st: %d (Min: %d, Max %d)" % (math.ceil(l2[1]), l2[0], l2[2], math.ceil(l1[1]), l1[= 0], l1[2]), _c.A_BOLD) =20 # grab a char from tty input; exit if interrupt hit @@ -505,11 +505,11 @@ def show_livestats(cpu): c =3D stdscr.getch() except: break - =20 + # q =3D quit if c =3D=3D ord('q'): break - =20 + # c =3D cycle to a new cpu of interest if c =3D=3D ord('c'): cpu =3D (cpu + 1) % ncpu @@ -560,7 +560,7 @@ class Delayed(object): def close(self): if self.opened: self.file.close() - =20 + =20 def writelog(): global options @@ -639,7 +639,7 @@ def writelog(): h1[dom][1], h1[dom][2][0], h1[dom][2][1], h1[dom]= [2][2], h1[dom][3][0], h1[dom][3][1], h1[dom]= [3][2], - h1[dom][4],=20 + h1[dom][4], h1[dom][5][0], h1[dom][5][1])) outfiles[dom].flush() curr =3D time.time() @@ -698,7 +698,7 @@ def main(): options.mspersample > options.duration * 1000: parser.error("option --ms_per_sample: too large (> %d ms)" % (options.duration * 1000)) - =20 + start_xenbaked() if options.live: show_livestats(options.cpu) --=20 2.30.2 From nobody Sat May 18 20:15:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1678803382; cv=none; d=zohomail.com; s=zohoarc; b=RIPDxtjWUV/kd9WQfF0HWkupy9o7GFVkf1nVCOKo5Bn3sE1UaUcgDfaqGLwv6ZiGvZTrJvibMgvxP8pkZiR8rslcV1W6nB+sYnnEpvTV8UNfwIreY4BjFP8SvfU/fR04DayB6CLuZ0dUhnDGNcSgoQrpoHUOb3yQdxNfz3x6tlo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678803382; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Q3Oq+0WFo61GS2rSMbrk9Mql3HX7S5wKZYFBokLY3gY=; b=QB2PLyouEt7fY8U+HmJLiIzBQHO4NSFo/sFBufYsK30iH1m0fOwyd8NtSU+0ASSbBDfVWF6fyqfzWNFKRZkYSY9LkKmTj+YqST4X75Z971zOIQtri6mr2VoOoYErkt+yvAnmw7v7T0M37MHnVIkb1oUA9VMWWov8cedis401CTY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1678803382055411.75005993692764; Tue, 14 Mar 2023 07:16:22 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.509634.785782 (Exim 4.92) (envelope-from ) id 1pc5RU-00068O-PT; Tue, 14 Mar 2023 14:15:56 +0000 Received: by outflank-mailman (output) from mailman id 509634.785782; Tue, 14 Mar 2023 14:15:56 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pc5RU-00068F-Mi; Tue, 14 Mar 2023 14:15:56 +0000 Received: by outflank-mailman (input) for mailman id 509634; Tue, 14 Mar 2023 14:15:55 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pc5RT-0004aK-Dv for xen-devel@lists.xenproject.org; Tue, 14 Mar 2023 14:15:55 +0000 Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com [216.71.155.175]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id b9d06bc2-c272-11ed-b464-930f4c7d94ae; Tue, 14 Mar 2023 15:15:53 +0100 (CET) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: b9d06bc2-c272-11ed-b464-930f4c7d94ae DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1678803353; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=D6P/0Ux22KKUfuQOSNSwL3QP/V9gYzj/MuXrDUsbGVw=; b=gvDKIhkkxXMXRYel7qDTFTIdzB2+qvovqEysmOdLlQp/lxQcOT44AlZY 5v2DO1BaI7qz30FSsSaKIv7CpErr3DTlqrXWwGeB96eLllf7J/ienqHeg omkYEwUGeW3G5r9XAW6FzBy6gG4j5YddQ2oasYYN8i7SdJweyBSuqyAzI s=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 100156184 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.123 X-Policy: $RELAYED IronPort-Data: A9a23:PEw446PozVcs5IzvrR28l8FynXyQoLVcMsEvi/4bfWQNrUoi0jMHy WcWD22OOveIMTajeNx1PYi/8EpSuMPQxtBqGwto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v 63yTvGacajYm1eF/k/F3oDJ9CU6jufQAOKnUoYoAwgpLSd8UiAtlBl/rOAwh49skLCRDhiE/ Nj/uKUzAnf8s9JPGj9SuvLrRC9H5qyo42tD5wBmP5ingXeF/5UrJMNHTU2OByOQrrl8RoaSW +vFxbelyWLVlz9F5gSNy+uTnuUiG9Y+DCDW4pZkc/HKbitq/0Te5p0TJvsEAXq7vh3S9zxHJ HehgrTrIeshFvWkdO3wyHC0GQkmVUFN0OevzXRSLaV/ZqAJGpfh66wGMa04AWEX0r1eQnBor cMpExJXVhClus+Qx4K8S9A506zPLOGzVG8eknRpzDWfBvc6W5HTBa7N4Le03h9p2JoIR6yHI ZNEN3w2Nk+ojx5nYz/7DLoXmuuyi2a5WDpfsF+P/oI84nTJzRw327/oWDbQUoXSHZwIwB/I+ goq+UzoPhAYbs2iwACD1S6dibbs2nr7XLodQejQGvlC3wTImz175ActfUu2p7y1h1CzX/pbK lcI4Ww+oK4q7kupQ9LhGRqirxasoRo0S9dWVeog52mlz6PO5g+DC2ssTzhfaccnvss7WTwr0 FCSm9rjQzdotdWopWm1r+nO62noYG5McDFEPHVfJecY3zX9iNoazQPpFulSK4zvtt3TJBzWx ACNrRFr0t3/kvU3/6m8+FnGhRelqZ7IUhM5623rY4610u9qTNX7PtL1sDA3+d4Fdd/EFQfZ4 BDojuDEtIgz4YexeDthqQnnNJWg/L67PTLVmjaD9LFxpm32qxZPkW29iQySxXuF0O5eJFcFg 2eJ42u9AaO/21P7BZKbm6rrV6wXIVHITLwJrMz8YNtUeYRWfwSa5ixobkP49zmzzxhzyvtgY 83GKJ/E4ZMm5UNPnVKLqxo1i+d3lkjSO0uKLXwE8/hX+eXHPyPEIVv0GFCPcvo4/Mu5nekhy P4Gb5Hi40wGAIXDjtz/rdZ7waYicSJqWvgbaqV/Koa+H+aRMDpxU66Ike5/JtwNcmY8vr6gw 0xRk3RwkDLX7UAr4y3QMxiPtJuHsU5DkE8G IronPort-HdrOrdr: A9a23:rBQX065y1YW9Mg6raAPXwPDXdLJyesId70hD6qhwISY6TiX+rb HWoB17726TtN9/YhEdcLy7VJVoBEmskKKdgrNhWotKPjOW21dARbsKheCJrgEIWReOktK1vZ 0QC5SWY+eQMbEVt6nHCXGDYrQd/OU= X-IronPort-AV: E=Sophos;i="5.98,260,1673931600"; d="scan'208";a="100156184" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Wei Liu , "Anthony PERARD" , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Bernhard Kaindl Subject: [PATCH 4/7] tools/pygrub: Factor out common setup.py parts Date: Tue, 14 Mar 2023 14:15:17 +0000 Message-ID: <20230314141520.3652451-5-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230314141520.3652451-1-andrew.cooper3@citrix.com> References: <20230314141520.3652451-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1678803387398100001 ... to mirror the tools/python side in c/s 2b8314a3c354. No functional change. Signed-off-by: Andrew Cooper Reviewed-by: Anthony PERARD --- CC: Wei Liu CC: Anthony PERARD CC: Marek Marczykowski-G=C3=B3recki CC: Bernhard Kaindl --- tools/pygrub/Makefile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/pygrub/Makefile b/tools/pygrub/Makefile index 37b214621492..29ad0513212f 100644 --- a/tools/pygrub/Makefile +++ b/tools/pygrub/Makefile @@ -6,19 +6,20 @@ PY_CFLAGS =3D $(CFLAGS) $(PY_NOOPT_CFLAGS) PY_LDFLAGS =3D $(SHLIB_LDFLAGS) $(APPEND_LDFLAGS) INSTALL_LOG =3D build/installed_files.txt =20 +setup.py =3D CC=3D"$(CC)" CFLAGS=3D"$(PY_CFLAGS)" LDSHARED=3D"$(CC)" LDFLA= GS=3D"$(PY_LDFLAGS)" \ + $(PYTHON) setup.py + .PHONY: all all: build .PHONY: build build: - CC=3D"$(CC)" CFLAGS=3D"$(PY_CFLAGS)" LDSHARED=3D"$(CC)" LDFLAGS=3D"$(PY_L= DFLAGS)" $(PYTHON) setup.py build + $(setup.py) build =20 .PHONY: install install: all $(INSTALL_DIR) $(DESTDIR)/$(bindir) - CC=3D"$(CC)" CFLAGS=3D"$(PY_CFLAGS)" LDSHARED=3D"$(CC)" \ - LDFLAGS=3D"$(PY_LDFLAGS)" $(PYTHON) setup.py install \ - --record $(INSTALL_LOG) $(PYTHON_PREFIX_ARG) \ - --root=3D"$(DESTDIR)" --install-scripts=3D$(LIBEXEC_BIN) --force + $(setup.py) install --record $(INSTALL_LOG) $(PYTHON_PREFIX_ARG) \ + --root=3D"$(DESTDIR)" --install-scripts=3D$(LIBEXEC_BIN) --force set -e; if [ $(bindir) !=3D $(LIBEXEC_BIN) -a \ "`readlink -f $(DESTDIR)/$(bindir)`" !=3D \ "`readlink -f $(LIBEXEC_BIN)`" ]; then \ --=20 2.30.2 From nobody Sat May 18 20:15:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1678803366; cv=none; d=zohomail.com; s=zohoarc; b=EFDJIRtdaM4os40cHp5662eKi6cECzPYvjuWiXWV6nyzpVZEj+aR/tfxFMVQYDM8MJyg7OnrfUVhsdqZ9iTfRGOnLchPR2Osn8XCqpP2lnoqhFRxfXc5HB3mZsx7ko/GbYx/hMl01ZAl1Ja3nJNaO+BiQfIw6LZ9S6xpKDjiZjk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678803366; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=H6LnLEqOMEsDvMla5Hbmzrz9cOtemU6TlrRvcQxKhDc=; b=g3Pl2v0xTYfuVfhk4T982r6Qosro6x/cLXFRjIJVa8wpaCzcpSu3FFlrDI8CM2MpXFWuxl8V6LXpoTBuOCccmicdmXajOH5u5wjXRS/yqmNetOjBWfrohajkUT36t4RVb5jBnoD9OM4zqYPSojA8FzZWBe/H566U44rFAsOWFqc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1678803366750694.3407445144992; Tue, 14 Mar 2023 07:16:06 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.509633.785772 (Exim 4.92) (envelope-from ) id 1pc5RD-0005KZ-Ha; Tue, 14 Mar 2023 14:15:39 +0000 Received: by outflank-mailman (output) from mailman id 509633.785772; Tue, 14 Mar 2023 14:15:39 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pc5RD-0005KM-C5; Tue, 14 Mar 2023 14:15:39 +0000 Received: by outflank-mailman (input) for mailman id 509633; Tue, 14 Mar 2023 14:15:38 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pc5RB-0004aK-Ql for xen-devel@lists.xenproject.org; Tue, 14 Mar 2023 14:15:37 +0000 Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com [216.71.145.153]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id af971267-c272-11ed-b464-930f4c7d94ae; Tue, 14 Mar 2023 15:15:36 +0100 (CET) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: af971267-c272-11ed-b464-930f4c7d94ae DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1678803336; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=A8tFjeqpaYYMHH549QY+2fBsFMwY3Y1/gunP80ksQ5U=; b=iamMQcwBJqX52bMALeR8BESFaQpQGlvoxdlvQduGRXVd4u69UOj2Euys V8lJGjLpYSJS7TAllH8vGxPXeFyAfCRjjikapV7fuvNLViA1N36/s33jU WrgbJchGQmcbEZS7a4eDddg3u0BMN/kmbfQC2/leKh800/Vk5sWwnGxwg U=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 100695474 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.123 X-Policy: $RELAYED IronPort-Data: A9a23:Y9OkbK5SZrjyYQxCuhtZawxRtCbHchMFZxGqfqrLsTDasY5as4F+v mcfXT2HM6ncYWL0c4hzbtuz9EgAvJeEyNZiTVBs/ilnHi5G8cbLO4+Ufxz6V8+wwm8vb2o8t plDNYOQRCwQZiWBzvt4GuG59RGQ7YnRGvynTraCYnsrLeNdYH9JoQp5nOIkiZJfj9G8Agec0 fv/uMSaM1K+s9JOGjt8B5mr9VU+7JwehBtC5gZlPasS4AeE/5UoJMl3yZ+ZfiOQrrZ8RoZWd 86bpJml82XQ+QsaC9/Nut4XpWVTH9Y+lSDX4pZnc/DKbipq/0Te4Y5iXBYoUm9Fii3hojxE4 I4lWapc6+seFvakdOw1C3G0GszlVEFM0OevzXOX6aR/w6BaGpdFLjoH4EweZOUlFuhL7W5m5 a0IJRQIbEi6l7i9w7e3RMV2pJw5I5y+VG8fkikIITDxCP8nRdbIQrnQ5M8e1zA17ixMNa+AP YxDM2MpNUmeJUQVYT/7C7pn9AusrlD5fydVtxS+oq0v7nKI5AdwzKLsIJzefdniqcB9xx7A+ DObozulav0cHN6Y6jOb00mUvPaVx3ukY6gyGr+g98c/1TV/wURMUUZLBDNXu8KRmkO4Ht5SN UEQ0i4vtrQpslymSMHnWB+1q2LCuQQTM/JPF8Uq5QfLzbDbiy6cD3IBRyRMa/QnstE3Xj0g0 lKVn9LvCidrubfTQnWYnop4thvrZ3JTdzVbI3ZZE01cuYKLTJwPYgznXodzHYqwjIXMCWv7w DWGogQkpe0Jgptev0mkxmzvjzWpr5nPawc64ATLQ26ohj9EiJ6Zi5+AsgaCs6sZRGqNZhzY5 SVfxZDChAwbJcvV/BFhVtnhC11ACxytFDTHyWBiEJA6n9hG0y7yJNsAiN2SyaoADyrlRdMLS BWO0e+yzMUJVJdPUUOQS9PZNijS5fK8fekJr9iNBja0XrB/dRWc4AZlblOK0mbmnSAEyP9ga cjAK5n2VytDUMyLKQZaoM9MuYLHOwhknT+DLXwF503PPUWiiI69Fu5ebQrmghER56KYugTFm +ti2z+x40wHCoXWO3CHmbP/2HhWdRDX87iq8Z0IHgNCSyI6cFwc5wj5muN5KtU1wvoIxo8lP BiVAydl9bY2vlWfQS3iV5ypQOmHsUpXxZ7jARERAA== IronPort-HdrOrdr: A9a23:yLvaFKHSa0ZdgASKpLqENMeALOsnbusQ8zAXPiFKOGdom6mj/P xG88506faZslsssTIb6LS90dC7IE80rKQU3WBzB8bBYOCFghrREGgK1+KLqQEIfReOk9K1vp 0OT0ERMrHN5BdB/KHHCaSDYrAd6cjC2pqBwc3Zy25pTQlsYa0l1QFkEQyWe3cGJzWuQaBJba ah2g== X-IronPort-AV: E=Sophos;i="5.98,260,1673931600"; d="scan'208";a="100695474" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Wei Liu , "Anthony PERARD" , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Bernhard Kaindl Subject: [PATCH 5/7] tools: Use -s for python shebangs Date: Tue, 14 Mar 2023 14:15:18 +0000 Message-ID: <20230314141520.3652451-6-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230314141520.3652451-1-andrew.cooper3@citrix.com> References: <20230314141520.3652451-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1678803369868100007 This is mandated by the Fedora packaging guidelines because it is a security vulnerability otherwise in suid scripts. It's a very good idea generally, because it prevents the users local python environment interfering from sys= tem packaged scripts. Signed-off-by: Andrew Cooper --- CC: Wei Liu CC: Anthony PERARD CC: Marek Marczykowski-G=C3=B3recki CC: Bernhard Kaindl --- tools/Rules.mk | 2 +- tools/pygrub/Makefile | 2 +- tools/python/Makefile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/Rules.mk b/tools/Rules.mk index 6e135387bd7e..18cf83f5be83 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -179,7 +179,7 @@ CFLAGS +=3D $(CFLAGS-y) CFLAGS +=3D $(EXTRA_CFLAGS_XEN_TOOLS) =20 INSTALL_PYTHON_PROG =3D \ - $(XEN_ROOT)/tools/python/install-wrap "$(PYTHON_PATH)" $(INSTALL_PROG) + $(XEN_ROOT)/tools/python/install-wrap "$(PYTHON_PATH) -s" $(INSTALL_PROG) =20 %.opic: %.c $(CC) $(CPPFLAGS) -DPIC $(CFLAGS) $(CFLAGS_$*.opic) -fPIC -c -o $@ $< $(A= PPEND_CFLAGS) diff --git a/tools/pygrub/Makefile b/tools/pygrub/Makefile index 29ad0513212f..04b3995cc0f6 100644 --- a/tools/pygrub/Makefile +++ b/tools/pygrub/Makefile @@ -7,7 +7,7 @@ PY_LDFLAGS =3D $(SHLIB_LDFLAGS) $(APPEND_LDFLAGS) INSTALL_LOG =3D build/installed_files.txt =20 setup.py =3D CC=3D"$(CC)" CFLAGS=3D"$(PY_CFLAGS)" LDSHARED=3D"$(CC)" LDFLA= GS=3D"$(PY_LDFLAGS)" \ - $(PYTHON) setup.py + $(PYTHON) setup.py --executable=3D"$(PYTHON_PATH) -s" =20 .PHONY: all all: build diff --git a/tools/python/Makefile b/tools/python/Makefile index cc764236478a..511e7deae409 100644 --- a/tools/python/Makefile +++ b/tools/python/Makefile @@ -12,7 +12,7 @@ setup.py =3D CC=3D"$(CC)" CFLAGS=3D"$(PY_CFLAGS)" LDSHARE= D=3D"$(CC)" LDFLAGS=3D"$(PY_LDFLA SHLIB_libxenctrl=3D"$(SHLIB_libxenctrl)" \ SHLIB_libxenguest=3D"$(SHLIB_libxenguest)" \ SHLIB_libxenstore=3D"$(SHLIB_libxenstore)" \ - $(PYTHON) setup.py + $(PYTHON) setup.py --executable=3D"$(PYTHON_PATH) -s" =20 .PHONY: build build: --=20 2.30.2 From nobody Sat May 18 20:15:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1678803384; cv=none; d=zohomail.com; s=zohoarc; b=FvjsF2qzxIGhODLdPuHib9Rq2Le/Dt7GFSGI+Xdaq+7BNAuD4P0Kb46LM6Fod4WKhrO4fyUGIpM5Ss1OdOeiQKW1pLzmF72N6qVqVmOfiiM/Z+w87QM8+r51lAJjto6XhDkGLcvVC2E13FcbPLzcObDtUr3p3q03/DfMnGXAap8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678803384; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=5jdnwbP0ETU2VMrLVXe/n7bGe57bPxSeEU9WZeiNZJc=; b=XtEv/pcARnjnI+DWd3YojMprHjRBUy3MiQg2R4Ohcd7cmk7R6gbq9brHMHfFqjNvJ22ubd6f2VB9wjU7q2SGvgi7nldhEl6gNLbLJ3qClt3Habs6mBVLJEHBUV83VesvvMJgd3Qk4UJnfpvxx1TW02dv+XYRmCv6bF8aBWW6a9g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 167880338479778.13253641327435; Tue, 14 Mar 2023 07:16:24 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.509635.785792 (Exim 4.92) (envelope-from ) id 1pc5RX-0006Uo-17; Tue, 14 Mar 2023 14:15:59 +0000 Received: by outflank-mailman (output) from mailman id 509635.785792; Tue, 14 Mar 2023 14:15:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pc5RW-0006Uf-Tm; Tue, 14 Mar 2023 14:15:58 +0000 Received: by outflank-mailman (input) for mailman id 509635; Tue, 14 Mar 2023 14:15:58 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pc5RV-0004aK-Su for xen-devel@lists.xenproject.org; Tue, 14 Mar 2023 14:15:58 +0000 Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com [216.71.155.175]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id bc186cb0-c272-11ed-b464-930f4c7d94ae; Tue, 14 Mar 2023 15:15:55 +0100 (CET) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: bc186cb0-c272-11ed-b464-930f4c7d94ae DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1678803355; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/9L7vCCTMH++1ZUbrE71ZPsBvnajhXkBbzMQNg2Y4gQ=; b=BXllIWgH1j69vRCGyd762wrmvR3fkl1xvzW/smZbYnaBU2CP0Nhs37Za rco5/Hz8iSNSuGxG3C8UyxgeNBtasL8aB75VIM00MDZOgYX1DnzIaPO+C ehVadrJ44ZXhIvWoYA6bqeRl9liFm0/SBb87V5TzdGMXToSXUvIk3CnzR g=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 100156187 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.123 X-Policy: $RELAYED IronPort-Data: A9a23:XbCDsaARLk3GLxVW/zHjw5YqxClBgxIJ4kV8jS/XYbTApDJ33jBWy mNKCmmAM//fajf1LY9yO4Wz8hhU6p/Ux4JnQQY4rX1jcSlH+JHPbTi7wuUcHAvJd5GeExg3h yk6QoOdRCzhZiaE/n9BCpC48T8nk/nOHuGmYAL9EngZbRd+Tys8gg5Ulec8g4p56fC0GArIs t7pyyHlEAbNNwVcbyRFu8pvlDs15K6p4GhB4gRkDRx2lAS2e0c9Xcp3yZ6ZdxMUcqEMdsamS uDKyq2O/2+x13/B3fv8z94X2mVTKlLjFVDmZkh+AsBOsTAbzsAG6Y4pNeJ0VKtio27hc+ada jl6ncfYpQ8BZsUgkQmGOvVSO3kW0aZuoNcrLZUj2CA6IoKvn3bEmp1T4E8K0YIwoc80EEcWy s0jCmo1bja+qsSx8LW6c7w57igjBJGD0II3v3hhyXfSDOo8QICFSKLPjTNa9G5u3IYUR6+YP pdHL2M1N3wsYDUWUrsTILs4kP2lmT/UdDpApUjOjaE2/3LS3Ep6172F3N/9I4TSHJgLxxbHz o7A11ShHzcdaveT9SrG3nuS2dDuxDPwVI1HQdVU8dY12QbOlwT/EiY+RVa95PW0lEO6c9ZeM FAPvDojq7Ao806mRcW7WAe3yFabujYMVtwWFPc1gCmIw7DR6hyUBUAFSCBAc90ssMIqRT0s2 USNltmvDjtq2IB5UlrEqO3S92nrf3FIcylbP3RsoRY5D8fL+6hwnzSXcedYMvSNjvvINBf38 zeLlX1r71kMtvIj26K+9FHBpjujoJnVUwI4jjnqsnKZAhBRP9D8OdHxgbTPxbMZddvCEAHd1 JQRs5LGhN3iG61hg8BkrA8lOLiyr8iIPzTH6bKEN8lwrm/9k5JPkG053d2fGKuLGpxZEdMKS BWJ0e+02HO0FCrCUEOPS9jtY/nGNIC5fTgfatjab8BVfr96fxKd8SdlaCa4hj6ywBd3y/5lY 8rCKK5A6Er27ow2pAdaus9HieN7rszA7Tq7qW/HI+SPjuPFOS/9pUYtO1qSdOEphJ65TPHu2 48HbaOikkwPONASlwGLqeb/23hWdylkbX03wuQLHtO+zv1OQzF5WqaBnO18K+SIXc19z4/1w 510YWcAoHKXuJENAVzSMRiPtJuHsU5DkE8G IronPort-HdrOrdr: A9a23:XFV++a5B3C85R6i8jgPXwPDXdLJyesId70hD6qhwISY6TiX+rb HWoB17726TtN9/YhEdcLy7VJVoBEmskKKdgrNhWotKPjOW21dARbsKheCJrgEIWReOktK1vZ 0QC5SWY+eQMbEVt6nHCXGDYrQd/OU= X-IronPort-AV: E=Sophos;i="5.98,260,1673931600"; d="scan'208";a="100156187" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Wei Liu , "Anthony PERARD" , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Bernhard Kaindl Subject: [PATCH 6/7] tools/python: Improve unit test handling Date: Tue, 14 Mar 2023 14:15:19 +0000 Message-ID: <20230314141520.3652451-7-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230314141520.3652451-1-andrew.cooper3@citrix.com> References: <20230314141520.3652451-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1678803393099100001 * Add X86_{CPUID,MSR}_POLICY_FORMAT checks which were missed previously. * Drop test_suite(). It hasn't been necessary since the Py2.3 era. * Drop the __main__ logic. This can't be used without manually adjusting = the include path, and `make test` knows how to do the right thing. * For `make test`, use `-v` to see which tests have been discovered and ru= n. Signed-off-by: Andrew Cooper Acked-by: Marek Marczykowski-G=C3=B3recki --- CC: Wei Liu CC: Anthony PERARD CC: Marek Marczykowski-G=C3=B3recki CC: Bernhard Kaindl --- tools/python/Makefile | 2 +- tools/python/xen/migration/tests.py | 14 ++------------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/tools/python/Makefile b/tools/python/Makefile index 511e7deae409..697299bf2802 100644 --- a/tools/python/Makefile +++ b/tools/python/Makefile @@ -36,7 +36,7 @@ uninstall: =20 .PHONY: test test: - LD_LIBRARY_PATH=3D$$(readlink -f ../libs/ctrl):$$(readlink -f ../xenstore= ) $(PYTHON) -m unittest discover + LD_LIBRARY_PATH=3D$$(readlink -f ../libs/ctrl):$$(readlink -f ../xenstore= ) $(PYTHON) -m unittest discover -v =20 .PHONY: clean clean: diff --git a/tools/python/xen/migration/tests.py b/tools/python/xen/migrati= on/tests.py index ff2768946bb5..f22e2c2b7cf0 100644 --- a/tools/python/xen/migration/tests.py +++ b/tools/python/xen/migration/tests.py @@ -26,6 +26,8 @@ class TestLibxc(unittest.TestCase): (libxc.X86_TSC_INFO_FORMAT, 24), (libxc.HVM_PARAMS_ENTRY_FORMAT, 16), (libxc.HVM_PARAMS_FORMAT, 8), + (libxc.X86_CPUID_POLICY_FORMAT, 24), + (libxc.X86_MSR_POLICY_FORMAT, 16), ): self.assertEqual(calcsize(fmt), sz) =20 @@ -40,15 +42,3 @@ class TestLibxl(unittest.TestCase): (libxl.EMULATOR_HEADER_FORMAT, 8), ): self.assertEqual(calcsize(fmt), sz) - - -def test_suite(): - suite =3D unittest.TestSuite() - - suite.addTest(unittest.makeSuite(TestLibxc)) - suite.addTest(unittest.makeSuite(TestLibxl)) - - return suite - -if __name__ =3D=3D "__main__": - unittest.main() --=20 2.30.2 From nobody Sat May 18 20:15:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1678803384; cv=none; d=zohomail.com; s=zohoarc; b=eOc+UtjxVVNLZYKeFr6dYczW0MlDbBvBlSIH5HqI8f5xsdchuMjj1uLjEUCoFFKvB5IDwlaSI9/oxJ21fubUpVLu1ULAmowcLUAvBpLx9fFu42JdPyahno7A0n+rhdDdHZNTP7a5oTwbQmaOjBkg+11cxLcUea8KO3pTW3fx5bw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678803384; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=jmBGehbJxybngOWh4ywuRq4zntSKp3q9DmQTiyyQoE4=; b=DFW72HrGR7Le+RWIo8N0mfHHCR4Liq1xxoTcyimYvlGVmRZdYh1AM9D5BlbQk/kn6oHFphSmZ0rK6iOEwjxa7A/wtVV/RMEKh6/Bs+2s2h5vqZlC66pYQ1YitsjFgzLFH89Jc0U7qW5oaUTEbhGq8nCZtpK17Te7iZFxEuRjHq0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1678803384553551.3397885337537; Tue, 14 Mar 2023 07:16:24 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.509637.785802 (Exim 4.92) (envelope-from ) id 1pc5RY-0006mf-Cn; Tue, 14 Mar 2023 14:16:00 +0000 Received: by outflank-mailman (output) from mailman id 509637.785802; Tue, 14 Mar 2023 14:16:00 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pc5RY-0006mS-9d; Tue, 14 Mar 2023 14:16:00 +0000 Received: by outflank-mailman (input) for mailman id 509637; Tue, 14 Mar 2023 14:15:58 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pc5RW-0004aQ-Cf for xen-devel@lists.xenproject.org; Tue, 14 Mar 2023 14:15:58 +0000 Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com [216.71.155.175]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id bc30a86f-c272-11ed-87f5-c1b5be75604c; Tue, 14 Mar 2023 15:15:57 +0100 (CET) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: bc30a86f-c272-11ed-87f5-c1b5be75604c DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1678803357; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RhC1mGV7dozUxwGGoY9ryBFu46grDUCVsN2pnDjVFLY=; b=UtsUDYG1DWZSxi8MqPKVMJGZ4R9BOM+mX9goABJdEl5Fj6fhyNofj2cZ Ecr13KBQjUWvL4DEBO7OSE2JkEsF2TatyyD6pFATae8LJFD3y5QHfr3um 8FhxFB6xhsGF3JucS4VuluB7R8iKdemv4UaqFUgnHzt87SOUoFjHowiv3 g=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 100156186 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.123 X-Policy: $RELAYED IronPort-Data: A9a23:QqEyzqkYSeZVGGazo6LU7Ubo5gyZJkRdPkR7XQ2eYbSJt1+Wr1Gzt xIWUDuHPP7fZmryftl3aou1808A7MWBy98yGQo5qnhkFyMWpZLJC+rCIxarNUt+DCFhoGFPt JxCN4aafKjYaleG+39B55C49SEUOZmgH+a6U6icfHgqH2eIcQ954Tp7gek1n4V0ttawBgKJq LvartbWfVSowFaYCEpNg064gE4p7aSaVA8w5ARkPqgQ5QOGzRH5MbpETU2PByqgKmVrNrbSq 9brlNmR4m7f9hExPdKp+p6TnpoiG+O60aCm0xK6aoD66vRwjnVaPpUTbZLwXXx/mTSR9+2d/ f0W3XCGpaXFCYWX8AgVe0Ew/yiTpsSq8pefSZS0mZT7I0Er7xIAahihZa07FdRwxwp5PY1B3 acxayErNi+yvMDs+LKdd8RKgfQkLfC+aevzulk4pd3YJfMvQJSFSKTW/95Imjw3g6iiH96HO ZBfM2A2Kk2dPVsWYAx/5JEWxY9EglHWdTFCpU3Tjq0w+2XJlyR60aT3McqTcduPLSlQth/A/ juboT2pXHn2MvSv7iqryHmggtbPlHOhXINOTZGzr9V11Qj7Kms7V0RNCArTTeOCol6zXZdTJ lIZ/gIqrLMu7wq7Q9/lRRq6rXWY+BkGVLJ4DOkS+AyLjK3O7G6xA2EeSzdbZd8OtckoRCcr3 FuEg9PoAzN0tLSfD3ma89+pQSiaYHZPazVYPGldEFVDuoO4yG0usv7RZo1KU7+T1uLEIhOq+ zCskQUYgIUUjPdegs1X4mv7qz6ro5HISCs86QPWQn+p42tFWWK1W2C7wQOFtKgdde51WnHE5 SFZwJbGsIjiGLnXzESwrPMx8KZFDhpvGBnVmhZREpYo7FxBEFbzLNkLsFmSyKqEW/vomAMFg meJ5Gu9B7cJZhNGiJObhKrgY/nGNYC6SbzYugn8N7KimKRZeg6d5z1JbkWNxW3rm0VEufhhZ sfEKpzzVyxHUP0PIN+KqwA1gNcWKt0WnzuPFfgXMTz+uVZhWJJlYehcawbfBgzIxKiFvB/U4 75iCid+8D0GCLeWSnCOoeYuwaUicSBT6Wbe95YGKYZu42NORAkcNhMm6ehxI908z/kLy7egE 7PUchYw9WcTTEbvcW2iAk2Popu2BcsXQa4TVcD0AWuV5g== IronPort-HdrOrdr: A9a23:EfCRlKoj0lwYwvoDBj85768aV5r3eYIsimQD101hICG9E/bo7P xG+c5x6faaslgssR0b9Oxoe5PwJU80jKQV3WBJB9eftWrdyQmVxeNZnPPfKlTbckWVygc679 YET0EUMrLN5DZB4foSrzPIdOrIbeP3lpyAlKP19V8oZwdvcqRh5wByBkKgFFFsTgUuP+tbKH PZ3Ls/mwad X-IronPort-AV: E=Sophos;i="5.98,260,1673931600"; d="scan'208";a="100156186" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Wei Liu , "Anthony PERARD" , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Bernhard Kaindl Subject: [PATCH 7/7] tools/python: Drop shebangs from library files Date: Tue, 14 Mar 2023 14:15:20 +0000 Message-ID: <20230314141520.3652451-8-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230314141520.3652451-1-andrew.cooper3@citrix.com> References: <20230314141520.3652451-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1678803390651100001 These aren't runable scripts, so shouldn't have shebangs. Signed-off-by: Andrew Cooper Acked-by: Marek Marczykowski-G=C3=B3recki --- CC: Wei Liu CC: Anthony PERARD CC: Marek Marczykowski-G=C3=B3recki CC: Bernhard Kaindl --- tools/python/xen/migration/legacy.py | 1 - tools/python/xen/migration/libxc.py | 1 - tools/python/xen/migration/libxl.py | 1 - tools/python/xen/migration/public.py | 1 - tools/python/xen/migration/tests.py | 1 - tools/python/xen/migration/verify.py | 1 - tools/python/xen/migration/xl.py | 1 - tools/python/xen/util.py | 1 - 8 files changed, 8 deletions(-) diff --git a/tools/python/xen/migration/legacy.py b/tools/python/xen/migrat= ion/legacy.py index 6456d6157ce3..e196ca876095 100644 --- a/tools/python/xen/migration/legacy.py +++ b/tools/python/xen/migration/legacy.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- =20 """ diff --git a/tools/python/xen/migration/libxc.py b/tools/python/xen/migrati= on/libxc.py index 9881f5ced4ea..e52e632cb106 100644 --- a/tools/python/xen/migration/libxc.py +++ b/tools/python/xen/migration/libxc.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- =20 """ diff --git a/tools/python/xen/migration/libxl.py b/tools/python/xen/migrati= on/libxl.py index 5c4d4fe0631b..5dcb50fe0207 100644 --- a/tools/python/xen/migration/libxl.py +++ b/tools/python/xen/migration/libxl.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- =20 """ diff --git a/tools/python/xen/migration/public.py b/tools/python/xen/migrat= ion/public.py index fab2f84587b7..23183ef67db8 100644 --- a/tools/python/xen/migration/public.py +++ b/tools/python/xen/migration/public.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- =20 """ diff --git a/tools/python/xen/migration/tests.py b/tools/python/xen/migrati= on/tests.py index f22e2c2b7cf0..fcf94b0bb264 100644 --- a/tools/python/xen/migration/tests.py +++ b/tools/python/xen/migration/tests.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- =20 """ diff --git a/tools/python/xen/migration/verify.py b/tools/python/xen/migrat= ion/verify.py index 1e38f4a3c01e..b847c4bd220f 100644 --- a/tools/python/xen/migration/verify.py +++ b/tools/python/xen/migration/verify.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- =20 """ diff --git a/tools/python/xen/migration/xl.py b/tools/python/xen/migration/= xl.py index 978e744dfd95..139d496654df 100644 --- a/tools/python/xen/migration/xl.py +++ b/tools/python/xen/migration/xl.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- =20 """ diff --git a/tools/python/xen/util.py b/tools/python/xen/util.py index a11358eefa13..47ceb5bd21fe 100644 --- a/tools/python/xen/util.py +++ b/tools/python/xen/util.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- =20 import os --=20 2.30.2