[Libvirt-cim] [PATCH 2 of 3] [TEST] Add generic poll function to poll for guest state

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Thu Jun 26 15:45:36 UTC 2008


>>          return 1
>>
>>      return 0 +
>> +def poll_for_state_change(server, virt, dom, exp_state):
>> +    timeout = 30   
> It will be good if we pass timeout value as well.
> 
>> +    cs = computersystem.get_cs_class(virt)
>> +
>> +    try:
>> +        for i in range(1, (timeout + 1)):
>> +            sleep(1)
>> +            dom_cs = cs(server, name=dom)
>> +            if dom_cs is None:
>>   
> We can make this better by checking dom_cs.Name, thoughts ?
> otherwise +1 for me.

That's a really good point. It's possible to get back the wrong CS 
instance.  Good catch =)  I'll add both of these changes and resend.

-- 
Kaitlin Rupert
IBM Linux Technology Center
kaitlin at linux.vnet.ibm.com




More information about the Libvirt-cim mailing list