On Tue, Jun 08, 2010 at 03:55:50PM +0100, Matthew Booth wrote:
Currently image files will be left on the export domain if a
conversion fails.
It isn't possible to delete these through the RHEV UI, requiring an
administrator to clean them up manually.
This change causes images to be written to a temporary directory on the export
domain, and moved to the correct location immediately before writing the OVF
file. It also removes this temporary directory automatically on unclean
shutdown. This means that a failed conversion shouldn't leave anything on the
export domain. Even if it does, for example because of a power failure, the
temporary files are clearly separated in their own directory.
The patch is fairly confusing because of the use of NFSHelper, but I
have two potential concerns:
(a) I don't think Perl 'rename' function will work if the temporary
directory is on a different filesystem from the final destination.
You might be better off using the 'mv' shell command (possibly with
suitable shell quoting) instead.
(b) Where is $tmpdir typically? If it's on /tmp you might find you
have limited space, eg. if /tmp is a ramdisk. (We have the same
problem in libguestfs, and people can override it by setting $TMPDIR).
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming blog:
http://rwmj.wordpress.com
Fedora now supports 80 OCaml packages (the OPEN alternative to F#)
http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora