[Libguestfs] [PATCH v2 02/17] v2v: factor out opening input VM

Richard W.M. Jones rjones at redhat.com
Thu Aug 27 14:53:55 UTC 2015


On Tue, Aug 11, 2015 at 08:00:21PM +0300, Roman Kagan wrote:
> Opening the source VM and amending the properties in its internal
> representation in accordance with command-line options fit nicely into
> two isolated functions.

Better to write this as:

  let rec main () =
    ...

  and open_source ... =
    ...

  and amend_source ... =
    ...

  and inspect_source ... =
    ...

so it's consistent with how all the other sub-functions are
done in the same file.

'let rec .. and ..' defines mutually recursive functions that can call
each other.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch
http://libguestfs.org/virt-builder.1.html




More information about the Libguestfs mailing list