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