Re: [Libguestfs] libguestfs and zfs-fuse

2014-02-05 Thread Pino Toscano
orts (it seems not having been updated in a while...) so even if we automate somehow the starting of the zfs-fuse helper and the handling of zpool/zfs, I'm not sure it could be actually useful with a zfs-fuse not supporting recent versions. (To have a test partition with ZFS, I had to create it on a Debian/kFreeBSD 6.0 (oldstable), as even Debian/kFreeBSD 7 (stable) had "too new" zfs stuff for zfs-fuse.) -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] Possible to speed up guestmount?

2014-02-06 Thread Pino Toscano
gt; takes ~0.01 seconds. Note also guestmount uses FUSE to mount the provided image using libguestfs, so there is also an additional layer between the commands in the mountpoint and the actual access to the data in the image. -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

[Libguestfs] [PATCH 1/4] utils: add a function to validate a GUID string

2014-02-10 Thread Pino Toscano
--- src/guestfs-internal.h | 3 +++ src/test-utils.c | 14 ++ src/utils.c| 44 3 files changed, 61 insertions(+) diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h index 3752f79..545146f 100644 --- a/src/guestfs

[Libguestfs] [PATCH 0/4] add GUID validation (RHBZ#1008417)

2014-02-10 Thread Pino Toscano
Hi, this patch serie adds a new GUID type in the generator, which would do the same as String, but also validating (just in the C output) the passed GUID string. This allows to reject invalid GUIDs before passing them to low-level tools. Pino Toscano (4): utils: add a function to validate a

[Libguestfs] [PATCH 2/4] generator: add a GUID parameter type

2014-02-10 Thread Pino Toscano
At the moment it is basically the change as String, and it is mapped as if it was such. --- generator/bindtests.ml | 3 ++- generator/c.ml | 11 +++ generator/csharp.ml | 6 -- generator/daemon.ml | 4 ++-- generator/erlang.ml | 3 ++- generator/fish.ml

[Libguestfs] [PATCH 4/4] actions/part_set_gpt_type: set type of "guid" parameter as "GUID" (RHBZ#1008417).

2014-02-10 Thread Pino Toscano
Switch the type of the "guid" parameter from "String" to "GUID"; this adds the validation of the GUID as such, rejecting straight away invalid GUIDs which otherwise could be handled badly by low-level tools (such as sgdisk). Add a couple of easy tests (taken from RHBZ#1008417) to part_set_gpt_type

[Libguestfs] [PATCH 3/4] generator: generate code for parameter validation

2014-02-10 Thread Pino Toscano
Implemented only in the C output, since every binding uses it anyway, and just for the "GUID" type (since its format is well-known). --- generator/c.ml | 43 +++ 1 file changed, 43 insertions(+) diff --git a/generator/c.ml b/generator/c.ml index e2d5754..c3

[Libguestfs] [PATCH 0/3] virt-builder: copy local files instead of using curl

2014-02-11 Thread Pino Toscano
Hi, this patch serie does a small optimisation in virt-builder, i.e. make its internal Downloader just copy files when the source is a local URI, instead of spawn curl in this case too. Pino Toscano (3): builder: isolate C libraries in an own OCAMLCLIBS builder: prepare for different per

[Libguestfs] [PATCH 2/3] builder: prepare for different per-protocol download actions

2014-02-11 Thread Pino Toscano
Small refactor of Downloader.download_to to allow different download actions depending on the protocol of the URI (which is now parsed). No actual behaviour changes, just mostly code motion. --- builder/Makefile.am | 6 builder/downloader.ml | 84 --

[Libguestfs] [PATCH 1/3] builder: isolate C libraries in an own OCAMLCLIBS

2014-02-11 Thread Pino Toscano
Just moving stuff within Makefile.am, no functional changes. --- builder/Makefile.am | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/builder/Makefile.am b/builder/Makefile.am index 2be495b..78a9e72 100644 --- a/builder/Makefile.am +++ b/builder/Makefile.am @@ -113,10 +113

[Libguestfs] [PATCH 3/3] builder: do a copy when downloading local files

2014-02-11 Thread Pino Toscano
Instead of spawning curl even to "download" file:// URIs, just copy them. --- builder/downloader.ml | 11 +++ 1 file changed, 11 insertions(+) diff --git a/builder/downloader.ml b/builder/downloader.ml index 95b5817..e386c06 100644 --- a/builder/downloader.ml +++ b/builder/downloader.ml @

Re: [Libguestfs] [PATCH] list-filesystems: Do not segfault if guestfs_btrfs_subvolume_list returns an error (RHBZ#1064008).

2014-02-12 Thread Pino Toscano
> - return; > + return 0; > > /* Ignore LUKS-encrypted partitions. These are also containers. > */ if (STREQ (vfs_type, "crypto_LUKS")) > - return; > + return 0; > > v = vfs_type; >} > >guestfs___add_string (g, sb, device); >guestfs___add_string (g, sb, v); > + > + return 0; > } > > /* We should ignore partitions that have MBR type byte 0x42, because Looks good to me. -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

[Libguestfs] [PATCH 2/2] mllib: hostname: add a newline in /etc/hostname

2014-02-12 Thread Pino Toscano
/etc/hostname usually has an ending newline, so add it when changing it. --- mllib/hostname.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mllib/hostname.ml b/mllib/hostname.ml index e1c5d4b..cffba6b 100644 --- a/mllib/hostname.ml +++ b/mllib/hostname.ml @@ -79,7 +79,7 @@ a

[Libguestfs] [PATCH 1/2] mllib: hostname: replace the hostname on Debian also in /etc/hosts (RHBZ#953907).

2014-02-12 Thread Pino Toscano
In Debian/Ubuntu systems, read the previous hostname from /etc/hostname before replacing it, and try to carefully replace it in /etc/hosts with the new hostname. Since Perl_edit to edit /etc/hosts, it is added/changed as dependency for Hostname. --- builder/Makefile.am | 2 +- mllib/Makefile.am

[Libguestfs] [PATCH] sysprep: remove RH subscription manager files

2014-02-13 Thread Pino Toscano
Add a new operation for it, which should do what `subscription-manager clean` does. Part of RHBZ#1063374. --- po/POTFILES-ml | 1 + sysprep/Makefile.am| 1 + .../sysprep_operation_rh_subscription_manager.ml | 42 +

[Libguestfs] [PATCH] sysprep: remove RH subscription manager log files

2014-02-13 Thread Pino Toscano
Part of RHBZ#1063374. --- sysprep/sysprep_operation_logfiles.ml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sysprep/sysprep_operation_logfiles.ml b/sysprep/sysprep_operation_logfiles.ml index f154b4d..4c3eb8c 100644 --- a/sysprep/sysprep_operation_logfiles.ml +++ b/sysprep/sysprep_oper

[Libguestfs] [PATCH] mllib: hostname: replace the hostname on Debian also in /etc/hosts (RHBZ#953907).

2014-02-13 Thread Pino Toscano
In Debian/Ubuntu systems, read the previous hostname from /etc/hostname before replacing it, and replace it in /etc/hosts with the new hostname. --- mllib/hostname.ml | 27 +++ 1 file changed, 27 insertions(+) diff --git a/mllib/hostname.ml b/mllib/hostname.ml index fce16f

Re: [Libguestfs] [PATCH] mllib: hostname: replace the hostname on Debian also in /etc/hosts (RHBZ#953907).

2014-02-13 Thread Pino Toscano
On Thursday 13 February 2014 13:33:16 Richard W.M. Jones wrote: > On Thu, Feb 13, 2014 at 02:15:31PM +0100, Pino Toscano wrote: > > +let expr = "/files/etc/hosts/*[label() != '#comment']/*[label() > > != 'ipaddr'][. = '" ^ oldhost ^ "

[Libguestfs] [PATCH] mllib: hostname: on Debian replace it also in /etc/hosts (RHBZ#953907).

2014-02-13 Thread Pino Toscano
In Debian/Ubuntu systems, read the previous hostname from /etc/hostname before replacing it, and replace it in /etc/hosts with the new hostname. --- mllib/hostname.ml | 30 ++ 1 file changed, 30 insertions(+) diff --git a/mllib/hostname.ml b/mllib/hostname.ml index fce

[Libguestfs] Handling different architectures in virt-builder

2014-02-14 Thread Pino Toscano
that try to run stuff from the guest, when the host and guest architectures are different? Always deny, deny but allow with a configure switch, or don't bother and let the user get their failure? -- Pino Toscano ___ Libguestfs mai

Re: [Libguestfs] [PATCH] builder: add index-struct.h as dependency for index-parser-c.c

2014-02-17 Thread Pino Toscano
don't have a deep knowledge of it, my guess would be the way automake 1.14 handles outputs for different targets in the same build directory. As you can see, it prefixes them by the target name, so our custom rules won't apply basically. Curiously, I hit that last weekend when rebuil

Re: [Libguestfs] Handling different architectures in virt-builder

2014-02-17 Thread Pino Toscano
On Friday 14 February 2014 16:08:10 Richard W.M. Jones wrote: > On Fri, Feb 14, 2014 at 03:48:34PM +0100, Pino Toscano wrote: > > Hi, > > > > currently virt-builder's index contains only x86_64/amd64 images, so > > asking virt-builder to produce an image a

Re: [Libguestfs] Handling different architectures in virt-builder

2014-02-17 Thread Pino Toscano
On Friday 14 February 2014 16:19:39 Richard W.M. Jones wrote: > On Fri, Feb 14, 2014 at 03:48:34PM +0100, Pino Toscano wrote: > > a) adding arch=.. keys in entries > > b) rename (or just copy, to avoid breaking older virt-builders) keys > > to> > >$distro-$ve

[Libguestfs] [PATCH 2/2] fish: change order of config files being read

2014-02-17 Thread Pino Toscano
First read the global configuration and then the local one in user's HOME, so the latter can really override system settings. --- fish/config.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fish/config.c b/fish/config.c index 02d850b..9e5da87 100644 --- a/fish/config.c

[Libguestfs] [PATCH 1/2] fish: small refactor of config reading code

2014-02-17 Thread Pino Toscano
Even though so far there is just one possible setting to read, isolate in an own function the code to parse a configuration file and read the settings out of it. Now there's a new config_t handle used every time, but since config_read would reset an handle completely, there is no behaviour change.

[Libguestfs] [PATCH] fish: use XDG paths for the config file

2014-02-17 Thread Pino Toscano
Read the configuration file from XDG paths for both global and user-local locations, keeping the old paths as fallback. --- fish/config.c | 68 ++ fish/guestfish.pod | 9 -- fish/libguestfs-tools.conf.pod | 52 ++

[Libguestfs] [PATCH] builder: move the XDG path handling in an own file

2014-02-18 Thread Pino Toscano
Just code motion and renaming, no actual behaviour changes. --- builder/Makefile.am | 2 ++ builder/cmdline.ml | 9 + builder/paths.ml| 26 ++ po/POTFILES-ml | 1 + 4 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 builder/paths.ml

[Libguestfs] [PATCH] builder: accept also '_' in group names

2014-02-19 Thread Pino Toscano
--- builder/index-scan.l | 2 +- builder/index-validate.c | 8 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/builder/index-scan.l b/builder/index-scan.l index b120590..832ea51 100644 --- a/builder/index-scan.l +++ b/builder/index-scan.l @@ -52,7 +52,7 @@ extern void yy

[Libguestfs] [PATCH 2/2] builder: use a disposable GPG keyring for every Sigchecker

2014-02-20 Thread Pino Toscano
Create a temporary directory and tell gpg to use it as homedir, so imported keys do not get into the user's keyring. This also avoid importing the default key when a different one is needed to check the signature. The only exception is when a non-default fingerprint is used: in this case, that key

[Libguestfs] [PATCH 1/2] mllib: add an hook to cleanup directories on exit

2014-02-20 Thread Pino Toscano
Much similar to unlink_on_exit, but recursively cleaning directories. --- mllib/common_utils.ml | 29 + 1 file changed, 29 insertions(+) diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index 3943417..f49ede6 100644 --- a/mllib/common_utils.ml +++ b/mllib/com

Re: [Libguestfs] [PATCH 1/2] mllib: add an hook to cleanup directories on exit

2014-02-20 Thread Pino Toscano
On Thursday 20 February 2014 13:08:40 Richard W.M. Jones wrote: > On Thu, Feb 20, 2014 at 11:53:16AM +0100, Pino Toscano wrote: > > Much similar to unlink_on_exit, but recursively cleaning > > directories. > > --- > > > > mllib/common_utils.ml | 29

[Libguestfs] [PATCH 1/2] mllib: add an hook to cleanup directories on exit

2014-02-20 Thread Pino Toscano
Much similar to unlink_on_exit, but recursively cleaning directories. --- mllib/common_utils.ml | 35 +++ 1 file changed, 35 insertions(+) diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index 3943417..d02a2d3 100644 --- a/mllib/common_utils.ml +++ b/mll

[Libguestfs] [PATCH 1/2] mllib: add an hook to cleanup directories on exit

2014-02-20 Thread Pino Toscano
Much similar to unlink_on_exit, but recursively cleaning directories. --- mllib/common_utils.ml | 23 +++ 1 file changed, 23 insertions(+) diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index 3943417..de3bd40 100644 --- a/mllib/common_utils.ml +++ b/mllib/common_ut

Re: [Libguestfs] [PATCH 2/2] builder: use a disposable GPG keyring for every Sigchecker

2014-02-21 Thread Pino Toscano
On Friday 21 February 2014 11:10:54 Richard W.M. Jones wrote: > On Thu, Feb 20, 2014 at 11:53:17AM +0100, Pino Toscano wrote: > > Create a temporary directory and tell gpg to use it as homedir, so > > imported keys do not get into the user's keyring. This also avoid > >

Re: [Libguestfs] [PATCH 2/2] builder: use a disposable GPG keyring for every Sigchecker

2014-02-21 Thread Pino Toscano
On Friday 21 February 2014 13:04:34 Richard W.M. Jones wrote: > On Fri, Feb 21, 2014 at 01:50:30PM +0100, Pino Toscano wrote: > > On Friday 21 February 2014 11:10:54 Richard W.M. Jones wrote: > > > On Thu, Feb 20, 2014 at 11:53:17AM +0100, Pino Toscano wrote: > > > >

[Libguestfs] [PATCH] builder: allow Sigchecker to import keys from file

2014-02-21 Thread Pino Toscano
Extend Sigchecker so it allows both fingerprints (to be imported from user's keyring, as before) and keys stored in files. To simplify this process (and have the fingerprint always around), the key is imported on Sigchecker.create time, instead of lazily at the first verification. --- builder/buil

[Libguestfs] [PATCH] builder: add an arch field to sources read from indexes

2014-02-21 Thread Pino Toscano
Add an architecture field for all the entries in each index, so we know which architecture they are (not used right now, but will be in the future). The problematic part here is properly marking with the correct architecture: since we only know the current index on libguestfs.org contains x86_64/a

Re: [Libguestfs] [PATCH] builder: add an arch field to sources read from indexes

2014-02-21 Thread Pino Toscano
On Friday 21 February 2014 16:29:23 Richard W.M. Jones wrote: > On Fri, Feb 21, 2014 at 05:17:59PM +0100, Pino Toscano wrote: > > Add an architecture field for all the entries in each index, so we > > know which architecture they are (not used right now, but will be &g

[Libguestfs] [PATCH] builder: add a mandatory 'arch' key in index files

2014-02-24 Thread Pino Toscano
Introduce a mandatory arch= key in all the entries of index files, to identify which architecture is each. Adapt the long and JSON list outputs to print also this new field. This introduces an incompatibility with index files created with virt-builder < 1.26, as they will be rejected until entries

[Libguestfs] [PATCH] sysprep: use Mkdtemp to create the temporary directory

2014-02-24 Thread Pino Toscano
Use the safer mkdtemp instead of manually creating a path. --- sysprep/Makefile.am | 2 ++ sysprep/sysprep_operation_script.ml | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sysprep/Makefile.am b/sysprep/Makefile.am index 2600477..9c9ab14 100644 --- a/sysp

[Libguestfs] [PATCH] builder: split INI C <-> OCaml glue code in own module

2014-02-24 Thread Pino Toscano
Move in an own module the code which calls the C virt_builder_parse_index and does the array -> list conversion of the result. This way this code can be easily called also in places different than Index_parser without the need to copy the types mapping, etc. Just code motion, no actual behaviour c

Re: [Libguestfs] [PATCH] builder: add a mandatory 'arch' key in index files

2014-02-24 Thread Pino Toscano
On Monday 24 February 2014 15:15:11 Richard W.M. Jones wrote: > On Mon, Feb 24, 2014 at 11:36:29AM +0100, Pino Toscano wrote: > > Introduce a mandatory arch= key in all the entries of index files, > > to > > identify which architecture is each. Adapt the long and JSON list

[Libguestfs] [PATCH 4/8] builder: extract the default key to file

2014-02-25 Thread Pino Toscano
This is basically default_pubkey from sigchecker.ml, just extracted as file. Not used right now, but will be in the future. --- builder/libguestfs.gpg | 64 ++ 1 file changed, 64 insertions(+) create mode 100644 builder/libguestfs.gpg diff --git a/

[Libguestfs] [PATCH 0/8] virt-builder: use .conf files for configuration

2014-02-25 Thread Pino Toscano
used at all). Thanks, Pino Toscano (8): builder: allow "no key" as key in Sigchecker builder: use Sigchecker.gpgkey_type for the fingerprint builder: add functions to read XDG_CONFIG_DIRS and XDG_CONFIG_PATH builder: extract the default key to file builder: switch sources to .

[Libguestfs] [PATCH 5/8] builder: switch sources to .conf files

2014-02-25 Thread Pino Toscano
Introduce and use simple .conf files to configure the sources of indexes for virt-builder. The location of these files is in XDG_CONFIG_DIRS / XDG_CONFIG_HOME, so it can be easily overridden. There are three .conf(.in) files shipped with this commit: - "test-index.conf.in" (in "test-config"), whic

[Libguestfs] [PATCH 3/8] builder: add functions to read XDG_CONFIG_DIRS and XDG_CONFIG_PATH

2014-02-25 Thread Pino Toscano
--- builder/paths.ml | 15 +++ 1 file changed, 15 insertions(+) diff --git a/builder/paths.ml b/builder/paths.ml index 66e8922..e4f0c7b 100644 --- a/builder/paths.ml +++ b/builder/paths.ml @@ -24,3 +24,18 @@ let xdg_cache_home = try Some (Sys.getenv "HOME" // ".cache" // "virt-bu

[Libguestfs] [PATCH 7/8] builder: remove the default fingerprint/pubkey

2014-02-25 Thread Pino Toscano
Sigchecker can still import keys from the user's keyring, so there is no need to hardcode fingerprint and key of the index hosted on libguestfs.org (which is now pointed to using a .conf file). --- builder/sigchecker.ml | 79 -- builder/sigchecker.m

[Libguestfs] [PATCH 6/8] builder: remove VIRT_BUILDER_SOURCE and VIRT_BUILDER_FINGERPRINT

2014-02-25 Thread Pino Toscano
Drop these two environment variables, and the implicit hardcoded source hosted at libguestfs.org. This means all the sources must be provided as .conf files, or at each invocation with --source. --- builder/cmdline.ml | 20 +--- 1 file changed, 1 insertion(+), 19 deletions(-) diff

[Libguestfs] [PATCH 8/8] builder: update documentation

2014-02-25 Thread Pino Toscano
Update the documentation according to the new .conf files structure, the drop of VIRT_BUILDER_SOURCE and VIRT_BUILDER_FINGERPRINT, the drop of hardcoded source and its key, etc. --- builder/virt-builder.pod | 154 +++ 1 file changed, 75 insertions(+), 79

[Libguestfs] [PATCH 1/8] builder: allow "no key" as key in Sigchecker

2014-02-25 Thread Pino Toscano
Additional way to distinguish no actual key available for signature checking; make sure to not allow signing in such situation. --- builder/sigchecker.ml | 8 builder/sigchecker.mli | 1 + 2 files changed, 9 insertions(+) diff --git a/builder/sigchecker.ml b/builder/sigchecker.ml index

[Libguestfs] [PATCH 2/8] builder: use Sigchecker.gpgkey_type for the fingerprint

2014-02-25 Thread Pino Toscano
Use Sigchecker.gpgkey_type instead of just string as type in the sources list; adapt the listing code (and its expected output) to that. No behaviour change which eases a bit the addition of new sources with other key types. --- builder/builder.ml| 9 ++--- builder/list_entri

[Libguestfs] [PATCH] builder, sparsify: use // for file concatenation

2014-02-26 Thread Pino Toscano
Just syntactic sugar, no behaviour changes. --- builder/builder.ml | 2 +- sparsify/sparsify.ml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builder/builder.ml b/builder/builder.ml index 1800f2d..77e37d2 100644 --- a/builder/builder.ml +++ b/builder/builder.ml @@ -815,7

[Libguestfs] [PATCH] tests/luks: disable if luks is not available

2014-02-28 Thread Pino Toscano
--- tests/luks/test-luks-list.sh | 6 ++ tests/luks/test-luks.sh | 6 ++ 2 files changed, 12 insertions(+) diff --git a/tests/luks/test-luks-list.sh b/tests/luks/test-luks-list.sh index 13e7655..bb8389c 100755 --- a/tests/luks/test-luks-list.sh +++ b/tests/luks/test-luks-list.sh @@ -

Re: [Libguestfs] [PATCH 5/8] builder: switch sources to .conf files

2014-02-28 Thread Pino Toscano
On Thursday 27 February 2014 10:10:39 Richard W.M. Jones wrote: > On Tue, Feb 25, 2014 at 05:29:10PM +0100, Pino Toscano wrote: > > Introduce and use simple .conf files to configure the sources of > > indexes for virt-builder. The location of these files is in > > XDG_CONFIG_D

[Libguestfs] [PATCH] builder: add libguestfs.gpg to EXTRA_DIST

2014-02-28 Thread Pino Toscano
It needs to be in EXTRA_DIST, otherwise it is not put in the dist. --- builder/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/builder/Makefile.am b/builder/Makefile.am index f0cb1dd..2dc9d23 100644 --- a/builder/Makefile.am +++ b/builder/Makefile.am @@ -27,6 +27,7 @@ AM_CFLAGS = \

[Libguestfs] [PATCH] builder: install a $sysconfdir/virt-builder -> xdg-virt-builder symlink

2014-03-03 Thread Pino Toscano
This way "virt-builder" appears directly in the sysconfdir. --- builder/Makefile.am | 3 +++ configure.ac| 1 + 2 files changed, 4 insertions(+) diff --git a/builder/Makefile.am b/builder/Makefile.am index a539e91..b3de967 100644 --- a/builder/Makefile.am +++ b/builder/Makefile.am @@ -246

[Libguestfs] [PATCH 2/2] tests: add a basic run test

2014-03-05 Thread Pino Toscano
Add a simple test which just runs the basic options of supermin, so it can be tested even if the other tests (all being network tests) are disabled. --- tests/Makefile.am | 3 ++- tests/test-basic.sh | 28 2 files changed, 30 insertions(+), 1 deletion(-) create mod

[Libguestfs] [PATCH 1/2] dpkg: do not always run dpkg_primary_arch

2014-03-05 Thread Pino Toscano
Having dpkg_primary_arch as a top-level statement means it will be evaluated at startup, which will fail if dpkg is not installed. Turn it into a function so it can be run just when needed. --- src/dpkg.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dpkg.ml b/src/d

[Libguestfs] [PATCH 0/2] supermin: fix with no dpkg installed

2014-03-05 Thread Pino Toscano
f093ba80e0918484838dba46a747ffaecf983fb3 caused a regression (startup failure) when dpkg is not installed. Simple fix with simple test for it. Pino Toscano (2): dpkg: do not always run dpkg_primary_arch tests: add a basic run test src/dpkg.ml | 4 ++-- tests/Makefile.am | 3

[Libguestfs] [PATCH] tests: add simple automake to junit xml conversion script

2014-03-07 Thread Pino Toscano
Add (and ship) a simple ocaml script which can convert the results of automake unit tests (.trs + .log files) to a junit-like .xml file, suitable for importing in CI systems (such as jenkins). --- tests/Makefile.am | 4 +- tests/automake2junit.ml | 128 +

Re: [Libguestfs] [PATCH] tests: add simple automake to junit xml conversion script

2014-03-07 Thread Pino Toscano
On Friday 07 March 2014 13:47:02 Pino Toscano wrote: > Add (and ship) a simple ocaml script which can convert the results of > automake unit tests (.trs + .log files) to a junit-like .xml file, > suitable for importing in CI systems (such as jenkins). > --- > tests/Makefile

[Libguestfs] [PATCH] builder: use Filename.check_suffix

2014-03-10 Thread Pino Toscano
... instead of manually extracting and checking the suffix by ourselves --- builder/sources.ml | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/builder/sources.ml b/builder/sources.ml index fd0b236..016adc4 100644 --- a/builder/sources.ml +++ b/builder/sources.ml @@ -87,10 +

[Libguestfs] [PATCH] builder: complete architecture handling

2014-03-10 Thread Pino Toscano
Add the possibility to choose which architecture use to build the wanted image (--arch). Since this implies that running commands on the guest is usually not possible when the architecture is different than the host one, another new option (--allow-foreign-arch-ops) allows to run commands neverthel

Re: [Libguestfs] [PATCH 2/3] New API parameter: Add discard parameter to guestfs_add_drive_opts.

2014-03-10 Thread Pino Toscano
card_enable: > +if (!guestfs___discard_possible (g, drv, major, minor)) There is an argument mismatch in this call to guestfs___discard_possible (int's vs bool's). What about turn guestfs___discard_possible to just get the qemu version, and do the checks in

Re: [Libguestfs] [PATCH 1/3] launch: libvirt: Move the is_kvm flag (derived from libvirt capabilities) to backend data struct.

2014-03-10 Thread Pino Toscano
ibvirt_xml_params struct has already a 'struct backend_libvirt_data *data' member, I guess these (and the others) functions could just access params->data->is_kvm with no need to pass also backend_libvirt_data around, no? After all, construct_libvirt_xml_name does this already.

[Libguestfs] [PATCH 1/2] builder: move some language-related code into a Languages module

2014-03-11 Thread Pino Toscano
Mostly code motion, no behaviour changes. --- builder/Makefile.am | 3 +++ builder/languages.ml| 57 + builder/languages.mli | 21 ++ builder/list_entries.ml | 36 ++- 4 files changed, 83 inserti

[Libguestfs] [PATCH 2/2] builder: output translated notes also in --notes

2014-03-11 Thread Pino Toscano
--- builder/builder.ml | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/builder/builder.ml b/builder/builder.ml index 1800f2d..274edfe 100644 --- a/builder/builder.ml +++ b/builder/builder.ml @@ -215,11 +215,12 @@ let main () = (match mode with | `Notes ->

Re: [Libguestfs] [PATCH] builder: complete architecture handling

2014-03-11 Thread Pino Toscano
On Tuesday 11 March 2014 10:09:45 Richard W.M. Jones wrote: > On Mon, Mar 10, 2014 at 02:28:20PM +0100, Pino Toscano wrote: > > Add the possibility to choose which architecture use to build the > > wanted image (--arch). Since this implies that running commands on > > the

[Libguestfs] [PATCH 2/2] builder: complete architecture handling

2014-03-11 Thread Pino Toscano
Add the possibility to choose which architecture use to build the wanted image (--arch). Since this implies that running commands on the guest is usually not possible when the architecture is different than the host one, virt-builder will nevertheless try to check whether the host is compatible wit

[Libguestfs] [PATCH 1/2] builder: show the architecture in the short --list output

2014-03-11 Thread Pino Toscano
Just like the other --list output formats provide the architecture, show them also in the short format. --- builder/list_entries.ml | 2 ++ builder/test-virt-builder-list.sh | 14 +++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/builder/list_entries.ml b/bui

Re: [Libguestfs] [PATCH v2 03/18] New API parameter: Add discard parameter to guestfs_add_drive_opts.

2014-03-12 Thread Pino Toscano
cow2", "unsafe", > +discard_disable) == -1) > return -1; > > if (construct_libvirt_xml_disk_address (g, xo, Even if passing discard_disable makes sure that now "data" and "drv" are not used within

Re: [Libguestfs] [PATCH v2 00/18] Add discard support.

2014-03-12 Thread Pino Toscano
support to virt-format. > > - Adds discard support to virt-sysprep. > > - Implements virt-sparsify --in-place. Do you plan to wait to solve the issues (wrt the linux-ext4 discussion) before pushing the series? There are few commits (01, 02, 11, 12, 13, 14, 15, 16) which IMHO could go

[Libguestfs] [PATCH] drivers: group drive creation params in an own struct

2014-03-12 Thread Pino Toscano
groups together all the various parameters (except the guestfs handle) passed to the create_drive_*, to avoid passing all of them at every function call. This is mostly an internal refatoring with no behaviour change. --- src/drives.c | 416

Re: [Libguestfs] [PATCH v3 00/10] Add discard support.

2014-03-12 Thread Pino Toscano
eration and the other is a "query", would it be possible to give them clearer names? Or it is better to have them more close to what they actually do? - is there any way to check at runtime for the availability of those two functions in the kernel/fs, and maybe advertise that as &

[Libguestfs] [PATCH 3/3] php: fix crash with OStringList optional arguments

2014-03-13 Thread Pino Toscano
Properly initialize the variables for them to NULL, so there is no crash because of trying to use rubbish pointers. Kind of followup of commit 289fd29f0bfbb94566d9780dd8ac3fe15e55541d. --- generator/php.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generator/php.ml b/gene

[Libguestfs] [PATCH 2/3] php: remove the custom "env" loading in tests

2014-03-13 Thread Pino Toscano
Other than being too late for changing environment variables like LD_LIBRARY_PATH, now it is no more needed. --- php/extension/guestfs_php_001.phpt | 14 -- php/extension/guestfs_php_002.phpt | 14 -- php/extension/guestfs_php_003.phpt | 14 -- 3 files changed,

[Libguestfs] [PATCH 1/3] php: add a custom PHP runner for tests

2014-03-13 Thread Pino Toscano
Since the default PHP test runner ignores a good number of environment variables to potentially tampering the test suite execution, create a custom php-for-tests.sh script which does nothing more than sourcing the custom environment that our run-php-tests.sh outputs and running the actual "php" exe

[Libguestfs] [PATCH 2/2] tests: skip the output of test-virt-rescue.pl from RUN_OUTPUT_FILE

2014-03-14 Thread Pino Toscano
The output of test-virt-rescue.pl contains non-ASCII chars which give troubles when being XSLT-transformed, so just avoid its output to leave the rest of the resulting XML well-formed. --- run.in | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/run.in b/run.in index a508c38

[Libguestfs] [PATCH 1/2] tests: provide a simple way to extract the tests data from run

2014-03-14 Thread Pino Toscano
If the RUN_OUTPUT_FILE environment variable is set, "run" will output to the file indicated by that snippets of XML with the results and outputs of the tests run. Together with the run-xml-to-junit.sh (and its associated run-xml-to-junit.xsl style sheet) it is possible to convert that output file

[Libguestfs] [PATCH] sparsify: skip test-virt-sparsify-in-place.sh if discard is not supported

2014-03-17 Thread Pino Toscano
Try adding a dummy drive with discard enabled as test before using virt-sparsify --in-place (which needs discard). --- sparsify/test-virt-sparsify-in-place.sh | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sparsify/test-virt-sparsify-in-place.sh b/sparsify/test

Re: [Libguestfs] [PATCH] sparsify: skip test-virt-sparsify-in-place.sh if discard is not supported

2014-03-17 Thread Pino Toscano
appliance seems a clean way to detect that feature availability (hooking it into a "feature"). > So, see the patch series I have just posted. Works for me (the test is properly SKIPped). Thanks, -- Pino Toscano ___ Libguestfs mai

[Libguestfs] [PATCH] tests: properly cleanup the temporary directories

2014-03-17 Thread Pino Toscano
Chmod the temporary directory again so we can clean it all, avoid leaving stray temporary directories. This is a kind of revert of few parts of commit 22b0662ebf64e93dc275acc1cc37ebd12cce6b49, but adapted to the unique $tmpdir used now. --- tests/test-binaries-exist.sh | 4 +++- tests/test-harder

[Libguestfs] [PATCH 2/2] php: move tests under a tests subdirectory

2014-03-18 Thread Pino Toscano
This eases fixes the classname in the junit output of run-tests.php, which now can be properly handled by junit XML consumers. --- php/extension/guestfs_php_001.phpt | 13 php/extension/guestfs_php_002.phpt | 36 php/extension/guestfs_php_0

[Libguestfs] [PATCH 1/2] php: make the test suite failures fatal

2014-03-18 Thread Pino Toscano
So far the failure of some test would have not reported a non-zero return value by run-tests.php. Since now all the PHP tests pass, we can ask for failures to be fatal, by exporting REPORT_EXIT_STATUS=1 for run-tests.php. --- php/run-php-tests.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletion

[Libguestfs] [PATCH 3/3] builder: show the application name in errors of the index parser

2014-03-19 Thread Pino Toscano
--- builder/index-parse.y| 4 +++- builder/index-parser-c.c | 5 +++-- builder/index-struct.h | 1 + builder/index_parser.ml | 2 +- builder/ini_reader.ml| 6 +++--- builder/ini_reader.mli | 2 +- builder/sources.ml | 2 +- 7 files changed, 13 insertions(+), 9 deletions(-) diff

[Libguestfs] [PATCH 2/3] builder: show the file name in errors of the index parser

2014-03-19 Thread Pino Toscano
--- builder/index-parse.y| 4 +++- builder/index-parser-c.c | 1 + builder/index-struct.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/builder/index-parse.y b/builder/index-parse.y index dee2aec..9c75f71 100644 --- a/builder/index-parse.y +++ b/builder/index-parse.y @

[Libguestfs] [PATCH 1/3] builder: make the C index parser reentrant

2014-03-19 Thread Pino Toscano
Switch the lex/yacc parser into reentrant mode, to ease the handling of parsing-specific data; introduce a new parser_context struct for that, which is added as extra data to the parser. This should cause no behaviour changes in the parsing, just no more global variables used for getting data in/o

Re: [Libguestfs] [PATCH] customize: Move virt-customize-related code to a separate directory.

2014-03-19 Thread Pino Toscano
now is split the actual list of customize operations in an own file, just like actions.ml has only the lists of actions. I know the list of operations won't make this file that big as actions.ml is, but still would be cleaner to have "data vs operations". -- Pino Toscano

[Libguestfs] [PATCH] tests/run-xml-to-junit.xsl: allow to define a different classname

2014-03-19 Thread Pino Toscano
Read and use the classname attribute in each test if present, falling back to "TestSuite" (used so far). --- tests/run-xml-to-junit.xsl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/run-xml-to-junit.xsl b/tests/run-xml-to-junit.xsl index b0d56f3..3bae981 100644 --- a/

Re: [Libguestfs] [PATCH 2/3] builder: show the file name in errors of the index parser

2014-03-20 Thread Pino Toscano
On Wednesday 19 March 2014 22:16:47 Richard W.M. Jones wrote: > On Wed, Mar 19, 2014 at 05:53:10PM +0100, Pino Toscano wrote: > > --- > > > > builder/index-parse.y| 4 +++- > > builder/index-parser-c.c | 1 + > > builder/index-struct.h | 1 + > &g

[Libguestfs] [PATCH 3/3] builder: clean the parsing structs on error

2014-03-20 Thread Pino Toscano
--- builder/index-parse.y | 5 + 1 file changed, 5 insertions(+) diff --git a/builder/index-parse.y b/builder/index-parse.y index 5554e53..9355bd4 100644 --- a/builder/index-parse.y +++ b/builder/index-parse.y @@ -90,6 +90,11 @@ typedef void *yyscan_t; %parse-param { yyscan_t scanner } %par

[Libguestfs] [PATCH 2/3] builder: rename and make public the section/field free functions

2014-03-20 Thread Pino Toscano
They will be needed also elsewhere. --- builder/index-struct.c | 19 --- builder/index-struct.h | 10 ++ 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/builder/index-struct.c b/builder/index-struct.c index f32534c..eacca6c 100644 --- a/builder/index-struct

[Libguestfs] [PATCH 1/3] builder/virt-index-validate: try to cleanup in any occasion

2014-03-20 Thread Pino Toscano
Always close the file (ignoring its result) after a parsing, and cleanup the parse_context object before any exit(). This eases the debugging of memory issues in the actual parser. --- builder/index-validate.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a

Re: [Libguestfs] Python bindings : 'GuestFS' object has no attribute 'disk_create'

2014-03-20 Thread Pino Toscano
1024)" i get an error saying that this function does not exist ! The disk-create API has been added quite recently in the development serie 1.25, and to be precise it is available in >= 1.25.30. So if you are running a stable serie of libguestfs (say 1.24, 1.22, etc) you do not h

[Libguestfs] [PATCH] builder: allow to run website tests under valgrind

2014-03-20 Thread Pino Toscano
--- builder/website/Makefile.am | 3 +++ builder/website/validate.sh | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/builder/website/Makefile.am b/builder/website/Makefile.am index a5b1bcf..6b609f6 100644 --- a/builder/website/Makefile.am +++ b/builder/website/Makefile.am

Re: [Libguestfs] [PATCH 1/3] builder/virt-index-validate: try to cleanup in any occasion

2014-03-20 Thread Pino Toscano
On Thursday 20 March 2014 14:15:29 Richard W.M. Jones wrote: > On Thu, Mar 20, 2014 at 02:48:11PM +0100, Pino Toscano wrote: > > Always close the file (ignoring its result) after a parsing, and > > cleanup the parse_context object before any exit(). > > > > This ea

[Libguestfs] [PATCH 2/2] builder: do not parse the same repository file name twice

2014-03-20 Thread Pino Toscano
When parsing the repository configuration files, track the file names parsed, and in case of same file name in multiple location consider only the one in the directory coming before others in the prioritised list of paths. This way it is possible to "shadow" a configuration file in a system path w

[Libguestfs] [PATCH 1/2] builder: allow the index parser to parse files with no sections

2014-03-20 Thread Pino Toscano
Gracefully handle files with no sections; extend the validate.sh test to try to validate an empty file. --- builder/index-parse.y | 2 ++ builder/website/validate.sh | 7 +++ 2 files changed, 9 insertions(+) diff --git a/builder/index-parse.y b/builder/index-parse.y index 9355bd4..51339

[Libguestfs] [PATCH] Fix translation issue in Ukrainian translation

2014-03-24 Thread Pino Toscano
__FOO__ markers have to be left as they are, as they represent placeholders for further sections. Unfortunately it seems there's no easy way to exclude them from the template, so for now just manually ensure/fix they are not translated differently than English. --- po-docs/uk.po | 2 +- 1 file ch

[Libguestfs] [PATCH] php: raise the per-test timeout to 300 secs

2014-03-24 Thread Pino Toscano
Some tests might spawn an appliance, which will take time on slower architectures and on some virtualized environments. Hence raise the per-test timeout from the default of 60s to 300s (which should be hopefully enough for now). --- php/run-php-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 de

<    1   2   3   4   5   6   7   8   9   10   >