<br><font size=2 face="sans-serif"><br>
</font><tt><font size=2>libvirt-cim-bounces@redhat.com wrote on 2008-11-04
06:13:53:<br>
<br>
> >  > > +def run_remote_guest(ip, domain, command):<br>
> >  > > +    """ Execute commands
on remote guest console.<br>
> >  > > +    """<br>
> >  > > +<br>
> >  > > +    cmd = 'python %s %s "%s"'
% (CONSOLE_APP_PATH, domain, command)<br>
> >  > > +<br>
> >  > > +    return run_remote(ip, cmd)<br>
> >  > > +<br>
> >  > > +<br>
> >  ><br>
> >  >    Kaitlin,<br>
> >  ><br>
> >  >    I think we can remove run_remote_guest
to xm_virt_util.py under<br>
> >  > ../libvirt-cim/lib/XenKvmLib,<br>
> >  >    because it have to be used by live.py
under lib/VirtLib. We have<br>
> >  > to make it stay in utils.py.<br>
> > <br>
> >      I'm sorry, I intend to say we cann't remove
run_remote_guest() from <br>
> > ../lib/XenKvmLib to xm_virt_util.py =)<br>
> > <br>
> >  >    Thoughts?<br>
> >  >    <br>
> >  >    If you agree to make it stay in utils.py,
I will rework on this <br>
> > patch.<br>
> >  >    Thanks!<br>
> <br>
> I'm sorry Daisy - I'm not sure I understand what you mean here.  Are
you <br>
> saying that run_remote_guest() needs to stay in lib/VirtLib/utils.py?<br>
> </font></tt>
<br><tt><font size=2>   Yeah, I want to say that run_remote_guest()
needs to stay in lib/VirtLib/utils.py.</font></tt>
<br><tt><font size=2>   It because that lib/VirtLib/live.py have
to call run_remote_guest(), such as below </font></tt>
<br><tt><font size=2>   function in live.py:</font></tt>
<br>
<br><tt><font size=2>   def processors_count(ip, vs_name):</font></tt>
<br><tt><font size=2>    """Returns the number
of processors of the specified VS</font></tt>
<br><tt><font size=2>    """</font></tt>
<br>
<br><tt><font size=2>    guest_cmd = "grep '^$' /proc/cpuinfo
| wc -l"</font></tt>
<br>
<br><tt><font size=2>    rc, out = utils.run_remote_guest(ip,
vs_name, guest_cmd)</font></tt>
<br><tt><font size=2>    if rc != 0:</font></tt>
<br><tt><font size=2>        return -1</font></tt>
<br>
<br><tt><font size=2>    try:</font></tt>
<br><tt><font size=2>        cpus = int(out)</font></tt>
<br><tt><font size=2>        return cpus</font></tt>
<br><tt><font size=2>    except ValueError:</font></tt>
<br><tt><font size=2>        return -1</font></tt>
<br>
<br><tt><font size=2>   If we move it to /libvirt-cim/lib/XenKvmLib/xm_virt_util.py,
how does live.py work? </font></tt>
<br><tt><font size=2>   Thanks!</font></tt>
<br><tt><font size=2><br>
> If so, why?<br>
> <br>
> -- <br>
> Kaitlin Rupert<br>
> IBM Linux Technology Center<br>
> kaitlin@linux.vnet.ibm.com<br>
> <br>
> _______________________________________________<br>
> Libvirt-cim mailing list<br>
> Libvirt-cim@redhat.com<br>
> https://www.redhat.com/mailman/listinfo/libvirt-cim<br>
</font></tt>