From: Wei Liu Subject: Re: [PATCH] tools: remove unused wrappers for python Date: Tue, 6 Oct 2015 12:39:02 +0100 Message-ID: <20151006113902.GY29124@zion.uk.xensource.com> References: <1444128368-31585-1-git-send-email-jgross@suse.com> <20151006111849.GW29124@zion.uk.xensource.com> <5613B1A2.2030800@suse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <5613B1A2.2030800@suse.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Juergen Gross Cc: Wei Liu , Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com, Andrew Cooper , ian.jackson@eu.citrix.com, xen-devel@lists.xen.org, zhigang.x.wang@oracle.com List-Id: xen-devel@lists.xenproject.org On Tue, Oct 06, 2015 at 01:33:54PM +0200, Juergen Gross wrote: > On 10/06/2015 01:18 PM, Wei Liu wrote: > >On Tue, Oct 06, 2015 at 12:46:08PM +0200, Juergen Gross wrote: > >>Remove lots of functions in tools/python/xen/lowlevel/xc/xc.c as they > >>are not used anywhere in the tree. In fact only one function is still > >>being used from pygrub, namely "xeninfo". All other users seem to have > >>gone with nuking xm/xend. > >> > >>Signed-off-by: Juergen Gross > > > >Andrew said the python module is useful for debugging purpose. There are > >out-of-tree users as well. > > > >I'm not too fussed about either keeping these functions or removing > >them. But I would like to leave some time for other people to object. > > > >Do these dead functions affect the work you are doing? > > I stumbled over them when looking to make some domain builder data > private to the domain type (here: superpages). > Right. Then I'm keen on removing them. > In general I don't like those wrappers very much, as they are not very > maintainable. It's rather easy to miss incrementing a python reference > or to mess up the parameter types and names when calling > PyArg_ParseTupleAndKeywords() (you have to match the kwd_list, the > types of the parameters and the parameters themselves by hand). > > BTW: I've been told it's possible to use any shared library from Python, > so there should be no need for a wrapper like this just for debugging > purposes. > Good to know. Learn something new everyday! And for the record, if my google-fu doesn't fail me, it's possible to load shared library into python interpreter using "dl" module in 2.7 and "ctypes" module in 3.x. Wei. > > Juergen >