<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 7, 2018 at 3:37 PM, Richard W.M. Jones <span dir="ltr"><<a href="mailto:rjones@redhat.com" target="_blank">rjones@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, Mar 07, 2018 at 03:12:58PM +0200, Arik Hadas wrote:<br>
> If for some predefined period of time no new disk is added or an upload<br>
> doesn't make any progress (assuming the uploads are done sequentially), to<br>
> fail the import operation and that would roll back the resources (disks,<br>
> VMs) that were created as part of the import process.<br>
<br>
</span>At the moment we're actually trying to remove the disk on failure.<br>
However the disk_service.remove() API does nothing (doesn't even<br>
fail). Perhaps because the transfer isn't finalized on the error<br>
path?<br></blockquote><div><br></div><div>That's weird, it should fail to acquire the disk's lock.</div><div>In any case, I think that removing the disk this way would be wrong as we also store an entity in the image_transfer table that should be removed (otherwise, another attempt to upload the same disk would probably fail).</div><div>Daniel/Nir, I can't find a way to cancel an ongoing upload-image operation through the API (as we have in the webadmin), am I missing it or is it missing?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Anyway the code - which needs review - is:<br>
<br>
<a href="https://www.redhat.com/archives/libguestfs/2018-March/msg00024.html" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>archives/libguestfs/2018-<wbr>March/msg00024.html</a><br>
<div class="HOEnZb"><div class="h5"><br>
Rich.<br>
<br>
--<br>
Richard Jones, Virtualization Group, Red Hat <a href="http://people.redhat.com/~rjones" rel="noreferrer" target="_blank">http://people.redhat.com/~<wbr>rjones</a><br>
Read my programming and virtualization blog: <a href="http://rwmj.wordpress.com" rel="noreferrer" target="_blank">http://rwmj.wordpress.com</a><br>
Fedora Windows cross-compiler. Compile Windows programs, test, and<br>
build Windows installers. Over 100 libraries supported.<br>
<a href="http://fedoraproject.org/wiki/MinGW" rel="noreferrer" target="_blank">http://fedoraproject.org/wiki/<wbr>MinGW</a><br>
</div></div></blockquote></div><br></div></div>