[Kimchi-devel] [PATCH V2 6/6] Fix Kimchi vm tests according to new messages sent from backend

Crístian Viana vianac at linux.vnet.ibm.com
Thu Feb 27 15:32:38 UTC 2014


Am 26-02-2014 17:55, schrieb Rodrigo Trujillo:
> However I think you are only seeing the case where the flow just 
> works, you did not took in account that
> rollbacks are used in case of errors/crashes/fails in the middle of test.
You are right, I did not see the cases when the test fails.
> If the code breaks in (4), while starting the vm (receive an 
> exception), how would you remove the vms created above (1)(2) ? I 
> asked myself this.
> The option I could think know is to add try/except in the code, but, 
> the with/rollback was implemented exactly for this (or to avoid this).
> I also tried to split with/rollback, but this does not work.
One solution would be to remove the VMs by their UUIDs instead of by 
their names. The UUID is a unique value and it never changes, so the 
deferred commands would always work, even if the VM name changes.

However the Kimchi function "vm_delete" expects only a name, not a UUID 
(which, IMO, was not a good design, given that libvirt allows us to 
lookup VMs by names and UUIDs). So I do not see an easy way to solve 
this properly without having "vm_delete" to accept something like a 
domain object instead of its name.

The function "_rollback_wrapper" still looks ugly though.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/kimchi-devel/attachments/20140227/c133d797/attachment.html>


More information about the Kimchi-devel mailing list