Re: [Libguestfs] [PATCH 06/27] daemon: Add unit tests of the ‘Utils’ module.

2017-07-20 Thread Richard W.M. Jones
On Thu, Jul 20, 2017 at 09:48:52AM +0200, Pino Toscano wrote: > On Wednesday, 19 July 2017 16:33:39 CEST Richard W.M. Jones wrote: > > On Wed, Jul 19, 2017 at 02:29:33PM +0200, Pino Toscano wrote: > > > On Wednesday, 19 July 2017 14:21:51 CEST Richard W.M. Jones wrote: > > > > On Wed, Jul 19, 2017

Re: [Libguestfs] [PATCH 03/27] daemon: Reimplement ‘file’ API in OCaml.

2017-07-20 Thread Richard W.M. Jones
On Wed, Jul 19, 2017 at 03:14:48PM +0200, Pino Toscano wrote: > > + > > +let statbuf = Chroot.f chroot lstat path in > > Hm is chroot needed for this? The current C implementation does not > use CHROOT_IN/OUT, and it does not even resolve symlinks, so it should > be safe. The

Re: [Libguestfs] [PATCH 06/27] daemon: Add unit tests of the ‘Utils’ module.

2017-07-20 Thread Pino Toscano
On Wednesday, 19 July 2017 16:33:39 CEST Richard W.M. Jones wrote: > On Wed, Jul 19, 2017 at 02:29:33PM +0200, Pino Toscano wrote: > > On Wednesday, 19 July 2017 14:21:51 CEST Richard W.M. Jones wrote: > > > On Wed, Jul 19, 2017 at 12:57:08PM +0200, Pino Toscano wrote: > > > > Would it be possible

Re: [Libguestfs] [PATCH v7 2/9] lib: extract osinfo DB traversing API

2017-07-20 Thread Cedric Bosdonnat
On Fri, 2017-07-07 at 15:04 +0200, Pino Toscano wrote: > On Monday, 19 June 2017 10:48:30 CEST Cédric Bosdonnat wrote: > > Split lib/osinfo.c to provide an API for other pieces of code (namely > > mllib) to reuse it. The ISO-related processing is thus moved into a > > lib/osinfo-iso.c file. > >

[Libguestfs] [PATCH] appliance: read ID_LIKE from os-release as a fallback

2017-07-20 Thread Cédric Bosdonnat
In the appliance used to build the packages for openSUSE, os-release is super minimal and only had ID_LIKE=suse. The code setting the DISTRO variable only searches for ID variable so far, resulting in invalid packagelist on openSUSE. This fix reads ID_LIKE as a fallback if ID contains nothing.

Re: [Libguestfs] [PATCH 06/27] daemon: Add unit tests of the ‘Utils’ module.

2017-07-20 Thread Pino Toscano
On Thursday, 20 July 2017 09:59:19 CEST Richard W.M. Jones wrote: > On Thu, Jul 20, 2017 at 09:48:52AM +0200, Pino Toscano wrote: > > On Wednesday, 19 July 2017 16:33:39 CEST Richard W.M. Jones wrote: > > > On Wed, Jul 19, 2017 at 02:29:33PM +0200, Pino Toscano wrote: > > > > On Wednesday, 19 July

Re: [Libguestfs] [PATCH 02/27] daemon: Allow parts of the daemon and APIs to be written in OCaml.

2017-07-20 Thread Pino Toscano
On Wednesday, 19 July 2017 22:25:41 CEST Richard W.M. Jones wrote: > On Wed, Jul 19, 2017 at 03:13:47PM +0200, Pino Toscano wrote: > > On Friday, 14 July 2017 15:39:10 CEST Richard W.M. Jones wrote: > > > .gitignore | 6 +- > > > Makefile.am| 2 +- > > >

Re: [Libguestfs] [PATCH 19/27] daemon: Reimplement ‘list_filesystems’ API in the daemon, in OCaml.

2017-07-20 Thread Pino Toscano
On Friday, 14 July 2017 15:39:27 CEST Richard W.M. Jones wrote: > +let rec list_filesystems () = > + let has_lvm2 = Lvm.available () in > + let has_ldm = Ldm.available () in > + > + let devices = Devsparts.list_devices () in > + let partitions = Devsparts.list_partitions () in > + let mds =

Re: [Libguestfs] [PATCH] appliance: read ID_LIKE from os-release as a fallback

