<br><tt><font size=2>libvirt-cim-bounces@redhat.com wrote on 2008-09-11
04:46:16:<br>
<br>
> >  ><br>
> >  > I gave them some more thought.. adding an arbitrary
sleep in a test<br>
> >  > isn't really a good idea - because systems run at
varying speeds, so you<br>
> >  > can't guarantee how long you'll need to sleep.<br>
> >  ><br>
> >  > A better approach would be to poll to see if there
are no guests... if<br>
> >  > there are no guests defined, then run the test, otherwise
keep polling.<br>
> >  >   You could poll for 10 seconds or so.  So
something like:<br>
> >  ><br>
> >  > timer_count = 10<br>
> >  ><br>
> >  > if count < timer_count:<br>
> >  >    #Get list of defined/active guests on
the system<br>
> >  >    #If no guests are defined<br>
> >  >        break<br>
> >  >    sleep(1)<br>
> >  ><br>
> >  > Does this sound reasonable?<br>
> > <br>
> >   Agree with you.<br>
> >   If there is still define guest on the system after waiting
for<br>
> >   10 seconds, then shall we have to make the timer_count
longer?<br>
> > <br>
> <br>
> The problem here is that it's possible the user has other defined
guests <br>
> in the system.  So we can't keep polling for there to be no guests.
 The <br>
> best we can do is poll for a given amount of time.  If the system
still <br>
> has guests on it after the timer is up, then we need to skip the test.<br>
> </font></tt>
<br><tt><font size=2>  Done. Patch on the way.</font></tt>
<br><tt><font size=2><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>