[Libguestfs] [PATCH 7/7] customize: add copy-in operation (RHBZ#1135585).

2015-02-02 Thread Pino Toscano
Add the copy-in operation to virt-customize/builder/sysprep, so it is possible to easily copy directories at once in the guest. --- builder/cmdline.ml | 2 +- customize/customize_run.ml | 4 generator/customize.ml | 13 + 3 files changed, 18 insertions(+), 1 deletion

[Libguestfs] [PATCH 0/7 v2] Make copy_in & copy_out APIs, and use copy_in in customize

2015-02-02 Thread Pino Toscano
Hi, attached there is the second version of the patch series adding copy_in and copy_out in the library, mostly moving them from guestfish. It also adds the copy_in usage in virt-customize, as aid in a new image building. Thanks, Pino Toscano (7): cmd: add a way to run (and wait

[Libguestfs] [PATCH 3/7] cmd: add the possibility to get a fd to the process stdin

2015-02-02 Thread Pino Toscano
Add the possibility to forward to the stdin of the process, and get the fd for it; only in async mode for now. --- src/command.c | 43 ++- src/guestfs-internal.h | 2 +- 2 files changed, 39 insertions(+), 6 deletions(-) diff --git a/src/command.c

[Libguestfs] [PATCH 2/7] cmd: add a child-setup callback

2015-02-02 Thread Pino Toscano
Easy way to do pre-exec setup in the child process. --- src/command.c | 22 ++ src/guestfs-internal.h | 2 ++ 2 files changed, 24 insertions(+) diff --git a/src/command.c b/src/command.c index e26573d..563d0af 100644 --- a/src/command.c +++ b/src/command.c @@ -134,6

[Libguestfs] [PATCH 1/7] cmd: add a way to run (and wait) asynchronously commands

2015-02-02 Thread Pino Toscano
--- src/command.c | 64 +++--- src/guestfs-internal.h | 3 +++ 2 files changed, 58 insertions(+), 9 deletions(-) diff --git a/src/command.c b/src/command.c index 4bb469b..e26573d 100644 --- a/src/command.c +++ b/src/command.c @@ -360,7 +360,7

[Libguestfs] [PATCH 5/7] New APIs: copy-in and copy-out

2015-02-02 Thread Pino Toscano
Currently implemented as guestfish commands, provide them instead as single source -> destination functions for the library, so they can be used also in other places. These functions are not added to guestfish, since guestfish has its own implementation (which will soon switch to call copy-in and

[Libguestfs] [PATCH 4/7] generator: add VPublicNoFish visibility type

2015-02-02 Thread Pino Toscano
Usable to have public functions, i.e. like VPublic, but do not showing them in guestfish. --- generator/actions.ml | 6 +++--- generator/c.ml | 2 +- generator/types.ml | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/generator/actions.ml b/generator/actions.ml index

Re: [Libguestfs] [PATCH 5/6] New APIs: copy-in and copy-out

2015-02-02 Thread Pino Toscano
On Monday 02 February 2015 13:40:44 Richard W.M. Jones wrote: > On Mon, Jan 26, 2015 at 05:04:10PM +0100, Pino Toscano wrote: > > Currently implemented as guestfish commands, provide them instead as > > single source -> destination functions for the library, so they can be >

[Libguestfs] [PATCH 6/7] fish: use copy-in and copy-out

2015-02-02 Thread Pino Toscano
Simply the copy-in & copy-out commands of guestfish using the new implementations of copy-in & copy-out in the library. --- fish/copy.c | 279 +--- 1 file changed, 4 insertions(+), 275 deletions(-) diff --git a/fish/copy.c b/fish/copy.c inde

Re: [Libguestfs] [PATCH] btrfs: fix parsing of output of 'btrfs qgroup show' (RHBZ#1188553)

2015-02-04 Thread Pino Toscano
, path_buf); >ADD_ARG (argv, i, NULL); It seems that --raw has been added in btrfs-tools 0.18.2, so need to check for the availability of that parameter, and pass it only in that case. Thanks, -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] resize: Preserve GPT GUID so we don't break EFI bootloaders (RHBZ#1189284)

2015-02-05 Thread Pino Toscano
ition GUID is used by the bootloader NVRAM variables to identify > the boot partition, so it must be preserved across resize. > > This bug caused the 'virt-builder --size' option to fail on aarch64. LGTM. -- Pino Toscano ___ Libgues

[Libguestfs] [PATCH] perl: tests: reenable set_path tests

2015-02-05 Thread Pino Toscano
guestfs_set_path now does a copy of the passed string, so bindings don't need to take care of the lifetime of strings parameters for it. --- perl/t/060-handle-properties.t | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/perl/t/060-handle-properties.t b/perl/t/060-

Re: [Libguestfs] Patchable build problems on OS X 10.10

2015-02-09 Thread Pino Toscano
* is new and not the default, so we can get away with forcing > > * people who want to try it to have a reasonably new version of This IMHO is clearly wrong: the O_* constants are for open() & friends, not for socket & socket4. Theoretically, we could switch the socket() usages

Re: [Libguestfs] Patchable build problems on OS X 10.10

2015-02-09 Thread Pino Toscano
On Monday 09 February 2015 10:27:21 Richard W.M. Jones wrote: > On Mon, Feb 09, 2015 at 10:56:54AM +0100, Pino Toscano wrote: > > On Friday 06 February 2015 10:03:37 Richard W.M. Jones wrote: > > > On Thu, Feb 05, 2015 at 10:53:06PM +, Margaret Lewicka wrote: > > &g

Re: [Libguestfs] [PATCH 1/5] macosx: Add required third parameter for xdrproc_t callbacks

2015-02-09 Thread Pino Toscano
{ > +#else > +/* Mac OS X's implementation of xdrproc_t requires a third parameter */ > +if (xdrp && ret && !xdrp (&xdr, ret, 0)) { > +#endif >error (g, "%s: failed to parse reply", fn); >xdr_destroy (&xdr); >r

Re: [Libguestfs] [PATCH 3/5] java: Turn off doclint to prevent errors on JDK 8

2015-02-09 Thread Pino Toscano
JAVAC_FLAGS) -encoding utf-8 > -JAVADOC_FLAGS = -encoding utf-8 > +JAVADOC_FLAGS = -encoding utf-8 -Xdoclint:none I'd say it would be much better to fix the issues doclint issues, if possible, rather than disabling all of them. -- Pino Toscano ___

[Libguestfs] [PATCH 2/3] java: fix/improve slightly the javadoc

2015-02-10 Thread Pino Toscano
- use .. for text paragraphs, instead of just using to separate them - slightly improve the metadata in eventToString and set_event_callback - fix the textual @see in set_event_callback, so it is accepted also in JDK 8 - escape the doc text, so &, <, and > will not be considered as HTML tags

[Libguestfs] [PATCH 1/3] generator: add a simple HTML escaping function

2015-02-10 Thread Pino Toscano
--- generator/utils.ml | 8 +++- generator/utils.mli | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/generator/utils.ml b/generator/utils.ml index b24ba8c..3a62084 100644 --- a/generator/utils.ml +++ b/generator/utils.ml @@ -360,4 +360,10 @@ let args_of_optargs optargs

[Libguestfs] [PATCH 3/3] java: add @Deprecated annotation for deprecated methods

2015-02-10 Thread Pino Toscano
--- generator/java.ml | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/generator/java.ml b/generator/java.ml index 8b0d12f..81faff1 100644 --- a/generator/java.ml +++ b/generator/java.ml @@ -280,7 +280,11 @@ public class GuestFS { pr " */\n"; );

[Libguestfs] [PATCH 1/4] php: fix invalid memory access with OptString

2015-02-10 Thread Pino Toscano
OptString maps to a "s!" argument, which makes zend_parse_parameters not touch the variables (char* and length) when NULL is passed as parameter. Hence, set both to NULL/0, and check for non-NULL char* variable before checking its length. --- generator/php.ml | 15 +-- 1 file changed,

[Libguestfs] [PATCH 2/4] php: move common code in helper functions

2015-02-10 Thread Pino Toscano
Simple code motion. --- generator/php.ml | 95 +--- 1 file changed, 42 insertions(+), 53 deletions(-) diff --git a/generator/php.ml b/generator/php.ml index 1384451..69f627f 100644 --- a/generator/php.ml +++ b/generator/php.ml @@ -91,6 +91,45 @@

[Libguestfs] [PATCH 4/4] php: fix memory leak in OStringList optargs

2015-02-10 Thread Pino Toscano
Make sure to free the char** created to convert the arguments. --- generator/php.ml | 10 ++ 1 file changed, 10 insertions(+) diff --git a/generator/php.ml b/generator/php.ml index 28903d0..b49bf60 100644 --- a/generator/php.ml +++ b/generator/php.ml @@ -458,6 +458,16 @@ PHP_FUNCTION (gue

[Libguestfs] [PATCH 3/4] php: fix invalid memory access with stringlist params

2015-02-10 Thread Pino Toscano
Make sure to copy the strings we add to the char** array, otherwise they are stale pointers which we'll try to free later. Also, properly destruct the temporary zval. --- generator/php.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/generator/php.ml b/generator/php.ml ind

[Libguestfs] [PATCH] php: add a simple bindtests test

2015-02-10 Thread Pino Toscano
Generate a simple bindtests test for the PHP binding, so it is possible to easily test all the argument types. Unlike the bindtests for other languages, optional arguments are not tested, due to the limitations of optional arguments in PHP (or maybe they way we implement them). --- .gitignore

[Libguestfs] [PATCH 3/3] ocaml: hide internal methods from apidocs

2015-02-12 Thread Pino Toscano
--- generator/ocaml.ml | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/generator/ocaml.ml b/generator/ocaml.ml index f8707ae..9284005 100644 --- a/generator/ocaml.ml +++ b/generator/ocaml.ml @@ -144,9 +144,14 @@ end fun ({ name = name; style = style; depre

[Libguestfs] [PATCH 1/3] gobject: generate deprecation markers

2015-02-12 Thread Pino Toscano
Generate proper deprecation markers for API documentation and introspection annotations. --- generator/gobject.ml | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/generator/gobject.ml b/generator/gobject.ml index 5b07edd..e563610 100644 --- a/generator/gobject.ml +++ b/ge

[Libguestfs] [PATCH 2/3] actions: fix a couple of docs references

2015-02-12 Thread Pino Toscano
--- generator/actions.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generator/actions.ml b/generator/actions.ml index 6b37712..2e0af55 100644 --- a/generator/actions.ml +++ b/generator/actions.ml @@ -2415,7 +2415,7 @@ the algorithm described in L. =item C -Convert

Re: [Libguestfs] [PATCH 1/3] macosx: Includes/defines for byteswap operations

2015-02-12 Thread Pino Toscano
quot;full-read.h" > > #include "guestfs.h" This code clearly need some refactoring, before adding more copy/pasted parts to it. I'd say to do this in two steps: a) moving the definitions of the current be32toh/etc to a new src/guestfs-byteswap.h (internal), making use of it b) add the proper definitions needed on Mac OS X Thanks, -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [PATCH 2/3] builder: Check HAVE_POSIX_FADVISE before using it

2015-02-12 Thread Pino Toscano
ignore_value (posix_fadvise (fd, 0, 0, > POSIX_FADV_RANDOM|POSIX_FADV_DONTNEED)); > +#endif > >/* Iterate over blocks. */ >iter_blocks (idx, nr_threads, filenamev, fd, outputfilev, ofd); > LGTM. -- Pino Toscano ___ Libg

Re: [Libguestfs] [PATCH] macosx: Darwin-specific autoconf macros

2015-02-12 Thread Pino Toscano
OS X? If not, I'd say to use a variable for the library paths we want to add, then adding them to both LD_LIBRARY_PATH and DYLD_LIBRARY_PATH; something like libdirs="$b/src/.libs:...etc" # Set LD_LIBRARY_PATH to contain library. if [ -z "$LD_LIBRARY_PATH" ]; then LD_LIBRARY_PATH="$libdirs" else LD_LIBRARY_PATH="$libdirs:$LD_LIBRARY_PATH" fi export LD_LIBRARY_PATH # ditto for DYLD_LIBRARY_PATH Thanks, -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [PATCH] gnulib: Define argv[0] as program_name for error.c on Darwin

2015-02-12 Thread Pino Toscano
(Personally, I'm not sure that the above patch would help, but I'll leave the review to gnulib people on the right ml.) Thanks, -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [PATCH 1/3] macosx: Includes/defines for byteswap operations

2015-02-12 Thread Pino Toscano
e it's about a series of 1-2 patches. -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [PATCH] gnulib: Define argv[0] as program_name for error.c on Darwin

2015-02-12 Thread Pino Toscano
On Thursday 12 February 2015 18:58:17 Margaret Lewicka wrote: > On 12 February 2015 at 18:50, Pino Toscano wrote: > [...] > > We import gnulib as git submodule from the upstream gnulib.git, so > > this should be sent to its mailing list; see also > > https://www

Re: [Libguestfs] [PATCH] macosx: Darwin-specific autoconf macros

2015-02-12 Thread Pino Toscano
On Thursday 12 February 2015 18:54:48 Margaret Lewicka wrote: > On 12 February 2015 at 18:42, Pino Toscano wrote: > [...] > > We link to libcrypt because it provides crypt(), at least on GNU libc > > and on the FreeBSD libc; it seems not the case on Mac OS X, looking > >

Re: [Libguestfs] [PATCH 2/2] lib: Check if crypt() comes from a separate library

2015-02-13 Thread Pino Toscano
v/link.sh.in b/v2v/link.sh.in > index 79dc847..15b6e66 100644 > --- a/v2v/link.sh.in > +++ b/v2v/link.sh.in > @@ -19,4 +19,4 @@ > # Hack automake to link binary properly. There is no other way to add > # the -cclib parameter to the end of the command line. > > -exec "$@" -linkpkg -cclib '-lutils @LIBTINFO_LIBS@ -lcrypt @LIBVIRT_LIBS@ > @LIBXML2_LIBS@ @LIBINTL@ -lgnu' > +exec "$@" -linkpkg -cclib '-lutils @LIBTINFO_LIBS@ @LIBCRYPT_LIBS@ > @LIBVIRT_LIBS@ @LIBXML2_LIBS@ @LIBINTL@ -lgnu' > Thanks, -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [PATCH] ./run: Use 'prepend' function to build paths.

2015-02-13 Thread Pino Toscano
tory. > # For Lua. > export LUA=@LUA@ > +# Can't use 'prepend' here because Lua paths use semicolons. > if [ -z "$LUA_CPATH" ]; then > LUA_CPATH="$b/lua/?.so" > else I guess using a second helper like: prepend_semicolon() { eval $1="$2\${$1:+;\$$1}" } could help? -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

[Libguestfs] [PATCH] builder: process --source sources before

2015-02-17 Thread Pino Toscano
Process the sources specified via the --source command line arguments before sources read from repositories, so the former have a chance to "override" the latter. Related to RHBZ#1193238. --- builder/builder.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/builder.ml

[Libguestfs] [PATCH] builder: when not checking sigs, ignore --fingerprint args (RHBZ#1193237)

2015-02-17 Thread Pino Toscano
When the user chooses to not verify the signatures on the indexes (using --no-check-signature), there is no point in requiring as many --fingerprint as --source (or even just one), as they will not be used anyway. In this case just ignore all the values of the specified --fingerprint arguments. --

Re: [Libguestfs] Mounting disk images with ext2 filesystems on RHEL7

2015-02-18 Thread Pino Toscano
#x27;t find ext4 filesystem > > This has me wondering because the debug messages from guestfish -v -x > indicate it is mouting ext2 with ext4. > EXT4-fs (sdb): mounting ext2 filesystem using the ext4 subsystem In recent (well, few years...) Linux versions the ext4 filesystems take

[Libguestfs] [PATCH 1/2] mllib: add helper mkdir_p

2015-02-23 Thread Pino Toscano
Small function to create in OCaml-based code a directory and its parents, much like `mkdir -p`. --- mllib/common_utils.ml | 11 +++ mllib/common_utils.mli | 3 +++ 2 files changed, 14 insertions(+) diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index 898be17..76d8b79 100644

[Libguestfs] [PATCH 2/2] builder: use mkdir_p to create the cachedir (RHBZ#1195204)

2015-02-23 Thread Pino Toscano
--- builder/cache.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/cache.ml b/builder/cache.ml index 9e69bc1..86ac41b 100644 --- a/builder/cache.ml +++ b/builder/cache.ml @@ -35,7 +35,7 @@ type t = { let create ~verbose ~directory = if not (is_directory director

[Libguestfs] [PATCH] builder: handle -v and -x flags like in other tools (RHBZ#1196100)

2015-02-26 Thread Pino Toscano
Make sure that -x enables tracing and -v enables verbose mode, just like other tools do. Kind of followup of commit b6b9b90dd74c7b9204bdf218aa9360e117308e78. --- builder/builder.ml | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/builder/builder.ml b/builder/builder.ml in

[Libguestfs] [PATCH] actions: improve man page links

2015-03-03 Thread Pino Toscano
Switch from C<> to L<> for links to man pages, where wasn't done before. --- generator/actions.ml | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/generator/actions.ml b/generator/actions.ml index 9f32cb5..fb971d3 100644 --- a/generator/actions.ml +++ b/ge

Re: [Libguestfs] [PATCH] v2v: Add the test-harness used by external tests.

2015-03-11 Thread Pino Toscano
est_harness.ml", line 174, characters 14-26: Error: Unbound value D.create_xml Indeed, the ocaml-libvirt in that version has no Domain.create_xml, nor Domain flags like START_AUTODESTROY. -- Pino Toscano ___ Libguestfs mailing list Libguest

[Libguestfs] [PATCH] generator: small optimization of pod2text cache memoization

2015-03-12 Thread Pino Toscano
Instead of save every time there's a new element in the cache, batch the saving to disk every 100 changes, saving the unsaved remainder at the exit. While not a big optimization, this reduces a bit the disk usage during generator run. --- generator/utils.ml | 14 +- 1 file changed, 13

Re: [Libguestfs] [PATCH] part-list: add support for show partition type

2015-03-13 Thread Pino Toscano
ee (r->guestfs_int_partition_list_val[k].part_type); > error3: >free (r->guestfs_int_partition_list_val); > error2: > diff --git a/generator/structs.ml b/generator/structs.ml > index ea110a1..e7a9fa6 100644 > --- a/generator/structs.ml > +++ b/generator/structs.m

[Libguestfs] [PATCH] builder: handle empty lines in indexes before first section (RHBZ#1201526)

2015-03-13 Thread Pino Toscano
Properly skip empty lines before the first section, otherwise they will trigger a syntax error in parsing. Add a simple test for it, so it doesn't regress. --- builder/index-parse.y | 8 builder/test-virt-index-validate-good-3 | 4 builder/test-virt-index-validate.

Re: [Libguestfs] [PATCH] btrfs-qgroup-show: add check for "--raw"

2015-03-16 Thread Pino Toscano
EANUP_FREE char *out = NULL; > @@ -1231,6 +1262,8 @@ do_btrfs_qgroup_show (const char *path) >ADD_ARG (argv, i, str_btrfs); >ADD_ARG (argv, i, "qgroup"); >ADD_ARG (argv, i, "show"); > + if (btrfs_qgroup_show_raw_opt) > +ADD_ARG (argv, i, "--raw"); This should check for > 0, otherwise it will add --raw also when it was not possible to determine whether --raw is supported (i.e. when the value is -1). Thanks, -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [PATCH 2/2] builder: support for download resume

2015-03-19 Thread Pino Toscano
> (* Now download the file. *) > -let cmd = sprintf "%s%s%s -g -o %s %s" > +let cmd = sprintf "%s%s%s%s -g -o %s %s" > outenv >t.curl >(if t.verbose then "" else if progress_bar then " -#" else " -s -S

Re: [Libguestfs] [PATCH] New API: part_get_part_type for showing partition type

2015-03-24 Thread Pino Toscano
to use print_partition_table(xxx, 0) > but do not want to pass a raw '0'. > Maybe the name is not so clear. > I'll rename it to PARTED_NOT_USE_M in the next version. Improving the readability of a raw integer is a good thing; however, I'd suggest switching to an enum instead. -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [PATCH 1/2] parted: introduce enum for whether parted has option -m

2015-03-24 Thread Pino Toscano
as you will not catch non-enum values or not check to be handling all values where needed. -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [PATCH] customize: fix --upload to FAT partition (RHBZ#1196101)

2015-03-25 Thread Pino Toscano
warning, which is not a great idea when ownership handling is supported. You should detect ENOTSUP, and only in that case demote the error into a warning (or even an information message, since this happens while uploading a file). -- Pino Toscano _

[Libguestfs] [PATCH] WIP: New virt-dib tool

2015-03-31 Thread Pino Toscano
virt-dib is a new tool to run the elements of diskimage-builder using libguestfs. --- Work in progress (debug stuff here and there), although I've submitting it for initial review, for being included later when polished for good. TODO items open: - move Uname from builder to mllib - improve the

Re: [Libguestfs] [PATCH] Adding ibm-powerkvm distro detection (the right one)

2015-04-02 Thread Pino Toscano
ehow confusing. supermin >= 5.1.12 uses librpm to query for rpm dependencies, file listing, provides, etc. If rpm_is_available returns false, that means you built without librpm, and that supermin will not really work. Did you tried running the test suite (`make check`)?

Re: [Libguestfs] [PATCH] Adding ibm-powerkvm distro detection (the right one)

2015-04-02 Thread Pino Toscano
Hi Daniel, On Thursday 02 April 2015 09:34:17 Daniel Henrique Barboza wrote: > On 04/02/2015 05:23 AM, Pino Toscano wrote: > > Hi Daniel, > > > > On Wednesday 01 April 2015 16:37:26 Daniel Henrique Barboza wrote: > >> The one that got upstream does not w

Re: [Libguestfs] [PATCH] Adding ibm-powerkvm distro detection (the right one)

2015-04-02 Thread Pino Toscano
On Thursday 02 April 2015 11:15:07 Daniel Henrique Barboza wrote: > Hi Pino, > > On 04/02/2015 09:51 AM, Pino Toscano wrote: > > Hi Daniel, > > > > On Thursday 02 April 2015 09:34:17 Daniel Henrique Barboza wrote: > >> On 04/02/2015 05:23 AM, Pino Toscano wr

Re: [Libguestfs] [PATCH] Adding ibm-powerkvm distro detection (the right one)

2015-04-03 Thread Pino Toscano
On Thursday 02 April 2015 19:10:39 Daniel Henrique Barboza wrote: > > On 04/02/2015 01:20 PM, Daniel Henrique Barboza wrote: > > > > > > On 04/02/2015 11:47 AM, Pino Toscano wrote: > >> On Thursday 02 April 2015 11:15:07 Daniel Henrique Barboza wrote: > >&

Re: [Libguestfs] [PATCH] api: add_drive - add QEMU detect-zeroes support

2015-04-09 Thread Pino Toscano
; : "", > drv->disk_label ? drv->disk_label : "", > + drv->detectzeros ? ",detect-zeroes=on" : "", > drv->copyonread ? ",copy-on-read=on" : "", > i); > } > @@ -528,11 +529,12 @@ launch_direct (guestfs_h *g, void *datav, const char > *arg) >/* Writable qcow2 overlay on top of read-only drive. */ >escaped_file = qemu_escape_param (g, drv->overlay); >param = safe_asprintf > -(g, "file=%s,cache=unsafe,format=qcow2%s%s,id=hd%zu", > +(g, > "file=%s,cache=unsafe,format=qcow2%s%s,id=hd%zu,detect-zeroes=%s", > escaped_file, > drv->disk_label ? ",serial=" : "", > drv->disk_label ? drv->disk_label : "", > - i); > + i, > + drv->detectzeros ? "on" : "off"); > } Hmm for the overlay too? > > /* If there's an explicit 'iface', use it. Otherwise default to When the detect-zeros parameter has been added to qemu? When requesting to enable it, there should be a qemu version check like it has been done for the discard mode. Also, this should be added in the libvirt backend too. -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

[Libguestfs] [PATCH 2/2] filearch: support gzip/xz-compressed files

2015-04-13 Thread Pino Toscano
Extract them to find out the architecture of the data they hold. Useful to detect the architecture of e.g. compressed Linux modules. --- src/filearch.c | 64 ++ 1 file changed, 64 insertions(+) diff --git a/src/filearch.c b/src/filearch.c in

[Libguestfs] [PATCH 1/2] filearch: move libmagic code in an own function

2015-04-13 Thread Pino Toscano
Also use a cleanup attribue to ease the close of the magic_t handle. This is mostly code motion, hopefully with no actual behaviour changes. --- src/filearch.c | 100 +++-- 1 file changed, 68 insertions(+), 32 deletions(-) diff --git a/src/file

[Libguestfs] [PATCH] v2v: convert libvirt display listen configuration (RHBZ#1174073)

2015-04-14 Thread Pino Toscano
Read the listen configuration from the XML of libvirt domains, restoring it when writing new libvirt XMLs. --- v2v/input_disk.ml | 3 ++- v2v/input_libvirtxml.ml | 26 -- v2v/output_libvirt.ml | 11 +++ v2v/types.ml| 15 +-- v2v/type

[Libguestfs] [PATCH] filearch: support gzip/xz-compressed files

2015-04-14 Thread Pino Toscano
Extract them to find out the architecture of the data they hold. Useful to detect the architecture of e.g. compressed Linux modules. Provide in the test.iso two samples (compressing existing test data) of binaries compressed with gzip and xz. --- .gitignore | 2 ++ generator/actions.

Re: [Libguestfs] [PATCH] v2v: convert libvirt display listen configuration (RHBZ#1174073)

2015-04-14 Thread Pino Toscano
On Tuesday 14 April 2015 10:05:46 Richard W.M. Jones wrote: > On Tue, Apr 14, 2015 at 10:40:57AM +0200, Pino Toscano wrote: > > and s_display_type = Window | VNC | Spice > > +and display_listen = > > + | LNone > > + | LAddress of string > > + | LNetwork of

[Libguestfs] [PATCH] v2v: convert libvirt display port configuration

2015-04-14 Thread Pino Toscano
Read the port configuration from the XML of libvirt domains, restoring it when writing new libvirt XMLs instead of always setting the "autoport" option. --- v2v/input_disk.ml | 2 +- v2v/input_libvirtxml.ml | 13 +++-- v2v/output_libvirt.ml | 8 +++- v2v/output_qemu.ml |

[Libguestfs] [PATCH 4/4] v2v: start importing "volume" disk types (RHBZ#1146832)

2015-04-14 Thread Pino Toscano
Import disks stored as "file"-type volumes. Side effect: a guest converted to libvirt using virt-v2v can be converted again using virt-v2v. --- v2v/input_libvirtxml.ml | 34 -- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/v2v/input_libvirtxml.ml b

[Libguestfs] [PATCH 1/4] v2v: domainxml: factor out connect and pool loading

2015-04-14 Thread Pino Toscano
Factor out the connection and pool loading out of v2v_pool_dumpxml, so it can be used in later implementations requiring a pool. Should be just code motion. --- v2v/domainxml-c.c | 84 +-- 1 file changed, 51 insertions(+), 33 deletions(-) diff

[Libguestfs] [PATCH 3/4] v2v: pass libvirt connection URI to parse_libvirt_xml

2015-04-14 Thread Pino Toscano
This makes it possible to connect to the right libvirt. --- v2v/input_libvirt_other.ml | 2 +- v2v/input_libvirt_vcenter_https.ml | 2 +- v2v/input_libvirt_xen_ssh.ml | 2 +- v2v/input_libvirtxml.ml| 2 +- v2v/input_libvirtxml.mli | 2 +- 5 files changed, 5 inse

[Libguestfs] [PATCH 2/4] v2v: domainxml: add vol_dumpxml

2015-04-14 Thread Pino Toscano
Add a new vol_dumpxml to get the XML dump of a pool's volume. --- v2v/domainxml-c.c | 68 +++ v2v/domainxml.ml | 1 + v2v/domainxml.mli | 6 + 3 files changed, 75 insertions(+) diff --git a/v2v/domainxml-c.c b/v2v/domainxml-c.c index 077c

Re: [Libguestfs] [PATCH 1/4] v2v: domainxml: factor out connect and pool loading

2015-04-14 Thread Pino Toscano
something useful to know, thanks for the pointers. I actually checked the basics of these OCaml C API, although not that in-depth. I changed patches 1 & 2 according to what you've pointed out, sending them soon for review. Thanks, -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

[Libguestfs] [PATCH 1/4] v2v: domainxml: factor out connect and pool loading

2015-04-14 Thread Pino Toscano
Factor out the connection and pool loading out of v2v_pool_dumpxml, so it can be used in later implementations requiring a pool. Should be just code motion. --- v2v/domainxml-c.c | 101 -- 1 file changed, 60 insertions(+), 41 deletions(-) diff

[Libguestfs] [PATCH 2/4] v2v: domainxml: add vol_dumpxml

2015-04-14 Thread Pino Toscano
Add a new vol_dumpxml to get the XML dump of a pool's volume. --- v2v/domainxml-c.c | 61 +++ v2v/domainxml.ml | 1 + v2v/domainxml.mli | 6 ++ 3 files changed, 68 insertions(+) diff --git a/v2v/domainxml-c.c b/v2v/domainxml-c.c index b5d

[Libguestfs] [PATCH 1/2] v2v: support tar.gz and tar.xz ova files

2015-04-15 Thread Pino Toscano
When dealing with a ova detected as gzip of xz, uncompress few bytes of it to check whether it is a compressed tarball, and if so untar it. Related to RHBZ#1186800. --- v2v/input_ova.ml | 48 ++-- 1 file changed, 42 insertions(+), 6 deletions(-) diff -

[Libguestfs] [PATCH 2/2] v2v: use .ovf and .mf files anywhere within ova files

2015-04-15 Thread Pino Toscano
Do not rely on .ovf and .mf files being in the top-level of the ova archive, but search them anywhere within the content of the ova. This also changes the result of the search of the .ovf file: previously, one (random) file was picked in case there were more than one, while now this situation trig

[Libguestfs] [PATCH 2/2] v2v: test-v2v-i-ova-formats.sh: test ova as tar.gz and tar.xz

2015-04-15 Thread Pino Toscano
Extend test-v2v-i-ova-formats.sh to test for tarballs compressed as gzip or xz; followup of commit 3c582cfb8d62013a935953e919c79009452254f9. --- v2v/test-v2v-i-ova-formats.sh | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/v2v/test-v2v-i-ova-formats.sh b/v2v/test-v2v-i-o

[Libguestfs] [PATCH 1/2] v2v: generalize test-v2v-i-ova-zip.sh

2015-04-15 Thread Pino Toscano
Rename test-v2v-i-ova-zip.sh (and associated data) to test-v2v-i-ova-formats, and generalize it a bit so it can test different compression types for the ova "envelope". --- v2v/Makefile.am | 8 +-- v2v/test-v2v-i-ova-formats.expected | 15 v2v/test-v2v-i-ova-formats.ovf

Re: [Libguestfs] [PATCH] inspector: recognize ppc64 and ppc64le archs (RHBZ#1211996)

2015-04-15 Thread Pino Toscano
ness) + 2; > +CLEANUP_FREE char *end_elf_arch = safe_malloc(g, sz); > +snprintf(end_elf_arch, sz, "%s %s", endianness, elf_arch); > +ret = canonical_elf_arch (g, end_elf_arch); Please use guestfs_int_safe_asprintf instead of

Re: [Libguestfs] [PATCH v2] inspector: recognize ppc64 and ppc64le archs (RHBZ#1211996)

2015-04-17 Thread Pino Toscano
e for no reason. As I suggested in the v1 review, please do pass the result of the MSB|LSB match as new parameter for canonical_elf_arch, checking it when the architecture is ppc64. This will also avoid having a new regex, re_elf_ppc64le, and leave re_elf_ppc64 as it is currently: char * canonical_elf_

Re: [Libguestfs] [PATCH v2] inspector: recognize ppc64 and ppc64le archs (RHBZ#1211996)

2015-04-17 Thread Pino Toscano
On Friday 17 April 2015 15:15:26 Maros Zatko wrote: > On 04/17/2015 10:56 AM, Pino Toscano wrote: > > On Thursday 16 April 2015 16:51:48 Maros Zatko wrote: > >> --- > >> src/filearch.c | 18 +- > >> 1 file changed, 13 insertions(+), 5 del

[Libguestfs] [PATCH 2/2] build: create and use a full version string

2015-04-20 Thread Pino Toscano
Create a version string that includes the "extra" string as well, and make use of it in print_version_and_exit (which can avoid creating a new Guestfs handle). Folloup of commit 478a552ab431762dd2a724ade0c3fd84a21b7cab. --- configure.ac | 2 ++ mllib/common_utils.ml | 6 +- mllib/con

[Libguestfs] [PATCH 1/2] build: require Config before Common_utils

2015-04-20 Thread Pino Toscano
Build the Config mllib module before Common_utils, as the latter will soon make use of the former. --- customize/Makefile.am | 2 +- resize/Makefile.am| 2 +- sparsify/Makefile.am | 2 +- sysprep/Makefile.am | 2 +- v2v/Makefile.am | 2 +- 5 files changed, 5 insertions(+), 5 deletions

[Libguestfs] [PATCH v2] WIP: New virt-dib tool

2015-04-22 Thread Pino Toscano
virt-dib is a new tool to run the elements of diskimage-builder using libguestfs. --- More stable now, although with debug stuff here and there; needs initial review, for being included later when polished for good. TODO items open: - move Uname from builder to mllib - improve the documentation

[Libguestfs] [PATCH] v2v: convert old-style libvirt listen configuration (RHBZ#1174073)

2015-04-27 Thread Pino Toscano
Use the listen configuration from the "listen" attribute of , in case is missing. Followup of commit 9360675dc244a8762e07a8a4289e7a30ca3e1eef. --- v2v/input_libvirtxml.ml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/v2v/input_libvirtxml.ml b/v2v/input_libvirtxml.ml in

Re: [Libguestfs] [PATCH 1/2] firstboot: Factor out regular expression constant.

2015-04-27 Thread Pino Toscano
= > - Str.global_replace (Str.regexp "[^A-Za-z0-9_]") "-" n > +let sanitize_name = > + let rex = Str.regexp "[^A-Za-z0-9_]" in > + fun n -> > +Str.global_replace rex "-" n > > (* For Linux guests. *) > module Linux

[Libguestfs] [PATCH] customize: add a "touch" operation (RHBZ#1212808)

2015-04-28 Thread Pino Toscano
--- builder/cmdline.ml | 3 ++- customize/customize_run.ml | 4 generator/customize.ml | 8 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/builder/cmdline.ml b/builder/cmdline.ml index 7b119d5..ec189ad 100644 --- a/builder/cmdline.ml +++ b/builder/cmdline.

[Libguestfs] [PATCH] inspector: fix formatting of xpath result (RHBZ#1212680)

2015-04-29 Thread Pino Toscano
Discard blank nodes when reading the XML from stdin, while enabling formatting in output nodes. --- inspector/inspector.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inspector/inspector.c b/inspector/inspector.c index 1863de0..412384a 100644 --- a/inspector/inspector.c

[Libguestfs] [PATCH] build: remove unreadable files after filtering

2015-05-04 Thread Pino Toscano
Move the removal of the files which don't exist or cannot be read, doing it after the filtering with excludefiles and hostfiles files. This avoid stat'ing files which will be excluded later anyway, hence reducing the I/O during a supermin build phase. --- src/build.ml | 32

Re: [Libguestfs] libguestfs install error

2015-05-04 Thread Pino Toscano
guestfs 1.28.5 (which includes the above patch) or greater b) apply yourself the patch to your 1.28.1 sources Unless you really need libguestfs 1.28.1 and not any later version, I recommend the solution (a); currently libguestfs 1.28.9 is the latest stable version. Thanks, -- Pino Toscano __

Re: [Libguestfs] [PATCH 1/2] p2v: Factor out code for parsing vcpus & memory from conversion dialog.

2015-05-05 Thread Pino Toscano
y_entry)); > - if (sscanf (str, "%d", &i) == 1 && i >= 256) > -config->memory = (uint64_t) i * 1024 * 1024; > - else > -config->memory = 1024 * 1024 * 1024; > + config->vcpus = get_vcpus_from_conv_dlg (); > + config->memory = get_memory_from_co

Re: [Libguestfs] [PATCH 1/2] mllib: Require OUnit2 for tests.

2015-05-11 Thread Pino Toscano
| 2 +- > mllib/JSON_tests.ml | 56 > - > mllib/Makefile.am | 2 ++ > mllib/common_utils_tests.ml | 50 +--- > 5 files changed, 50 insertions(+), 62 deletions(-) ... please adjust con

[Libguestfs] [PATCH 3/3] builder: enable batch mode when validating non-verbose (RHBZ#1180170)

2015-05-11 Thread Pino Toscano
When running gpg to validate a signature, use also --batch in non-verbose mode to avoid the extra "Good signature" messages that are printed by gpg2 even in quiet mode. We are parsing the status output anyway to check the validation result, so this should be harmless (and the full gpg output is pri

[Libguestfs] [PATCH 1/3] builder: move gpg status parsing within import_keyfile

2015-05-11 Thread Pino Toscano
Parse the gpg status output directly within import_keyfile, returning just the key fingerprint. Just code motion, no actual behaviour changes. --- builder/sigchecker.ml | 25 - 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/builder/sigchecker.ml b/builder/

[Libguestfs] [PATCH 2/3] builder: trust the imported keys

2015-05-11 Thread Pino Toscano
In every SigChecker, trust by default the keys imported. This should make gpg happier when using the keys later, used only when validating the signatures of index files. --- builder/sigchecker.ml | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/builder/sigchecker.m

[Libguestfs] [PATCH 1/2] mllib: remove spurious check_SCRIPTS from Makefile.am

2015-05-12 Thread Pino Toscano
Not actually useful, as TESTS defines the tests, and it breaks when oUnit is not available (as it tries to build an oUnit-based unit test). --- mllib/Makefile.am | 3 --- 1 file changed, 3 deletions(-) diff --git a/mllib/Makefile.am b/mllib/Makefile.am index 0b43684..e363f27 100644 --- a/mllib/Ma

[Libguestfs] [PATCH 2/2] configure: simplify check for oUnit v2

2015-05-12 Thread Pino Toscano
Instead of parsing the version, try to look for the OUnit2 module within the oUnit package. Followup of commit 46bc79109bb51cfb656863da3635f1c8da5f6412. --- configure.ac | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/configure.ac b/configure.ac index 5ff151b.

Re: [Libguestfs] [PATCH 1/2] mllib: Require OUnit2 for tests.

2015-05-12 Thread Pino Toscano
On Monday 11 May 2015 20:45:28 Richard W.M. Jones wrote: > On Mon, May 11, 2015 at 07:22:58PM +0200, Pino Toscano wrote: > > On Monday 11 May 2015 11:11:50 Richard W.M. Jones wrote: > > > OUnit2 has an OUnit (v1) compatibility module. Unfortunately it > > > is rather

Re: [Libguestfs] [PATCH 1/2] mllib: remove spurious check_SCRIPTS from Makefile.am

2015-05-13 Thread Pino Toscano
On Tuesday 12 May 2015 19:54:32 Richard W.M. Jones wrote: > On Tue, May 12, 2015 at 03:20:56PM +0200, Pino Toscano wrote: > > Not actually useful, as TESTS defines the tests, and it breaks when > > oUnit is not available (as it tries to build an oUnit-based unit test). >

[Libguestfs] [PATCH 2/2] mllib: link tests with automake

2015-05-13 Thread Pino Toscano
Add a dummy C source, otherwise automake tries to look for e.g. common_utils_tests.c. Also, set check_PROGRAMS properly with them. --- mllib/Makefile.am | 48 +--- mllib/dummy.c | 2 ++ po/POTFILES | 1 + 3 files changed, 36 insertions(+), 1

[Libguestfs] [PATCH 1/2] build: factor out the OCaml link.sh scripts

2015-05-13 Thread Pino Toscano
Create a single ocaml-link.sh script, which supports a -cclib parameter so it can be used instead of the per-project link.sh scripts. As result, the libraries for each OCaml application can be moved back to each Makefile.am. --- .gitignore| 7 --- builder/Makefile.am | 14 ++

Re: [Libguestfs] [PATCH] When calling getline first time, initialize length to zero.

2015-05-14 Thread Pino Toscano
am still > worked fine, but it seems better to initialize the length anyway. > --- LGTM. -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [PATCH 1/2] customize: Give a clear error message if host_cpu not compatible with guest arch.

2015-05-15 Thread Pino Toscano
it would just require filter_arch to map ("i386"|"i486"|"i586"|"i686") as "i386". If so, I guess it might be better to adapt that and move Architecture (with or without Uname) to mllib. -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

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