Re: [Libguestfs] [PATCH 1/3] fish: rl.{c, h} - escaping functions for readline

2014-11-05 Thread Pino Toscano
// after composition of bsquote_filename after debsquote_filename > +// (i.e. can escape some characters differently). Ditto (for comment style). Also, the names mentioned here don't seem the one used for the functions. > + if (!c_ispr

Re: [Libguestfs] [PATCH 0/3] WIP readline escaping functions

2014-11-05 Thread Pino Toscano
r tests - take care of the indentation, like the space before a parenthesis I'm adding few more specific notes/questions in patches. -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [PATCH 2/3] fish: basic tests for readline escaping

2014-11-05 Thread Pino Toscano
[] = { { "", "", 1 }, { " ", "\\ ", 1 }, ... } size_t nr_escape_tests = sizeof(escape_tests) / sizeof(*escape_tests); (ditto for unescape tests) then do two iterations, for escape_tests and unescape_tests. > +int > +main (int argc, char *argv[]

Re: [Libguestfs] [PATCH] Use -ltinfo instead of -lncurses.

2014-11-06 Thread Pino Toscano
dline which needs ncurses. Leave that alone. Given that three AC_CHECK_LIB checking for ncurses are now gone, wouldn't it better to explicitly search for it prior to searching for readline? -- Pino Toscano ___ Libguestfs mailing list Libgu

[Libguestfs] [PATCH 1/2] normalize iconv handling

2014-11-06 Thread Pino Toscano
Since the signature of iconv() changes between implementations (the constness of the second parameter, in particular), make use of the iconv module of gnulib to handle these potential differences. (This is a reduced version of 57512e778558c5b93cfa360c83836c2cf8fc5908 in libguestfs.) --- bootstrap

[Libguestfs] [PATCH 2/2] ruby: fix detection of ruby library

2014-11-06 Thread Pino Toscano
Query RbConfig::CONFIG for "libdir", and use that when trying to link to the ruby library. This fixes the libruby detection when it is installed in a non-standard library directory. (This is the same change as 3d02e53c4829675cc237f61ae2c4e1816e66 in libguestfs.) --- configure.ac | 8 +++-

[Libguestfs] [PATCH 0/2] hivex: small portability fixes

2014-11-06 Thread Pino Toscano
Hi, this small series cherry-picks a couple of the portability fixes recently done in libguestfs to hivex. There should be no actual change on Linux. Thanks, -- Pino Pino Toscano (2): normalize iconv handling ruby: fix detection of ruby library bootstrap| 1 + configure.ac | 8

Re: [Libguestfs] [PATCH] Use -ltinfo instead of -lncurses.

2014-11-06 Thread Pino Toscano
On Thursday 06 November 2014 14:10:50 Richard W.M. Jones wrote: > On Thu, Nov 06, 2014 at 01:34:24PM +0100, Pino Toscano wrote: > > Given that three AC_CHECK_LIB checking for ncurses are now gone, > > wouldn't it better to explicitly search for it prior to searching

Re: [Libguestfs] Add support for slackware in supermin

2014-11-10 Thread Pino Toscano
manager; this is needed so supermin can pick pristine copies of the files of an installed package, usually to have unedited configuration files supermin supports already few package manager, and you can find in the src/ subdirectory their implementations: dpkg.ml, pacman.ml, rpm.ml. -- Pin

Re: [Libguestfs] [libhivex] Memory leak in hivex_node_delete_child?

2014-11-11 Thread Pino Toscano
ything else I can > provide to make this easier. It seems like rather hivex_node_delete_child leaks the "blocks" array returned by _hivex_get_children every time. The patch should be easy, would you be able to give it a try to check whether it fixes the leak in your

Re: [Libguestfs] Add support for slackware in supermin

2014-11-11 Thread Pino Toscano
does not provide basic package management like that, I'm not sure how supermin is supposed to work. -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] Add support for slackware in supermin

2014-11-11 Thread Pino Toscano
tfs.org/guestfs.3.html#environment-variables and you can find our Fedora-based appliances here: http://libguestfs.org/download/binaries/appliance/ -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] Add support for slackware in supermin

2014-11-11 Thread Pino Toscano
On Tuesday 11 November 2014 19:08:58 Mathieu Bouillaguet wrote: > Le 11 nov. 2014 19:03, "Pino Toscano" a écrit : > > Hi, > > > > (please do not top-reply...) > > > > On Tuesday 11 November 2014 18:32:10 Mathieu Bouillaguet wrote: > > > What I

[Libguestfs] [PATCH] daemon: check xfs label lengths (RHBZ#1162966).

2014-11-12 Thread Pino Toscano
Similar to commit 52f9cd4882135910ea06e1e50ac6441d455c9ab1, but for xfs filesystems. --- daemon/daemon.h | 4 daemon/labels.c | 6 ++ daemon/xfs.c| 6 ++ 3 files changed, 16 insertions(+) diff --git a/daemon/daemon.h b/daemon/daemon.h index 0ccbc9e..f442efd 100644 --- a/daemon/da

[Libguestfs] [PATCH] configure: simplify the qemu cpu mapping

2014-11-12 Thread Pino Toscano
Use AS_CASE to properly map from the host cpu to the qemu cpu suffix; this avoids doing multiple string replacements using sed, and it is possible to use case-like syntax. --- configure.ac | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure

Re: [Libguestfs] [PATCH 1/6] btrfs: correct words about subvolume and snapshot

2014-11-21 Thread Pino Toscano
= "BTRFSSubvolumeCreate"; > -shortdesc = "create a btrfs snapshot"; > +shortdesc = "create a btrfs subvolume"; > longdesc = "\ > Create a btrfs subvolume. The C argument is the destination > -directory and the name of the snapshot, in

Re: [Libguestfs] [PATCH 2/6] btrfs: add optional parameter `ro' to btrfs_subvolume_snapshot

2014-11-21 Thread Pino Toscano
quot;; > -style = RErr, [Pathname "source"; Pathname "dest"], []; > +style = RErr, [Pathname "source"; Pathname "dest"], [OBool "ro"]; > proc_nr = Some 322; > optional = Some "btrfs"; camel_name = "BTRFSSubvolumeSnapshot&qu

Re: [Libguestfs] [PATCH 4/6] btrfs: add optional parameter `qgroupid' to btrfs_subvolume_create

2014-11-21 Thread Pino Toscano
c = "delete a btrfs subvolume or snapshot"; > @@ -10255,13 +10255,14 @@ Delete the named btrfs subvolume or snapshot." }; > >{ defaults with > name = "btrfs_subvolume_create"; > -style = RErr, [Pathname "dest"], []; > +style = RErr, [Pathname "dest"], [OString "qgroupid"]; > proc_nr = Some 324; > optional = Some "btrfs"; camel_name = "BTRFSSubvolumeCreate"; > shortdesc = "create a btrfs subvolume"; Like in patch 2, you need once_had_no_optargs = true for this as well. > longdesc = "\ > Create a btrfs subvolume. The C argument is the destination > -directory and the name of the subvolume, in the form C." > }; > +directory and the name of the subvolume, in the form C. > +The C adds the newly created subvolume to a qgroup." }; "The optional C parameter represents the qgroup which the newly created subvolume should be added to." or something like that, I'm not an English native speaker either... -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [PATCH 3/6] btrfs: add optional parameter `qgroupid' to btrfs_subvolume_snapshot

2014-11-21 Thread Pino Toscano
_create"; "/test1"]; > ["btrfs_subvolume_create"; "/test2"]; > ["btrfs_subvolume_create"; "/dir/test3"]; > - ["btrfs_subvolume_snapshot"; "/dir/test3"; "/dir/test5";

Re: [Libguestfs] [PATCH 2/6] btrfs: add optional parameter `ro' to btrfs_subvolume_snapshot

2014-11-21 Thread Pino Toscano
fs_subvolume_create"; "/dir/test3"]; > - ["btrfs_subvolume_snapshot"; "/dir/test3"; "/dir/test4"]]), [] > + ["btrfs_subvolume_snapshot"; "/dir/test3"; "/dir/test5"; "true"]]), > [

Re: [Libguestfs] [PATCH 5/6] New API: btrfs_subvolume_get_default

2014-11-21 Thread Pino Toscano
bvolume or snapshot of a filesystem"; > +longdesc = "\ > +Get the default subvolume or snapshot of a filesystem mounted at C." }; > + > ] > > (* Non-API meta-commands available only in guestfish. > diff --git a/src/MAX_PROC_NR b/src/MAX_PROC_NR > index 5721413..9524ef4 100644 > --- a/src/MAX_PROC_NR > +++ b/src/MAX_PROC_NR > @@ -1 +1 @@ > -423 > +424 > -- > 1.9.3 > -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [PATCH 6/6] New API: btrfs_subvolume_show

2014-11-21 Thread Pino Toscano
+ } As above, I would not add elements with empty values in the hash. > +} > + > +p = pend; > + } > + > + if (end_stringsbuf (&ret) == -1) > +return NULL; > + > + return ret.argv; > + > +} > diff --git a/generator/actions.ml b/generator/actions.ml > index cf96039..24d3ecc 100644 > --- a/generator/actions.ml > +++ b/generator/actions.ml > @@ -12014,6 +12014,15 @@ This is the internal call which implements > C." }; > longdesc = "\ > Get the default subvolume or snapshot of a filesystem mounted at > C." }; > > + { defaults with > +name = "btrfs_subvolume_show"; > +style = RHashtable "btrfssubvolumeinfo", [Pathname "subvolume"], []; > +proc_nr = Some 425; > +optional = Some "btrfs"; camel_name = "BTRFSSubvolumeShow"; > +shortdesc = "show detailed information of the subvolume"; "returns detailed information about the subvolume" > +longdesc = "\ > +show detailed information of the subvolume." }; Like above, making sure it is properly capitalized at the beginning. -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

[Libguestfs] [PATCH] rpm: isolate the "packages as NA RPM list" code

2014-11-24 Thread Pino Toscano
Just code motion, no functional change. --- src/rpm.ml | 25 ++--- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/src/rpm.ml b/src/rpm.ml index ce803e1..771022e 100644 --- a/src/rpm.ml +++ b/src/rpm.ml @@ -288,11 +288,7 @@ let rec fedora_download_all_packages p

[Libguestfs] [PATCH] rpm: use librpm's rpmvercmp

2014-11-24 Thread Pino Toscano
Bind and use rpmvercmp to compare versions of packages when sorting them, instead of an own string-based comparison function. --- src/librpm-c.c | 12 src/librpm.ml | 1 + src/librpm.mli | 1 + src/rpm.ml | 2 +- 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/s

[Libguestfs] [PATCH] rpm: improve dnf invocation

2014-11-24 Thread Pino Toscano
Handle debug level and packager config. --- src/rpm.ml | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/rpm.ml b/src/rpm.ml index 771022e..46954c8 100644 --- a/src/rpm.ml +++ b/src/rpm.ml @@ -308,8 +308,14 @@ let rec fedora_download_all_packages pkgs dir = le

Re: [Libguestfs] [PATCH 1/6] btrfs: correct words about subvolume and snapshot

2014-11-24 Thread Pino Toscano
On Monday 24 November 2014 10:27:49 Hu Tao wrote: > On Fri, Nov 21, 2014 at 11:35:11AM +0100, Pino Toscano wrote: > > On Friday 21 November 2014 13:17:55 Hu Tao wrote: > > > btrfs_subvolume_create creates only subvolumes. > > > btrfs_subvolume_delete dele

Re: [Libguestfs] [PATCH 5/6] New API: btrfs_subvolume_get_default

2014-11-24 Thread Pino Toscano
nteger parsing, and lost track of the "ID " prefix). Then I guess sscanf could stay as you wrote it. -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [PATCH 4/6] btrfs: add optional parameter `qgroupid' to btrfs_subvolume_create

2014-11-24 Thread Pino Toscano
On Monday 24 November 2014 10:39:36 Hu Tao wrote: > On Mon, Nov 24, 2014 at 10:26:50AM +0800, Hu Tao wrote: > > On Fri, Nov 21, 2014 at 11:46:37AM +0100, Pino Toscano wrote: > > > On Friday 21 November 2014 13:17:58 Hu Tao wrote: > > > > Parameter `qgroupid' is

Re: [Libguestfs] [PATCH 6/6] New API: btrfs_subvolume_show

2014-11-24 Thread Pino Toscano
On Monday 24 November 2014 16:22:53 Hu Tao wrote: > On Fri, Nov 21, 2014 at 05:17:13PM +0100, Pino Toscano wrote: > > On Friday 21 November 2014 13:18:00 Hu Tao wrote: > > > btrfs_subvolume_show shows the detailed information of a subvolume > > > or > > > snap

Re: [Libguestfs] [PATCH] ntfsresize: Capture errors sent to stdout (RHBZ#1166618).

2014-11-24 Thread Pino Toscano
NULL, &err, COMMAND_FLAG_FOLD_STDOUT_ON_STDERR, argv); >if (r == -1) { > reply_with_error ("%s: %s", device, err); > return -1; LGTM. -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [PATCH] v2v: -i ova: Remove incorrect warning for disks that have no parent controller (RHBZ#1167302).

2014-11-24 Thread Pino Toscano
o_int "rasd:AddressOnParent/text()" 0 in > *) > > (* Find the parent controller. *) > -let controller = parent_controller parent_id in > +let parent_id = xpath_to_int "rasd:Parent/text()" 0 in > +let controller = > +

Re: [Libguestfs] [PATCH 1/3] lib: guestfs_disk_create: Allow vmdk as a valid backingformat.

2014-11-24 Thread Pino Toscano
gt; + STRNEQ (backingformat, "vmdk")) { >error (g, _("invalid value for backingformat parameter '%s'"), > backingformat); >return -1; LGTM. -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [PATCH 2/3] New API: guestfs_blockdev_setra: Adjust readahead for filesystems and devices.

2014-11-24 Thread Pino Toscano
[ > + InitEmpty, Always, TestRun ( > + [["blockdev_setra"; "/dev/sda"; "1024" ]]), [] > +]; > +shortdesc = "set readahead"; > +longdesc = "\ > +Set readahead (in 512-byte sectors) for the device. > + > +This uses the L command." }; > + > ] > > (* Non-API meta-commands available only in guestfish. Just a couple of notes: - I would have done the small internal behaviour change of the extraarg parameter of call_blockdev in an own commit, so it isn't tangled with the API addition - should there be some get counterpart, like blockdev_getra? - don't forget to commit MAX_PROC_NR together with this Otherwise, LGTM. -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [PATCH 3/3] New APIs: bmap-file, bmap-device, bmap.

2014-11-24 Thread Pino Toscano
e for block mapping"; > +longdesc = "\ > +This is a specialized function used by L to map which > +blocks are used by a device. It is unlikely to be useful outside > +virt-bmap. > + > +This call prepares C to be mapped. You have to call C &g

Re: [Libguestfs] [PATCH] v2v: -i ova: Remove incorrect warning for disks that have no parent controller (RHBZ#1167302).

2014-11-24 Thread Pino Toscano
+ match parent_id with > + | 0 -> None > + | id -> parent_controller id in > > let typ = >match id with > Slightly related note: parent_controller mentions "hard disk" in its error messages, while that

[Libguestfs] [PATCH] mllib: check the right out channel for tty

2014-11-25 Thread Pino Toscano
Make sure to check whether the given output channel is a tty before sending ANSI terminal codes to it, instead of always check what stdout is. --- mllib/common_utils.ml | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml i

[Libguestfs] [PATCH] mllib: use Unix.isatty

2014-11-25 Thread Pino Toscano
Make use of Unix.isatty instead of our TTY.isatty_stdout, as the supported OCaml provides the former already. --- mllib/common_utils.ml | 10 +- mllib/progress.ml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index

[Libguestfs] [PATCH] mllib: remove the TTY module

2014-11-25 Thread Pino Toscano
The only function provided is isatty_stdout, which is no more used now in favour of Unix.isatty. --- builder/Makefile.am | 2 -- customize/Makefile.am | 2 -- mllib/Makefile.am | 9 ++--- mllib/tTY.ml | 19 --- mllib/tTY.mli | 23 --

[Libguestfs] [PATCH] bash: complete some params for resize, sparsify, and builder

2014-11-26 Thread Pino Toscano
Hardcode the list of fixed arguments for some of the parameters of these tools. --- bash/virt-resize | 15 +++ 1 file changed, 15 insertions(+) diff --git a/bash/virt-resize b/bash/virt-resize index 447f0cf..7c879e1 100644 --- a/bash/virt-resize +++ b/bash/virt-resize @@ -23,6 +23,21

[Libguestfs] [PATCH] tools: implement --short-options

2014-11-26 Thread Pino Toscano
Just like --long-options, it makes it possible to know which short options are supported by each tool; this can help improving the bash completion, for example. --- align/scan.c| 3 +++ builder/cmdline.ml | 1 + cat/cat.c | 3 +++ cat/filesystems.c

[Libguestfs] [PATCH] bash: complete also short options

2014-11-26 Thread Pino Toscano
Propose both short and long options when trying to complete a single dash ("-"). --- bash/guestfish | 8 +++- bash/guestmount | 8 +++- bash/virt-alignment-scan | 8 +++- bash/virt-rescue | 8 +++- bash/virt-resize | 8 +++- 5 files changed, 3

[Libguestfs] [PATCH] bash: execute --long-options only when needed

2014-11-26 Thread Pino Toscano
Delay the execution of $tool --long-options only when really using its output. --- bash/guestfish | 3 +-- bash/guestmount | 3 +-- bash/virt-alignment-scan | 23 --- bash/virt-rescue | 3 +-- bash/virt-resize | 9 + 5 files change

[Libguestfs] [PATCH] bash: add a completion module for virt-v2v

2014-11-26 Thread Pino Toscano
--- bash/Makefile.am | 3 ++- bash/virt-v2v| 60 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 bash/virt-v2v diff --git a/bash/Makefile.am b/bash/Makefile.am index ee9c10c..2c8e722 100644 --- a/bash/Makefile.am +

Re: [Libguestfs] [PATCH 1/2] typo fix: preceeding -> preceding

2014-11-26 Thread Pino Toscano
"enable verbose mode and look at preceeding output"); > + "enable verbose mode and look at preceding output"); > return -1; >} Both of them LGTM, pushed. Thanks! -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [PATCH v2 0/5] btrfs support part1: subvolume commands

2014-11-26 Thread Pino Toscano
qgroupid' to btrfs_subvolume_create These three patches were fine, so I pushed them, thanks! Please make sure to also include changes to gobject/Makefile.inc and po/POTFILES together in the same commit that changes them. -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [PATCH] fish: show synopsis if command syntax is wrong

2014-11-28 Thread Pino Toscano
pr " fprintf (stderr, _(\"type 'help %%s' for more help on %%s\\n\"), > cmd, cmd);\n"; > + pr "}\n"; > + pr " }\n"; There is an issue here: in the true branch of "if (ct)", ther

Re: [Libguestfs] [PATCH 1/1] inspect: Fix a bug in the *BSD root detection

2014-11-28 Thread Pino Toscano
tition)) { bsd_primary = fs; continue; } This way it is done only for *BSD filesystems, and is_primary is used only in that if anyway. Also, is_bsd and fs could be declared just inside the for, as they are not needed outside of it. -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [PATCH] lib: Add COMPILE_REGEXP macro to hide regexp constructors/destructors.

2014-11-28 Thread Pino Toscano
\ { \ if (_internal_##name) \ pcre_free (_internal_##name); \ } using it e.g.: match (re_major_minor (), ...)

Re: [Libguestfs] [PATCH 0/4] fix bad commit ids referenced in commit messages

2014-12-04 Thread Pino Toscano
): > Revert "Update gobject/Makefile.inc and POTFILES" > Revert "Update gobject/Makefile.inc and POTFILES" > Update gobject/Makefile.inc and POTFILES > Update gobject/Makefile.inc and POTFILES Sorry, I apparently screwed up those references; too late t

Re: [Libguestfs] [PATCH v2] v2v: When picking a default kernel, favour non-debug kernels over debug kernels (RHBZ#1170073).

2014-12-04 Thread Pino Toscano
guestfs) inspect source = >let compare_best_kernels k1 k2 = > let i = compare k1.ki_supports_virtio k2.ki_supports_virtio in > if i <> 0 then i > -else compare_app2_versions k1.ki_app k2.ki_app > + e

[Libguestfs] [PATCH] customize, sysprep: add a short SELinux note

2014-12-05 Thread Pino Toscano
Add a short paragraph about SELinux, mostly to point to the documentation about it provided in the documentation of virt-builder. --- customize/virt-customize.pod | 8 sysprep/virt-sysprep.pod | 8 2 files changed, 16 insertions(+) diff --git a/customize/virt-customize.pod b

[Libguestfs] [PATCH] sysprep: user-account: mark "changed file" if users were removed

2014-12-05 Thread Pino Toscano
Removing an user causes /etc/passwd, /etc/shadow, and /etc/group to change, so mark the side effects as such if any user has been removed. --- sysprep/sysprep_operation_user_account.ml | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sysprep/sysprep_operation_user_account.m

[Libguestfs] [PATCH] sysprep: add a "changed file" side effect

2014-12-05 Thread Pino Toscano
--- sysprep/sysprep_operation.ml | 3 +++ sysprep/sysprep_operation.mli | 2 ++ 2 files changed, 5 insertions(+) diff --git a/sysprep/sysprep_operation.ml b/sysprep/sysprep_operation.ml index 1531268..ec5e374 100644 --- a/sysprep/sysprep_operation.ml +++ b/sysprep/sysprep_operation.ml @@ -30,8 +

Re: [Libguestfs] [PATCH v3 01/11] daemon: btrfs: add helper functions mount and umount

2014-12-16 Thread Pino Toscano
ree (fs_buf); > + return 0; > +} The only issue with umount is that it does not free fs_buf properly in all the return paths (e.g. when command or rmdir fail). IMHO it'd be better to leave the ownership of that buffer to whatever calls umount (using CLEANUP_FREE to ease that). -- Pin

Re: [Libguestfs] [PATCH 5/5] New API: btrfs_filesystem_set_label

2015-01-05 Thread Pino Toscano
ot;btrfs"; camel_name = "BTRFSFilesystemSetLabel"; > +tests = [ > + InitPartition, Always, TestResultString ( > +[["mkfs_btrfs"; "/dev/sda1"; ""; ""; "NOARG"; ""; "NOAR

Re: [Libguestfs] [PATCH 3/5] New API: btrfs_filesystem_get_label

2015-01-05 Thread Pino Toscano
"/dev/sda1"; ""; ""; "NOARG"; ""; "label"; "NOARG"; > ""; ""]; > + ["mount"; "/dev/sda1"; "/"]; > + ["btrfs_filesystem_get_label"; "/";]], "label\n"), []; > +]; This test bit would be good to be added to the tests of vfs_label, just with s/Always/IfAvailable "btrfs"/ so it is run only when btrfs is available. Thanks, -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [PATCH] virt-diff: add additional ignore options

2015-01-05 Thread Pino Toscano
ring (file->xattrs->val[i].attrname); > - output_binary (file->xattrs->val[i].attrval, > - file->xattrs->val[i].attrval_len); > +for (i = 0; i < file->xattrs_orig->len; ++i) { > + output_string (file->xattrs_orig->val[i].attrname); > + output_binary (file->xattrs_orig->val[i].attrval, > + file->xattrs_orig->val[i].attrval_len); > } >} > } > diff --git a/diff/virt-diff.pod b/diff/virt-diff.pod > index e1d67f3..4ffb33a 100644 > --- a/diff/virt-diff.pod > +++ b/diff/virt-diff.pod > @@ -214,6 +214,18 @@ Enable tracing of libguestfs API calls. > > Display extended attributes. > > +=item B<--no-compare-xattrs> > + > +=item B<--no-compare-extra-stats> > + > +=item B<--no-compare-perms> > + > +=item B<--no-compare-uids> > + > +=item B<--no-compare-times> > + > +When comparing, do not consider files different if xattrs, extra-stats, > permissions, uid/gid and times differ, respectively > + Just document each one separately, even if with a similar documentation snippet; something like: =item B<--no-compare-xattrs> The default is to compare the extended attributes of files. Using this flag ignores the extended attributes when comparing files. Also, as before, place them sorted alphabetically among the other options. Thanks, -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [PATCH 3/5] New API: btrfs_filesystem_get_label

2015-01-07 Thread Pino Toscano
t; > +[["mkfs_btrfs"; "/dev/sda1"; ""; ""; "NOARG"; ""; "label"; > > > "NOARG"; ""; ""]; > > > + ["mount"; "/dev/sda1";

Re: [Libguestfs] [PATCH] virt-diff: add additional ignore options

2015-01-07 Thread Pino Toscano
In data martedì 6 gennaio 2015 18:50:52, Gabriele Cerami ha scritto: > On 05 Jan, Pino Toscano wrote: > > Hm, I'm a bit dubious whether information that are ignored when > > comparing should be shown -- after all, when not enabling some > > attribute compared by de

Re: [Libguestfs] [PATCH 1/5] New API: btrfs_scrub

2015-01-07 Thread Pino Toscano
seems like this is an asynchronous operation by default, so I'm not sure whether it would be useful to just start it without any way to monitor its status. Also, what would it happen when you start a scrub operation on a mounted filesystem, and then you eith

Re: [Libguestfs] [PATCH 2/5] New API: btrfs_check

2015-01-07 Thread Pino Toscano
ot;btrfs_check"; > +style = RErr, [Device "device"], []; > +proc_nr = Some 436; > +optional = Some "btrfs"; camel_name = "BTRFSCheck"; > +tests = [ > + InitPartition, Always, TestRun ( > +[["mkfs_btrfs"; "/dev/sda1&quo

Re: [Libguestfs] [PATCH 1/5] New API: btrfs_scrub

2015-01-12 Thread Pino Toscano
On Monday 12 January 2015 11:45:02 Hu Tao wrote: > On Wed, Jan 07, 2015 at 12:37:48PM +0100, Pino Toscano wrote: > > In data venerdì 26 dicembre 2014 16:17:45, Hu Tao ha scritto: > > > Signed-off-by: Hu Tao > > > --- >

[Libguestfs] [PATCH] format, make-fs: specify the label on mkfs

2015-01-13 Thread Pino Toscano
If specified, pass the label for the new filesystem directly to the mkfs (or mkfs_btrfs) call. This saves one set_label call, mostly. --- format/format.c | 10 ++ make-fs/make-fs.c | 28 +--- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/format

[Libguestfs] [PATCH] mkfs: add 'label' optional argument

2015-01-13 Thread Pino Toscano
Add the 'label' optional argument to the mkfs action, so it is possible to set a filesystem label direct when creating it. There may be filesystems not supporting changing the label of existing filesystems but only setting it at creation time, so this new optarg will help. Implement it for the mos

Re: [Libguestfs] [PATCH 2/5] New API: btrfs_check

2015-01-13 Thread Pino Toscano
On Monday 12 January 2015 09:37:36 Hu Tao wrote: > On Wed, Jan 07, 2015 at 01:25:50PM +0100, Pino Toscano wrote: > > In data venerdì 26 dicembre 2014 16:17:46, Hu Tao ha scritto: > > > Signed-off-by: Hu Tao > > > --- > > > daemon/btrfs.c | 24 +

Re: [Libguestfs] [PATCH 4/5] New API: add btrfs_filesystem_defragment

2015-01-13 Thread Pino Toscano
/"]; > + ["btrfs_filesystem_defragment"; "/"]]), []; > + InitPartition, Always, TestRun ( > +[["mkfs_btrfs"; "/dev/sda1"; ""; ""; "NOARG"; ""; "NOARG"; "NOARG"; > ""; ""]; > + ["mount"; "/dev/sda1"; "/"]; > + ["touch"; "/hello"]; > + ["btrfs_filesystem_defragment"; "/hello"]]), []; > +]; > +shortdesc = "defragment a file or directory"; > +longdesc = "\ > +Defragment a file or directory." }; Maybe it would be worth mentioning btrfs in the descriptions. -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

[Libguestfs] RFC: OSTree support

2015-01-13 Thread Pino Toscano
points for each OS, like done currently Contra: - tools would need to support multiple roots, and possibly let users select which one So far that's the not-in-depth summary of what's needed to be done, at least from what I could say. Thoughts? [1] https://bugzilla.redhat.com/show_bug.

Re: [Libguestfs] [PATCH] virt-buider: doc: Use osinfo-query to get OS variants

2015-01-13 Thread Pino Toscano
n most efficiently. To get a list > of all variants, do: > > - virt-install --os-variant list > + osinfo-query os > + > +The above tool is provided by libosinfo package. > > =item 3. > LGTM. -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

[Libguestfs] [PATCH] daemon: use btrfs(1) to get btrfs labels

2015-01-14 Thread Pino Toscano
blkid(1) (or actually, libblkid) seems to handle file system labels up to 127 characters. Considering that btrfs labels can be up to 255 characters, this means long labels are not read correctly (i.e. get truncated) by blkid. Get the file system type, and if btrfs is available invoke `btrfs filesy

[Libguestfs] [PATCH 1/2] daemon: use btrfs(1) to get btrfs labels

2015-01-15 Thread Pino Toscano
blkid(1) (or actually, libblkid) seems to handle filesystem labels up to 127 characters. Considering that btrfs labels can be up to 255 characters, this means long labels are not read correctly (i.e. get truncated) by blkid. Get the filesystem type, and if btrfs is available invoke `btrfs filesyst

[Libguestfs] [PATCH 2/2] daemon: use ntfslabel(1) to get ntfs labels

2015-01-15 Thread Pino Toscano
blkid(1) (or actually, libblkid) seems to handle filesystem labels up to 127 characters. Considering that btrfs labels can be up to 128 characters, this means long labels are not read correctly (i.e. get truncated) by blkid. Furthermore, ntfs labels are actually unicode, and libblkid seems to not

[Libguestfs] [PATCH] mknod: filter modes in mkfifo, mknod_b, mknod_c (RHBZ#1182463).

2015-01-15 Thread Pino Toscano
Since mkfifo, mknod_b, and mknod_c add the correct file type to the modes of the resulting file, make sure the specified mode contains only permissions bits. --- daemon/mknod.c | 15 +++ generator/actions.ml | 21 ++--- 2 files changed, 33 insertions(+), 3 deletio

Re: [Libguestfs] [PATCH 5/5] New API: btrfs_filesystem_set_label

2015-01-16 Thread Pino Toscano
On Friday 16 January 2015 09:21:49 Hu Tao wrote: > On Mon, Jan 05, 2015 at 01:01:52PM +0100, Pino Toscano wrote: > > In data venerdì 26 dicembre 2014 16:17:49, Hu Tao ha scritto: > > > Signed-off-by: Hu Tao > > > --- >

[Libguestfs] [PATCH 1/2] mllib: add simple qemu filename sanitizing function

2015-01-16 Thread Pino Toscano
It mimics a bit in OCaml the logic used in commit a95214b1985e694946e3426120a6fdc13a3f081f (for the main library) and commit 588af1953e5f7ab74009b9175cc5d3efb8bb651a (in disk-create), so in OCaml tools direct calls to qemu/qemu-img with filenames provided by the user can properly handle filenames w

[Libguestfs] [PATCH 2/2] sparsify: handle output filenames with ':'

2015-01-16 Thread Pino Toscano
With commit a594b7f90a682e2a9327b142138edb76ad8ba8ff the checks for input and output files with ':' were removed; while the input file is handled correctly by the disk_create API, an output filename with ':' could still be handled as specifying a transport, failing the last "qemu-img convert" call.

[Libguestfs] [PATCH] build: check for single libsystemd before libsystemd-journal

2015-01-19 Thread Pino Toscano
Since systemd 209, all the functionalities of the former libsystemd-* (including libsystemd-journal) have been merged into a single libsystemd, with the former libraries left as compatibility ones. Thus, first look for libsystemd, and if not found try again with the libsystemd-journal as used befo

[Libguestfs] [PATCH] gobject: fix printf conversion specifier

2015-01-19 Thread Pino Toscano
Use PRIu64 to correctly handle uint64_t. --- generator/gobject.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/generator/gobject.ml b/generator/gobject.ml index 5deb87e..5b07edd 100644 --- a/generator/gobject.ml +++ b/generator/gobject.ml @@ -722,6 +722,7 @@ let generate_g

[Libguestfs] [PATCH] daemon: readdir: fix invalid memory access on error

2015-01-20 Thread Pino Toscano
If "strdup (d->d_name)" fails with "i" > 0, then both "p" and "ret->guestfs_int_dirent_list_val" are non-null pointers, but the latter is no more valid (since "p" is the new realloc'ed buffer). Hence, trying to free both will access to invalid memory. Make sure to free only one of them, "p" if not

[Libguestfs] [PATCH] fish: remove extra "prompt" checks

2015-01-20 Thread Pino Toscano
The code is already within a "if (prompt) {...}" block, so checking for "prompt" again is redundant. --- fish/fish.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fish/fish.c b/fish/fish.c index 8b74c7b..71db83a 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -661,8 +661,8

[Libguestfs] [PATCH] launch: libvirt: do not leak the backend string on error

2015-01-20 Thread Pino Toscano
Make sure to free the backend string after using it. --- src/launch-libvirt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/launch-libvirt.c b/src/launch-libvirt.c index 899742f..6f95e98 100644 --- a/src/launch-libvirt.c +++ b/src/launch-libvirt.c @@ -719,6 +719,8 @@ p

Re: [Libguestfs] [PATCH] daemon: readdir: fix invalid memory access on error

2015-01-21 Thread Pino Toscano
On Wednesday 21 January 2015 10:28:33 Hu Tao wrote: > On Tue, Jan 20, 2015 at 04:28:39PM +0100, Pino Toscano wrote: > > If "strdup (d->d_name)" fails with "i" > 0, then both "p" and > > "ret->guestfs_int_dirent_list_val" are non-null

Re: [Libguestfs] [PATCH] fish: remove extra "prompt" checks

2015-01-21 Thread Pino Toscano
On Wednesday 21 January 2015 10:39:12 Hu Tao wrote: > On Tue, Jan 20, 2015 at 04:28:40PM +0100, Pino Toscano wrote: > > The code is already within a "if (prompt) {...}" block, so checking for > > "prompt" again is redundant. > > --- > > fish/fish.c |

[Libguestfs] [PATCH] customize: add --commands-from-file

2015-01-21 Thread Pino Toscano
Pass to --commands-from-file the name of a file containing customization commands in each line, as if they were specified as command line arguments. This eases the reuse of commands among different builder/customize/sysprep invocations. --- builder/cmdline.ml | 3 +- customize/customize_

[Libguestfs] [PATCH v2] customize: add --commands-from-file

2015-01-22 Thread Pino Toscano
Pass to --commands-from-file the name of a file containing customization commands in each line, as if they were specified as command line arguments. This eases the reuse of commands among different builder/customize/sysprep invocations. --- builder/cmdline.ml | 3 +- customize/customize

[Libguestfs] [PATCH 1/2] configure: look for the oUnit OCaml module

2015-01-22 Thread Pino Toscano
It will be used for the OCaml unit tests. --- configure.ac | 5 + 1 file changed, 5 insertions(+) diff --git a/configure.ac b/configure.ac index e0fb481..e360bbb 100644 --- a/configure.ac +++ b/configure.ac @@ -1120,6 +1120,7 @@ AS_IF([test "x$OCAMLC" != "xno"],[ ]) OCAML_PKG_gettext=no +

[Libguestfs] [PATCH 2/2] mllib: convert common_utils_tests to oUnit

2015-01-22 Thread Pino Toscano
Covert common_utils_tests to use oUnit as testing framework, replacing the hand-made assert in favour of structured unit tests and better error reporting. common_utils_tests is now built only when the oUnit module has been found. --- mllib/Makefile.am | 17 - mllib/common_utils_tes

[Libguestfs] [PATCH 1/2] mllib: tests: add tests for string_lines_split

2015-01-23 Thread Pino Toscano
--- mllib/common_utils_tests.ml | 18 ++ 1 file changed, 18 insertions(+) diff --git a/mllib/common_utils_tests.ml b/mllib/common_utils_tests.ml index 09d5c51..283e9a1 100644 --- a/mllib/common_utils_tests.ml +++ b/mllib/common_utils_tests.ml @@ -27,6 +27,7 @@ let prog = "common_u

[Libguestfs] [PATCH 2/2] mllib: add simple tests for the JSON module

2015-01-23 Thread Pino Toscano
--- .gitignore | 1 + mllib/JSON_tests.ml | 245 mllib/Makefile.am | 15 +++- po/POTFILES-ml | 1 + 4 files changed, 260 insertions(+), 2 deletions(-) create mode 100644 mllib/JSON_tests.ml diff --git a/.gitignore b/.gitig

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

2015-01-26 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 4/6] generator: add VPublicNoFish visibility type

2015-01-26 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

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

2015-01-26 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 2/6] cmd: add a child-setup callback

2015-01-26 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 6/6] fish: use copy-in and copy-out

2015-01-26 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

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

2015-01-26 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] customize: handle Arg.Set parameters in commands file

2015-01-27 Thread Pino Toscano
When reading commands from a file, handle also Arg.Set parameters, so they can be enabled as well. --- generator/customize.ml | 1 + 1 file changed, 1 insertion(+) diff --git a/generator/customize.ml b/generator/customize.ml index 4844681..1c9092b 100644 --- a/generator/customize.ml +++ b/generat

[Libguestfs] [PATCH] daemon: parted: use --part-type with recent sfdisk

2015-01-28 Thread Pino Toscano
Check whether --part-type is supported (in the rewritten sfdisk in util-linux >= 2.26), and use it instead of --print-id & --change-id. The actual result should be the same, just not using a (recently) deprecated command line API. --- daemon/parted.c | 36 1 f

Re: [Libguestfs] [PATCH 3/3] sparsify: Ignore read-only LVs (RHBZ#1185561).

2015-01-28 Thread Pino Toscano
+) > +else false This looks to me that it would go through all the LVs, even RW ones, when is_read_only_lv is invoked, right? Considering that we get a list of all the LVs anyway when doing: > + let is_read_only_lv = is_read_only_lv g in wouldn't it be better to j

[Libguestfs] [PATCH 2/2] sparsify: ignore read-only devices

2015-01-29 Thread Pino Toscano
In copy mode, make sure to not zero-free-space devices mounted as read-only, as we cannot write to them. Related to RHBZ#1079625. --- sparsify/copying.ml | 10 ++ 1 file changed, 10 insertions(+) diff --git a/sparsify/copying.ml b/sparsify/copying.ml index 4c23939..9c2c545 100644 --- a/s

[Libguestfs] [PATCH 1/2] sparsify: ignore read-only btrfs snapshots (RHBZ#1079625)

2015-01-29 Thread Pino Toscano
In copy mode, make sure to not zero-free-space read-only btrfs snapshots, as we cannot write to them. --- sparsify/copying.ml | 28 +--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/sparsify/copying.ml b/sparsify/copying.ml index 8d77964..4c23939 100644 --

[Libguestfs] RFC: Handle query strings for http and https (RHBZ#1092583)

2015-02-02 Thread Pino Toscano
Parse the query string from URLs, and pass it as new add_drive optarg; use it when building the file= URL for qemu. Accept query string only for http and https protocols, for now. --- Possibly it looks like an ad-hoc solution for http(s), although I'm not sure how it could possibly be generalized

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