WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] about Xen API's 'api' attribute
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
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=wYrsTlQvwq4xNeHq7MxnUww9UJuOwS1yntymt567ahk=; b=u6T0yK+3br1Vt8XvdrLSvXlVwsjTgzehusbTupT8HadGLDV7t7ofAUNHXaCbclhp7Q Be14OezyM1Pb66GcN0v84G7DjgXnq0AMjyTx3YnN8hxWk7TZOIhAVO/Kiz5NYHb9ejpH TVwjOC33ywSuTKNdaGaLOZHCE86sv5IDyzmAg=
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=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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,
'api'))
================

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] about Xen API's 'api' attribute, Yanjun Wu <=