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

[Xen-users] Re: [Xen-devel] [PATCH] Displaying scheduler related information using xm



On Mon, Mar 13, 2006 at 11:37:51AM +0530, Subhabrata Bhattacharya wrote:

> Hi All,
> 
> The attached patch adds two simple scheduler related capabilities to
> the xm tool.
> 
> [Snip]
>
> diff -Naurp xen-3.0.0/tools/python/xen/xend/XendClient.py 
> xen-3.0.0-sched-param/tools/python/xen/xend/XendClient.py
> --- xen-3.0.0/tools/python/xen/xend/XendClient.py     2005-12-05 
> 04:06:31.000000000 +0530
> +++ xen-3.0.0-sched-param/tools/python/xen/xend/XendClient.py 2006-03-09 
> 12:58:36.000000000 +0530
> @@ -291,6 +291,31 @@ class Xend:
>                             'extratime' : extratime,
>                             'weight'    : weight })
>  
> +    ##Scheduler information interface 
> +    def xend_sched_id(self):
> +     import xen.lowlevel.xc
> +     xc = xen.lowlevel.xc.xc()
> +     sched_id = xc.sched_id()
> +     return sched_id 
> +
> +    def xend_sched_param(self, id):
> +
> +     sched_param = {} 
> +     import xen.lowlevel.xc
> +     xc = xen.lowlevel.xc.xc()
> +     if id != -1:
> +             sched_param[0] = xc.sched_param(id)
> +     else:
> +             domid = 0
> +             icnt = 0
> +             domlist = xc.domain_getinfo()
> +             for d in domlist:
> +                     domid = d['dom']
> +                     sched_param[icnt] = xc.sched_param(domid)
> +                     icnt += 1
> +
> +     return sched_param
> +
>      def xend_domain_maxmem_set(self, id, memory):
>          return self.xendPost(self.domainurl(id),
>                               { 'op'      : 'maxmem_set',

Hi Subhabrata,

What you've done here is put the actual interfacing with Xen (i.e. the xc
calls) into XendClient, the code running as the client (xm).  This will mean
that this code will work fine when you are running xm on the machine that you
are monitoring, but it won't work at all in other situations.  In the long
run, people will be using libvirt, for example, to talk XML-RPC to Xend to
manage a machine remotely, and your code won't work in that situation, because
you have no server-side aspect to your code.

Follow the path for something like getVCPUInfo from main.py into
XMLRPCServer.py and XendDomainInfo.py -- you ought to be doing something like
that, I think.

Note also that XMLRPCServer is new since your patch and more or less removes
the need for XendClient.py.  It's hopefully simpler, so shouldn't give you any
difficulty.

The rest of your patch looked good to me.  I'm not an expert on the scheduler
side of things, so someone else might comment, but it looked OK to me.

Thanks,

Ewan.

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


 


Rackspace

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