[Libvirt-cim] [PATCH] [TEST] Move some functions from utils.py to xm_virt_util.py

Guo Lian Yun yunguol at cn.ibm.com
Wed Nov 5 05:52:18 UTC 2008


libvirt-cim-bounces at redhat.com wrote on 2008-11-05 00:11:49:

> >  > I'm sorry Daisy - I'm not sure I understand what you mean here. Are 
you
> >  > saying that run_remote_guest() needs to stay in 
lib/VirtLib/utils.py?
> >  >
> >    Yeah, I want to say that run_remote_guest() needs to stay in 
> > lib/VirtLib/utils.py.
> >    It because that lib/VirtLib/live.py have to call 
run_remote_guest(), 
> > such as below
> >    function in live.py:
> > 
> >    def processors_count(ip, vs_name):
> >     """Returns the number of processors of the specified VS
> >     """
> > 
> >     guest_cmd = "grep '^$' /proc/cpuinfo | wc -l"
> > 
> >     rc, out = utils.run_remote_guest(ip, vs_name, guest_cmd)
> >     if rc != 0:
> >         return -1
> > 
> >     try:
> >         cpus = int(out)
> >         return cpus
> >     except ValueError:
> >         return -1
> > 
> >    If we move it to /libvirt-cim/lib/XenKvmLib/xm_virt_util.py, how 
does 
> > live.py work?
> 
> Oh, I see.  I had missed this before when we discussed what functions 
> should be moved.  Any function that is run within the guest should also 
> be moved.
> 
> So the following should be moved to 
> libvirt-cim/lib/XenKvmLib/xm_virt_util.p:
> 
>   processors_count()
>   memory_count()
>   network_macs()
> 
> I had originally thought these were running on the host, not within the 
> guest.  Sorry for the confusion!

  I have moved below functions to xm_virt_util.py:

  processors_count()
  memory_count()
  network_macs()
  run_remote_guest()

So far, this work item is done. I'm going to fix the test failure. 
Thoughts?

Thanks!

> 
> -- 
> Kaitlin Rupert
> IBM Linux Technology Center
> kaitlin at linux.vnet.ibm.com
> 
> _______________________________________________
> Libvirt-cim mailing list
> Libvirt-cim at redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-cim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20081105/6e722e08/attachment.htm>


More information about the Libvirt-cim mailing list