<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 02/27/2014 12:32 PM, Crístian Viana
wrote:<br>
</div>
<blockquote cite="mid:530F5A96.1020008@linux.vnet.ibm.com"
type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
Am 26-02-2014 17:55, schrieb Rodrigo Trujillo:<br>
<blockquote cite="mid:530E54BF.6040003@linux.vnet.ibm.com"
type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<div class="moz-cite-prefix">However I think you are only seeing
the case where the flow just works, you did not took in
account that<br>
rollbacks are used in case of errors/crashes/fails in the
middle of test.<br>
</div>
</blockquote>
You are right, I did not see the cases when the test fails.<br>
<blockquote cite="mid:530E54BF.6040003@linux.vnet.ibm.com"
type="cite">
<div class="moz-cite-prefix"> 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.<br>
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).<br>
I also tried to split with/rollback, but this does not work.<br>
</div>
</blockquote>
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.<br>
<br>
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.<br>
<br>
</blockquote>
<br>
Even using UUID, the rollback problem will still exist.<br>
I don't see any other better solution to it<br>
<br>
<blockquote cite="mid:530F5A96.1020008@linux.vnet.ibm.com"
type="cite"> The function "_rollback_wrapper" still looks ugly
though.<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Kimchi-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Kimchi-devel@ovirt.org">Kimchi-devel@ovirt.org</a>
<a class="moz-txt-link-freetext" href="http://lists.ovirt.org/mailman/listinfo/kimchi-devel">http://lists.ovirt.org/mailman/listinfo/kimchi-devel</a>
</pre>
</blockquote>
<br>
</body>
</html>