[Libguestfs] [PATCH v8 1/7] ocaml osinfo database iterator

Cedric Bosdonnat cbosdonnat at suse.com
Thu Sep 14 15:48:05 UTC 2017


On Thu, 2017-09-14 at 17:00 +0200, Pino Toscano wrote:
> On Tuesday, 12 September 2017 09:03:08 CEST Cédric Bosdonnat wrote:
> > From: Pino Toscano <ptoscano at redhat.com>
> > 
> > The C osinfo database parser has been deprecated, reimplement the base
> > of it in ocaml for virt-builder-repository to use. This provides an
> > Osinfo.iterate_db() function traversing the files of the osinfo database
> > and calling a function on each of them.
> > ---
> 
> Since I contributed this bit, I guess I can provide also a commit
> message:
> 
>   builder: add simple OCaml osinfo-db reader
> 
>   Add a simple OCaml-based implementation of reader of the osinfo-db:
>   the only interface is an iterator that invokes an user-supplied
>   function with each XML file found.
> 
>   This implementation behaves like the current C implementation, and
>   still suppors the old libosinfo db.

s/suppors/supports/

ACK

--
Cedric

> 
> > --- /dev/null
> > +++ b/builder/osinfo.ml
> > @@ -0,0 +1,80 @@
> > +(* virt-builder
> > + * Copyright (C) 2017 Red Hat Inc.
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License as published by
> > + * the Free Software Foundation; either version 2 of the License, or
> > + * (at your option) any later version.
> > + *
> > + * This program is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > + * GNU General Public License for more details.
> > + *
> > + * You should have received a copy of the GNU General Public License along
> > + * with this program; if not, write to the Free Software Foundation, Inc.,
> > + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
> > + *)
> > +
> > +open Std_utils
> > +open Common_utils
> > +open Osinfo_config
> 
> We can add some comment here:
> 
>   (*
>    * This module deals with the osinfo-db, so we can get information on
>    * e.g. the distributions provided by the database.
>    *
>    * Try to use the shared osinfo database layout (and location) first:
>    * https://gitlab.com/libosinfo/libosinfo/blob/master/docs/database-layout.txt
>    *)
> 
> > +
> > +let rec iterate_db fn =
> > +  let locations = ref [] in
> > [...]
> 
> The rest LGTM.
> 
> _______________________________________________
> Libguestfs mailing list
> Libguestfs at redhat.com
> https://www.redhat.com/mailman/listinfo/libguestfs




More information about the Libguestfs mailing list