From: Brendan Cully Subject: Re: Problem in adding a function to tools/python/xen/lowlevel/xc/xc.c Date: Mon, 28 Apr 2008 08:40:46 -0700 Message-ID: <20080428154045.GC58432@xanadu.kublai.com> References: <2717599f0804280833q8da2f05xfc5e6c4f16980238@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <2717599f0804280833q8da2f05xfc5e6c4f16980238@mail.gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: sanjay kushwaha Cc: xen-devel List-Id: xen-devel@lists.xenproject.org On Monday, 28 April 2008 at 11:33, sanjay kushwaha wrote: ... > +static PyObject *pyxc_register_domm_xen(XcObject *self, PyObject *args) > +{ > + uint32_t dom; > + > + if (!PyArg_ParseTuple(args, "i", &dom)) > + return NULL; > + > + if (xc_register_domm_xen(self->xc_handle, dom) != 0) > + return NULL; > + > + Py_INCREF(zero); > + return zero; > +} > + ... > The /var/log/xen/xend.log shows the following error > > [2008-04-28 11:27:17 4132] ERROR (XendDomainInfo:443) VM start failed > Traceback (most recent call last): > File "/root/ksanjay/hp/xen-unstable.hg/dist/install/usr/lib/python/xen/xend/ > XendDomainInfo.py", line 423, in start > XendTask.log_progress(31, 60, self._initDomain) > File "/root/ksanjay/hp/xen-unstable.hg/dist/install/usr/lib/python/xen/xend/ > XendTask.py", line 209, in log_progress > retval = func(*args, **kwds) > File "/root/ksanjay/hp/xen-unstable.hg/dist/install/usr/lib/python/xen/xend/ > XendDomainInfo.py", line 2175, in _initDomain > xc.register_domm_xen(self.domid) > SystemError: error return without exception set I believe this exception means you're returning NULL. When you do this, you need to set an exception message (e.g. using PyErr_Set*) first. Looking at your code, the culprit is probably the 'return NULL' after your call to xc_register_domm_xen.