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-api

Re: [Xen-API] Re: Problems in xen_sr_get_physical_size

To: chetansa <chetan.lists@xxxxxxxxx>
Subject: Re: [Xen-API] Re: Problems in xen_sr_get_physical_size
From: Stefan Berger <stefanb@xxxxxxxxxx>
Date: Sun, 6 Jan 2008 14:18:39 -0500
Cc: xen-api@xxxxxxxxxxxxxxxxxxx
Delivery-date: Sun, 06 Jan 2008 11:19:03 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <4780BB77.1030007@xxxxxxxxx>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx

It looks like the error is in Xend.

This patch may fix the problem, though it returns 'max_int'.

   Stefan

Signed-off-by: Stefan Berger <stefanb@xxxxxxxxxx>

diff -r 2491691e3e69 tools/python/xen/xend/XendAPI.py
--- a/tools/python/xen/xend/XendAPI.py                 Sat Dec 29 17:57:47 2007 +0000
+++ b/tools/python/xen/xend/XendAPI.py                 Sun Jan 06 14:16:10 2008 -0500
@@ -2531,7 +2531,7 @@ class XendAPI(object):
        return self._get_SR_func(ref, 'physical_utilisation')

    def SR_get_physical_size(self, _, ref):
-        return self._get_SR_func(ref, 'physical_size')
+        return self._get_SR_attr(ref, 'physical_size')
   
    def SR_get_type(self, _, ref):
        return self._get_SR_attr(ref, 'type')




xen-api-bounces@xxxxxxxxxxxxxxxxxxx wrote on 01/06/2008 06:28:55 AM:

> chetansa wrote:

> Hi all,
> I would like to know if I am doing something wrong in my test code
> (using libxen). Here is the test code snippet and associated results.

> ---- Code -----
>
>     xen_sr_set *mySrList;
>     xen_sr *mySr;
>    
>     if (!xen_sr_get_all(session, &mySrList))
>     {
>         cout<<"Error in xen_sr_get_all"<<endl;
>         return 1;
>     }
>     cout<<"SR array size:"<<(int)mySrList->size<<endl;
>    
>     mySr = mySrList->contents[0];
>    
>     char* srname;
>
>     if (!xen_sr_get_type(session, &srname, (mySrList->contents[0])))
>     {
>         cout<<"Error in xen_sr_get_type"<<endl;
>         return 1;
>     }
>    
>     cout<<"SR type:"<<srname<<endl;
>
>     int64_t srno;
>    
>     if (!xen_sr_get_physical_size(session, &srno, (mySrList->contents[0])))
>     {
>         cout<<"Error in xen_sr_get_physical_size"<<endl;
>         return 1;
>     }
>    
>     cout<<"SR detail:"<<(int)srno<<endl;
>
> ---- Results -----
>
> SR array size: 2
> SR type: local
> Error in xen_sr_get_physical_size

> Thanks
>
> Chetan

> Here is an error description given by the session struct,
>
> 2INTERNAL_ERROR 'int' object is not callable
> _______________________________________________
> xen-api mailing list
> xen-api@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api
_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api
<Prev in Thread] Current Thread [Next in Thread>