[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Libguestfs] [PATCH v6 10/41] mllib, v2v: Split out OCaml utils bindings ‘common/mlutils’.



On Fri, Jun 16, 2017 at 03:38:35PM +0200, Pino Toscano wrote:
> On Thursday, 15 June 2017 19:06:00 CEST Richard W.M. Jones wrote:
> > Create a module ‘C_utils’ containing functions like ‘drive_name’ and
> > ‘shell_unquote’ which come from the C utilities.
> > 
> > The new directory ‘common/mlutils’ also contains the ‘Unix_utils’
> > wrappers around POSIX functions missing from the OCaml stdlib.
> > ---
> 
> I fear we are spreading the code among too many helper libraries...
> Why not just add these small bindings to Common_utils directly?

It may not be well explained in the commit messages, but the reason is
because the generator is pure OCaml (and bytecode too) so it can't
link to C functions.  So there's a pure OCaml library (Std_utils), and
this library which the daemon can use.

It's actually not split up for fun (which it certainly was not!)  but
because different things need different subsets.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]