From nobody Sun May 5 08:39:52 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1556478613; cv=none; d=zoho.com; s=zohoarc; b=DfRbQc3A+9crQW7D3/9R+D+/lKiidD/aE8auLBIo6lhDeE0CVRnqYnX55ISBj0Y7LuISS9nenCMte1wxhDqepnyBxubwH7K9IclbuybFzaGJe39YYuuuDZxBgrZ2FYFVDAVkKXFqTPvEWLGuWbPBoDIGvgTfjyO9grNoeI/KZF0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556478613; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=g2bcAd3PDNoIWou1yFnmw6UmfdPo2WbYUvjIRNaknlg=; b=kbXTAkm4wTduJ2JWbatI/mSyoWo2D1mxrHqacMNwK4+buJNRYtWnDR0tznohW6GmTYbW51mWbIRHNb/Q3XJZQTwFbkou5geGjFrCsANC/NaVBklD//C9L67e4fEy22lIO6EOF//LTkwn/iKjl6cFjMRachtfBIBmKyJV0bBkZwA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1556478612994804.6008289307921; Sun, 28 Apr 2019 12:10:12 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hKpAB-0004Uy-EK; Sun, 28 Apr 2019 19:08:35 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hKpAA-0004Ut-6J for xen-devel@lists.xenproject.org; Sun, 28 Apr 2019 19:08:34 +0000 Received: from out5-smtp.messagingengine.com (unknown [66.111.4.29]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 03eb3c0a-69e9-11e9-843c-bc764e045a96; Sun, 28 Apr 2019 19:08:32 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 6C17425E4D; Sun, 28 Apr 2019 15:08:32 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Sun, 28 Apr 2019 15:08:32 -0400 Received: from localhost.localdomain (ip5b412221.dynamic.kabel-deutschland.de [91.65.34.33]) by mail.messagingengine.com (Postfix) with ESMTPA id D2196E40E3; Sun, 28 Apr 2019 15:08:30 -0400 (EDT) X-Inumbo-ID: 03eb3c0a-69e9-11e9-843c-bc764e045a96 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=RYxRba 9s11plp0fcUcis5yxCZ/bSR4PUIEWli20pcFM=; b=0MNj5qbxAMd7FCvnpU0lUA ySGP4xvpI9PJbL1UXNySn+DHX41U2eRSW9gyW66m57G8q6/5k4mImovMKfTup4FC S7MEtSGxkCoodkHTMYmKCs3ditDtW6IXF3BhiMXB21LG+i2ajDc/3DMKTCDwU0DS xk06+eqki87niELgOagJl36nKDenLdwBKAlhqJF1m67r8F1/TciTOCwc14J6iDUF 9oLbVourV3ixxAxLfWbi1NFgLKbukx9vcQmxOSjF6JOIQ0qiSr5JRCqNkS2fWo2u JF/+PZ9mAGdod6sA5rTmZTeWxC5H5m4fK9CwjeYu6xx+n8FKkzNdyH4QRWO7dvPQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddriedtgddufeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffogggtohfgsehtkeertdertdejnecuhfhrohhmpeforghrvghk ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucfkphepledurdeihedrfeegrdef feenucfrrghrrghmpehmrghilhhfrhhomhepmhgrrhhmrghrvghksehinhhvihhsihgslh gvthhhihhnghhslhgrsgdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Date: Sun, 28 Apr 2019 21:08:23 +0200 Message-Id: <20190428190824.28029-1-marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.17.2 MIME-Version: 1.0 Organization: Invisible Things Lab Subject: [Xen-devel] [PATCH] python: Adjust xc_physinfo wrapper for updated virt_caps bits X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Wei Liu , Ian Jackson , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Commit f089fddd94 "xen: report PV capability in sysctl and use it in toolstack" changed meaning of virt_caps bit 1 - previously it was "directio", but was changed to "pv" and "directio" was moved to bit 2. Adjust python wrapper, and add reporting of both "pv_directio" and "hvm_directio". Signed-off-by: Marek Marczykowski-G=C3=B3recki Acked-by: Wei Liu --- This should be backported to 4.12 Cc: Ian Jackson --- tools/python/xen/lowlevel/xc/xc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/= xc/xc.c index cc8175a11e..0a8d8f407e 100644 --- a/tools/python/xen/lowlevel/xc/xc.c +++ b/tools/python/xen/lowlevel/xc/xc.c @@ -973,7 +973,8 @@ static PyObject *pyxc_physinfo(XcObject *self) xc_physinfo_t pinfo; char cpu_cap[128], virt_caps[128], *p; int i; - const char *virtcap_names[] =3D { "hvm", "hvm_directio" }; + const char *virtcap_names[] =3D { "hvm", "pv", + "hvm_directio", "pv_directio" }; =20 if ( xc_physinfo(self->xc_handle, &pinfo) !=3D 0 ) return pyxc_error_to_exception(self->xc_handle); @@ -989,6 +990,10 @@ static PyObject *pyxc_physinfo(XcObject *self) for ( i =3D 0; i < 2; i++ ) if ( (pinfo.capabilities >> i) & 1 ) p +=3D sprintf(p, "%s ", virtcap_names[i]); + if (pinfo.capabilities & XEN_SYSCTL_PHYSCAP_directio) + for ( i =3D 0; i < 2; i++ ) + if ( (pinfo.capabilities >> i) & 1 ) + p +=3D sprintf(p, "%s ", virtcap_names[i+2]); if ( p !=3D virt_caps ) *(p-1) =3D '\0'; =20 --=20 2.17.2 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel