[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] about Xen API's 'api' attribute

  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: "Yanjun Wu" <yanjun.wu@xxxxxxxxx>
  • Date: Sat, 6 Dec 2008 16:00:51 +0800
  • Delivery-date: Sat, 06 Dec 2008 00:01:16 -0800
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=HnSnygz5F/+cUdi2teCD0duOjI+pH4FT+zEZ7qTvjrhXDN6RwBr3XNju5xgvqhM9HM OcoSvKFx7zBkBb6p5Q/Lz9Bq5HV3T5jLdFeDtT8ktDEmy1Ads26Ojafzne8/xriVt6Tm asmdoSq0Srpa3/A3Jp19sICg9iRPeW9IQvZ4g=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

when reading the following code, the line marked with * calls
hasattr(meth, 'api').
But I cannot find where 'api' attribute is set to the method after
searching the whole directory.
And also, what kind of typical methods are in self.xenapi? I traced to
Unix PAM, then get stucked.  thanks.

tools/python/xen/xend/server/XMLRPCServer.py : line 171
        # Register Xen API Functions
        # exportable functions are ones that do not begin with '_'
        # and has the 'api' attribute.

        for meth_name in dir(self.xenapi):
            if meth_name[0] != '_':
                meth = getattr(self.xenapi, meth_name)
   *            if callable(meth) and hasattr(meth, 'api'):
                    self.server.register_function(meth, getattr(meth,

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.