2017-07-20 Thread Cedric Bosdonnat
On Thu, 2017-07-20 at 17:01 +0200, Pino Toscano wrote: > On Thursday, 20 July 2017 16:21:40 CEST Cédric Bosdonnat wrote: > > In the appliance used to build the packages for openSUSE, os-release > > is super minimal and only had ID_LIKE=suse. The code setting the > > DISTRO variable only searches

Re: [Libguestfs] [PATCH] appliance: read ID_LIKE from os-release as a fallback

2017-07-20 Thread Pino Toscano
On Thursday, 20 July 2017 16:21:40 CEST Cédric Bosdonnat wrote: > In the appliance used to build the packages for openSUSE, os-release > is super minimal and only had ID_LIKE=suse. The code setting the > DISTRO variable only searches for ID variable so far, resulting in > invalid packagelist on

Re: [Libguestfs] [PATCH 18/27] daemon: Reimplement ‘btrfs_subvolume_list’ and ‘btrfs_subvolume_get_default’ in OCaml.

2017-07-20 Thread Pino Toscano
On Friday, 14 July 2017 15:39:26 CEST Richard W.M. Jones wrote: > +(* In order to examine subvolumes, quota and other things, the btrfs > + * filesystem has to be mounted. However we're passed a mountable > + * in these cases, so we must mount the filesystem. But we cannot > + * mount it under

Re: [Libguestfs] [PATCH 16/27] daemon: Generate OCaml wrappers for optgroup_*_available functions.

2017-07-20 Thread Pino Toscano
On Friday, 14 July 2017 15:39:24 CEST Richard W.M. Jones wrote: > It is sometimes useful to be able to call these from OCaml code. > --- > generator/daemon.ml | 23 ++- > 1 file changed, 22 insertions(+), 1 deletion(-) I see in patch #19: external available : unit -> bool

Re: [Libguestfs] [PATCH v9 04/11] daemon: Implement umount_all in OCaml.

2017-07-20 Thread Pino Toscano
On Monday, 17 July 2017 18:55:24 CEST Richard W.M. Jones wrote: > Unlike previous ‘daemon: Reimplement ...’ patches, this does not > reimplement the umount_all API completely (yet, but this > implementation could be completed in future and then replace the C > one). However it is necessary to

[Libguestfs] check-release success (was: Re: [PATCH] appliance: read ID_LIKE from os-release as a fallback)

2017-07-20 Thread Richard Jones
0 # XFAIL: 0 # FAIL: 0 # XPASS: 0 # ERROR: 0 make[3]: Leaving directory '/var/tmp/tmpUR3Q0s/libguestfs/php' make[2]: Leaving directory '/var/tmp/tmpUR3Q0s/libguestfs/php' make[1]: Leaving directory

Re: [Libguestfs] [PATCH 03/27] daemon: Reimplement ‘file’ API in OCaml.

2017-07-20 Thread Pino Toscano
On Thursday, 20 July 2017 09:54:51 CEST Richard W.M. Jones wrote: > > On Wed, Jul 19, 2017 at 03:14:48PM +0200, Pino Toscano wrote: > > > + > > > +let statbuf = Chroot.f chroot lstat path in > > > > Hm is chroot needed for this? The current C implementation does not > > use CHROOT_IN/OUT,

Re: [Libguestfs] [PATCH 23/27] daemon: Reimplement ‘md_detail’ API in OCaml.

2017-07-20 Thread Pino Toscano
On Friday, 14 July 2017 15:39:31 CEST Richard W.M. Jones wrote: > +let md_detail md = > + let out = command "mdadm" ["-D"; "--export"; md] in > + > + (* Split the command output into lines. *) > + let out = String.trim out in > + let lines = String.nsplit "\n" out in If here we do: let

Re: [Libguestfs] [PATCH 20/27] daemon: Reimplement ‘part_list’ API in OCaml.

2017-07-20 Thread Pino Toscano
On Friday, 14 July 2017 15:39:28 CEST Richard W.M. Jones wrote: > +let print_partition_table ~add_m_option device = > + udev_settle (); > + > + let args = ref [] in > + if add_m_option then push_back args "-m"; > + push_back args "-s"; > + push_back args "--"; > + push_back args device; > +

Re: [Libguestfs] [PATCH] appliance: read ID_LIKE from os-release as a fallback

2017-07-20 Thread Tomáš Golembiovský
Hi, On Thu, 20 Jul 2017 18:09:53 +0200 Cedric Bosdonnat wrote: > On Thu, 2017-07-20 at 17:01 +0200, Pino Toscano wrote: > > On Thursday, 20 July 2017 16:21:40 CEST Cédric Bosdonnat wrote: > > > In the appliance used to build the packages for openSUSE, os-release > > > is