[Libguestfs] [PATCH 2/3] inspect: ignore special CD devices on FreeBSD install discs

2013-11-28 Thread Pino Toscano
/etc/fstab in installation discs of FreeBSD can have an entry pointing to the mounted CD itself; skip it as it is done with other CD devices in check_fstab. --- src/inspect-fs-unix.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/inspect-fs-unix.c

[Libguestfs] [PATCH 3/3] inspect: improve detection of FreeBSD install discs

2013-11-28 Thread Pino Toscano
Check for /boot/loader.rc as install disc detection, using it to mark FreeBSD install discs. Also, check for /mfsroot.gz to see whether such disc is also a live one. See also RHBZ#1033207. --- src/inspect-fs-cd.c | 19 ++- src/inspect-fs.c| 3 ++- 2 files changed, 20

[Libguestfs] [PATCH 3/3, v2] inspect: improve detection of FreeBSD install discs

2013-11-28 Thread Pino Toscano
Check for /boot/loader.rc as install disc detection, using it to mark FreeBSD install discs. Also, check for /mfsroot.gz to see whether such disc is also a live one. See also RHBZ#1033207. --- src/inspect-fs-cd.c | 8 +++- src/inspect-fs.c| 3 ++- 2 files changed, 9 insertions(+), 2

Re: [Libguestfs] [PATCH 3/3] inspect: improve detection of FreeBSD install discs

2013-11-28 Thread Pino Toscano
On Thursday 28 November 2013 14:12:16 Richard W.M. Jones wrote: On Thu, Nov 28, 2013 at 02:48:38PM +0100, Pino Toscano wrote: Check for /boot/loader.rc as install disc detection, using it to mark FreeBSD install discs. Also, check for /mfsroot.gz to see whether such disc is also a live

[Libguestfs] [PATCH] builder: translate more user-visible strings

2013-12-04 Thread Pino Toscano
Translate also the OS version and Notes strings that appear in the --long output. --- builder/list_entries.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builder/list_entries.ml b/builder/list_entries.ml index 8c24fe2..a1d0696 100644 --- a/builder/list_entries.ml +++

[Libguestfs] [PATCH 0/3] Small improvements to i18n extraction/handling

2013-12-05 Thread Pino Toscano
Hi, here there are few patches to improve the extraction of translatable messages, and the usage of messages with plural forms. Pino Toscano (3): po: fix broken message extraction po: fix dependencies for libguestfs.pot extraction fish: improve the command error messages generator

[Libguestfs] [PATCH 3/3] fish: improve the command error messages

2013-12-05 Thread Pino Toscano
- when a command needs no parameters, tell that explicitly instead of command should have 0 parameters - use gettext's plural form when printing the number of required arguments - improve the error message for a variable number of parameters limited only in the maximum number of them, using

[Libguestfs] [PATCH 1/3] po: fix broken message extraction

2013-12-05 Thread Pino Toscano
Extracting separately the pot for the various languages and then creating manually the global pot (by manually joining the above ones after having stripped their headers) is wrong, since other than being an hack it can create an invalid pot when the same message appears in sources written in

Re: [Libguestfs] [PATCH 1/3] po: fix broken message extraction

2013-12-05 Thread Pino Toscano
number of messages in the pot could be different, but it is not relevant for the method, anyway) -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [PATCH 2/3] po: fix dependencies for libguestfs.pot extraction

2013-12-05 Thread Pino Toscano
On Thursday 05 December 2013 18:31:59 Richard W.M. Jones wrote: On Thu, Dec 05, 2013 at 07:02:28PM +0100, Pino Toscano wrote: On Thursday 05 December 2013 15:53:58 Richard W.M. Jones wrote: On Thu, Dec 05, 2013 at 04:30:05PM +0100, Pino Toscano wrote: Fix the dependencies

[Libguestfs] [PATCH] builder: adapt test-virt-builder-list.sh output expectation

2013-12-06 Thread Pino Toscano
ee0e56f43e55307fefa1d04505ed6477d604d220 slightly changes the output of --list but test-virt-builder-list.sh has not been updated accordingly. Adapting the expected output makes test-virt-builder-list.sh pass again. --- builder/test-virt-builder-list.sh | 8 1 file changed, 4

Re: [Libguestfs] Use of qemu-kvm command line arguments in libguestfs (was: Re: Fwd: ...)

2013-12-06 Thread Pino Toscano
On Monday 02 December 2013 09:09:44 Richard W.M. Jones wrote: On Mon, Dec 02, 2013 at 01:17:09AM +0100, Pino Toscano wrote: On Friday 29 November 2013 18:53:38 you wrote: I'm marking options with NONE (not used at all), or M (used in master) and/or RH7 (used in rhel-7.0

Re: [Libguestfs] [PATCH] builder: adapt test-virt-builder-list.sh output expectation

2013-12-06 Thread Pino Toscano
On Friday 06 December 2013 14:51:41 Richard W.M. Jones wrote: On Fri, Dec 06, 2013 at 03:00:41PM +0100, Pino Toscano wrote: ee0e56f43e55307fefa1d04505ed6477d604d220 slightly changes the output of --list but test-virt-builder-list.sh has not been updated accordingly. Adapting

Re: [Libguestfs] [PATCH] builder: translate more user-visible strings

2013-12-06 Thread Pino Toscano
On Friday 06 December 2013 14:50:08 Richard W.M. Jones wrote: On Fri, Dec 06, 2013 at 02:58:27PM +0100, Pino Toscano wrote: OTOH, that makes me think whether virt-builder shouldn't have some kind of porcelain/XML/JSON/CSV/etc output for --list to ease its parsing, as it could be translated

[Libguestfs] [PATCH] sysprep: allow to specify globbing for --delete

2013-12-09 Thread Pino Toscano
Adapt the globbing part from the old --remote-path work previously proposed for sysprep [1], allowing --delete to perform globbing when deleting paths. [1] https://www.redhat.com/archives/libguestfs/2013-October/msg00045.html --- sysprep/sysprep_operation_delete.ml | 4 +++- 1 file changed, 3

[Libguestfs] [PATCH] launch: switch from -nographic to -display none

2013-12-09 Thread Pino Toscano
The latter is a better way to disable the qemu display output as we need to, without enabling extra devices (which are disabled already, anyway). Also, related to the change above, ban the -display parameter from the ones that can be supplied by the user. --- configure.ac| 8

Re: [Libguestfs] [PATCH] sysprep: mention globbing in help for --delete

2013-12-09 Thread Pino Toscano
On Monday 09 December 2013 17:58:37 Richard W.M. Jones wrote: On Mon, Dec 09, 2013 at 06:17:00PM +0100, Pino Toscano wrote: Followup of ed4bcb119cb908e98ecc1107dcd8b740ee2f484f. --- sysprep/sysprep_operation_delete.ml | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff

Re: [Libguestfs] [PATCH] lib: fix newline in error output

2013-12-10 Thread Pino Toscano
On Monday 09 December 2013 19:26:47 Richard W.M. Jones wrote: On Mon, Dec 09, 2013 at 08:13:19PM +0100, Pino Toscano wrote: See also RHBZ#923355. --- src/actions-support.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/actions-support.c b/src/actions

Re: [Libguestfs] [PATCH] sysprep: handle distro specific sysv scripts

2013-12-12 Thread Pino Toscano
On Thursday 12 December 2013 16:27:30 Olaf Hering wrote: On Thu, Dec 12, Pino Toscano wrote: Sure, but as a Should-Start means it is a weak dependency, and can be skipped, which is what I don't want. Are you saying in Debian the Should-Start is not handled properly? Even if Should-Start

[Libguestfs] [PATCH] drives: add CD-ROM disk images as read-only drives (RHBZ#563450).

2013-12-16 Thread Pino Toscano
The current add_cdrom way basically appends a new raw -cdrom /path parameter to the qemu invocation (even when using libvirt as backend), hence such images are seen as CD-ROM drives inside the appliance. However, there is no need for such particular behaviour, as they need to be handled as normal

[Libguestfs] [PATCH] inspect: fix detection of newer CirrOS versions (RHBZ#1045450).

2013-12-20 Thread Pino Toscano
Add an own case for CirrOS, based on the /etc/cirros/version file provided in newer version instead of the Buildroot-generated /etc/br-version. --- src/inspect-fs-unix.c | 12 1 file changed, 12 insertions(+) diff --git a/src/inspect-fs-unix.c b/src/inspect-fs-unix.c index

[Libguestfs] [PATCH] tests/mountable: skip if btrfs is not available

2013-12-23 Thread Pino Toscano
This test uses btrfs, so skip it if either the btrfs feature or the btrfs filesystem is not available. --- tests/mountable/test-internal-parse-mountable.c | 13 + 1 file changed, 13 insertions(+) diff --git a/tests/mountable/test-internal-parse-mountable.c

Re: [Libguestfs] [Bug 1046905] New: RFE: add argument to virt-sysprep to disable individual default operations

2014-01-07 Thread Pino Toscano
On Tuesday 07 January 2014 12:12:43 Richard W.M. Jones wrote: On Tue, Jan 07, 2014 at 11:16:08AM +0100, Pino Toscano wrote: On Friday 27 December 2013 10:58:15 you wrote: virt-sysprep either runs with all default operations or a selected list of operations with the --enable argument

[Libguestfs] RFC: copy-attributes command

2014-01-07 Thread Pino Toscano
Hi, attached there is a prototype of patch for adding a new copy-attributes command. Such command would allow copy the attributes of a file to another, so for example in guestfish: copy-attributes foo bar permissions:true xattributes:false would only copy the permissions of foo to bar, not

Re: [Libguestfs] [Bug 1046905] New: RFE: add argument to virt-sysprep to disable individual default operations

2014-01-09 Thread Pino Toscano
On Tuesday 07 January 2014 15:24:51 Pino Toscano wrote: On Tuesday 07 January 2014 12:12:43 Richard W.M. Jones wrote: On Tue, Jan 07, 2014 at 11:16:08AM +0100, Pino Toscano wrote: On Friday 27 December 2013 10:58:15 you wrote: virt-sysprep either runs with all default operations

Re: [Libguestfs] RFC: copy-attributes command

2014-01-09 Thread Pino Toscano
On Tuesday 07 January 2014 21:04:36 Richard W.M. Jones wrote: On Tue, Jan 07, 2014 at 04:06:43PM +0100, Pino Toscano wrote: diff --git a/daemon/xattr.c b/daemon/xattr.c index af8bfd4..97a94d5 100644 --- a/daemon/xattr.c +++ b/daemon/xattr.c @@ -545,8 +545,98 @@ do_lgetxattr (const char

Re: [Libguestfs] RFC: copy-attributes command

2014-01-10 Thread Pino Toscano
On Tuesday 07 January 2014 21:04:36 Richard W.M. Jones wrote: On Tue, Jan 07, 2014 at 04:06:43PM +0100, Pino Toscano wrote: Hi, attached there is a prototype of patch for adding a new copy-attributes command. Such command would allow copy the attributes of a file to another, so

[Libguestfs] [PATCH] daemon: xattr: move the listxattrs code in an own function

2014-01-10 Thread Pino Toscano
Move in an own function the code that does the (l)listxattrs allocating the buffer of the right legth, as it will be useful later. No functional changes, just code motion. --- daemon/xattr.c | 64 -- 1 file changed, 44 insertions(+), 20

Re: [Libguestfs] RFC: copy-attributes command

2014-01-10 Thread Pino Toscano
On Friday 10 January 2014 13:33:38 Richard W.M. Jones wrote: On Fri, Jan 10, 2014 at 02:17:48PM +0100, Pino Toscano wrote: This code looks as if it will copy the xattrs, but it won't remove any which don't exist in the source. eg: source xattrs before: user.foo = 1

Re: [Libguestfs] RFC: copy-attributes command

2014-01-13 Thread Pino Toscano
On Friday 10 January 2014 16:53:32 Richard W.M. Jones wrote: On Fri, Jan 10, 2014 at 05:36:39PM +0100, Pino Toscano wrote: [..] This still isn't quite what I meant. My meaning was that mode would be disabled by default (unless all:true). OK. How about: int copy_mode, copy_xattributes

Re: [Libguestfs] [Bug 1046905] New: RFE: add argument to virt-sysprep to disable individual default operations

2014-01-13 Thread Pino Toscano
On Friday 10 January 2014 10:09:19 Richard W.M. Jones wrote: On Thu, Jan 09, 2014 at 03:45:54PM +, Richard W.M. Jones wrote: On Thu, Jan 09, 2014 at 04:21:10PM +0100, Pino Toscano wrote: + and set_operations op_string = +let currentopset = + match (!operations

[Libguestfs] [PATCH] sysprep: add --operations

2014-01-13 Thread Pino Toscano
Add a new --operation parameter which, similarly to --enable, can be used to enable operations, but also to remove them, and to add/remove the default operations and all the available ones. --- sysprep/main.ml | 36 +++ sysprep/sysprep_operation.ml | 24

[Libguestfs] [PATCH] New API: copy-attributes.

2014-01-13 Thread Pino Toscano
This allows one to copy attributes (like permissions, xattrs, ownership) from a file to another. --- daemon/daemon.h | 3 + daemon/file.c | 72 ++ daemon/xattr.c | 69 + fish/Makefile.am| 1 + fish/test-file-attrs.sh

[Libguestfs] [PATCH] builder, edit, fish: use copy-attributes

2014-01-14 Thread Pino Toscano
Make use of the new copy-attributes command to properly copy all file attributes from a file to the new version of it. --- builder/perl_edit.ml | 29 +--- edit/edit.c | 49 ++- fish/edit.c | 54

[Libguestfs] [PATCH] builder: test-virt-builder: check some results

2014-01-14 Thread Pino Toscano
Check at least some basic modifications in the image created with virt-builder. --- builder/test-virt-builder.sh | 47 +++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/builder/test-virt-builder.sh b/builder/test-virt-builder.sh index

[Libguestfs] [PATCH] fuse: remove extra trailing \n in debug messages

2014-01-15 Thread Pino Toscano
debug() adds it already. --- src/fuse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fuse.c b/src/fuse.c index d684c84..288c02a 100644 --- a/src/fuse.c +++ b/src/fuse.c @@ -68,7 +68,7 @@ gl_lock_define_initialized (static, mount_local_lock); #define DEBUG_CALL(fs,...)

[Libguestfs] [PATCH] fuse: clear stat structs (RHBZ#660687).

2014-01-15 Thread Pino Toscano
Not all the fields of struct stat are actually filled by us. This caused rubbish to appear in the microseconds fields, which were then used as base when changing atime/ctime (with e.g. touch), triggering EINVAL by futimens/utimensat when those rubbish values were out of the range allowed for

Re: [Libguestfs] [PATCH] fuse: provide a stub flush implementation (RHBZ#660687).

2014-01-15 Thread Pino Toscano
Hi, On Thursday 12 December 2013 16:28:31 Pino Toscano wrote: It seems that FUSE can invoke flush to make sure the pending changes (e.g. to the attributes) of a file are set. Since a missing flush implementation is handled as if it were returning ENOSYS, this can cause issues later

[Libguestfs] [PATCH 0/3] Add JSON output for virt-builder

2014-01-16 Thread Pino Toscano
Hi, This small patch serie adds a JSON output for virt-builder. This way it is possible to parse the list of available templates, with no need to parse the unstructured and possibly changing short and long outputs of virt-builder. Pino Toscano (3): builder: small refactor of the list output

[Libguestfs] [PATCH 2/3] builder: add --list-format

2014-01-16 Thread Pino Toscano
Add a --list-format which allows to choose which in format should be the output of --list. --- builder/cmdline.ml | 11 ++- builder/virt-builder.pod | 24 +--- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/builder/cmdline.ml b/builder/cmdline.ml

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

2014-01-21 Thread Pino Toscano
Just like with index-parse.h, also index-struct.h is a dependency of index-parser-c.c which automake cannot generate correctly. Thus, add it manually. --- builder/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/Makefile.am b/builder/Makefile.am index

[Libguestfs] [PATCH] builder: read all the available notes from the index

2014-01-22 Thread Pino Toscano
Switch the internal storage for the notes of each entry to a sorted list with all the subkeys available (which should represent the translations to various languages). The current outputs are the same (i.e. still the untranslated notes), so this is just internal refactoring/preparation. ---

[Libguestfs] [PATCH] builder: small code simplification

2014-01-22 Thread Pino Toscano
No actual behaviour changes, just remove extra match statements. --- builder/list_entries.ml | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/builder/list_entries.ml b/builder/list_entries.ml index 742e43b..0d3d9b2 100644 --- a/builder/list_entries.ml +++

Re: [Libguestfs] [PATCH] builder: read all the available notes from the index

2014-01-23 Thread Pino Toscano
= [] } - (* no untranslated notes *) ACK with that change. OK for me. Modified accordingly, and pushed. -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [virt-builder] symbol lookup error: /lib64/libgnutls.so.28 - undefined symbol: nettle_secp_256r1

2014-01-27 Thread Pino Toscano
a too low dependency in those two packages. -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

[Libguestfs] [PATCH 1/2] tests: add a a simple libvirt-is-version test tool

2014-01-27 Thread Pino Toscano
libvirt-is-version returns successfully in case the available version of libvirt is greater or equal than the specified major/minor/release values. --- .gitignore | 1 + Makefile.am| 1 + configure.ac | 1 +

[Libguestfs] [PATCH 0/2] Skip test-qemu-drive-libvirt.sh if libvirt is 1.1.3

2014-01-27 Thread Pino Toscano
far) written in shell/scripting language. Pino Toscano (2): tests: add a a simple libvirt-is-version test tool tests/disks: skip test-qemu-drive-libvirt.sh if libvirt is 1.1.3 .gitignore | 1 + Makefile.am| 1 + configure.ac

Re: [Libguestfs] [PATCH INCOMPLETE] Rewrite virt-make-fs in C (originally Perl).

2014-01-27 Thread Pino Toscano
and handling piping of them if needed. Given you are starting a new tool in C [2], what about making use of it to check how it works? [1] http://libpipeline.nongnu.org/ [2] as in, was not in C before -- Pino Toscano ___ Libguestfs mailing list

[Libguestfs] [PATCH] tests/regressions: remove C part of rhbz1044014

2014-01-27 Thread Pino Toscano
All it did was checking for a libvirt version, which is what libvirt-is-version now does; hence remove the C part, and use guestfish, ignoring the launch failure (as the C test did). --- .gitignore | 1 - tests/regressions/Makefile.am| 21

[Libguestfs] [PATCH] builder, sysprep: initialise the random generator

2014-01-28 Thread Pino Toscano
virt-builder and virt-sysprep may make use of Common_utils.string_random8 (which uses Random.int) for constructing temporary paths; not initialising the random generator means that every invocation will reuse the same name used previously (!). Thus just call Random.self_init, just like

Re: [Libguestfs] [PATCH] run: Actually use timeout --foreground option (RHBZ#1025269).

2014-01-28 Thread Pino Toscano
to ask when I noticed that few days ago. :) -- Pino Toscano ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [PATCH 1/2] daemon: If /selinux exists in the guest, bind-mount /sys/fs/selinux to there.

2014-01-28 Thread Pino Toscano
/selinux, bs-sysroot_sys_fs_selinux, NULL); Possibly I'm missing something, but... given that later /sys/fs/selinux of the appliance is bind-mounted as /sys/fs/selinux into the sysroot, couldn't /selinux be created just as a /syslinux - sys/fs/selinux symlink, to have a bind mount less? -- Pino

Re: [Libguestfs] [PATCH 05/10] examples: Update various examples to use new disk-create API.

2014-01-28 Thread Pino Toscano
[O_WRONLY;O_CREAT;O_TRUNC;O_NOCTTY] 0o666 in - ftruncate fd (512 * 1024 * 1024); - close fd; + g#disk_create output raw 536870912L; Minor niptick: I'd leave the multiplication, as it was before and as the other examples do (easier to spot and to change). -- Pino Toscano

[Libguestfs] [PATCH] builder: remove unused variables

2014-01-30 Thread Pino Toscano
Leftovers of the list_entries_short+list_entries_long split done in 91aae893c70b3877b31803800ba77836fd7a45e8. --- builder/list_entries.ml | 3 --- 1 file changed, 3 deletions(-) diff --git a/builder/list_entries.ml b/builder/list_entries.ml index 2f47231..80a309d 100644 ---

[Libguestfs] [PATCH] builder: output translated notes

2014-01-30 Thread Pino Toscano
Output all the translations available for the notes in the verbose output and the JSON output, while trying to match the system langauge in the show notes output. The JSON output is slightly changed to handle translations, with the untranslated notes being matched as C. The version is not bumped

Re: [Libguestfs] [PATCH] builder: output translated notes

2014-01-30 Thread Pino Toscano
On Thursday 30 January 2014 15:52:05 Richard W.M. Jones wrote: On Thu, Jan 30, 2014 at 02:44:12PM +0100, Pino Toscano wrote: + let l = ref [] in 'xs' is a bit more natural for lists of things than 'l'. + if Str.string_match regex loc 0 then ( +let match_or_empty n = + try

[Libguestfs] [PATCH] resize: properly restore GPT partition types

2014-02-03 Thread Pino Toscano
If there is a GPT partition layout, then what should be read and restored for each partition is the GPT type and not the MBR ID. Related to RHBZ#1060404. --- resize/resize.ml | 46 +++--- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git

[Libguestfs] [PATCH 0/3] virt-resize: preserve GPT partitions label

2014-02-04 Thread Pino Toscano
Hi, attached there are few patches to implement a way to get the label of GPT partitions (refactoring an existing function and adding a new daemon API) and using it in virt-resize to restore them when copying partitions. Thanks, Pino Toscano (3): daemon: parted: refactor sgdisk info parsing

[Libguestfs] [PATCH 3/3] resize: preserve GPT partition names (RHBZ#1060404).

2014-02-04 Thread Pino Toscano
Save the partition names/labels of the source partitions, and restore them after the partition copy. --- resize/resize.ml | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/resize/resize.ml b/resize/resize.ml index 191be83..c1794ed 100644 ---

[Libguestfs] [PATCH 1/3] daemon: parted: refactor sgdisk info parsing code

2014-02-04 Thread Pino Toscano
Isolate in an own function the code that runs sgdisk and parse a field of it (using an extraction function passed as parameter), using it for the GUID type. This is just code motion, no actual behaviour changes. --- daemon/parted.c | 53 + 1

[Libguestfs] [PATCH 2/3] New API: part-get-name (RHBZ#593511).

2014-02-04 Thread Pino Toscano
Counterpart of part-set-name, it uses sgdisk (hence needs the gdisk feature) to query for the label/name of a partition in a GPT layout. --- daemon/parted.c | 33 + generator/actions.ml | 13 + src/MAX_PROC_NR | 2 +- 3 files changed, 47

Re: [Libguestfs] [PATCH 2/3] New API: part-get-name (RHBZ#593511).

2014-02-04 Thread Pino Toscano
On Tuesday 04 February 2014 15:59:36 Richard W.M. Jones wrote: On Tue, Feb 04, 2014 at 04:01:32PM +0100, Pino Toscano wrote: +static char * +extract_optionally_quoted (const char *value) +{ + size_t value_len = strlen (value); + + if (value_len = 2 + ((value[0

Re: [Libguestfs] [PATCH 1/3] daemon: parted: refactor sgdisk info parsing code

2014-02-04 Thread Pino Toscano
On Tuesday 04 February 2014 15:56:54 Richard W.M. Jones wrote: On Tue, Feb 04, 2014 at 04:01:31PM +0100, Pino Toscano wrote: @@ -832,28 +835,22 @@ do_part_get_gpt_type(const char *device, int partnum) /* Split the line in 2 at the colon */ char *colon = strchr (line

Re: [Libguestfs] libguestfs and zfs-fuse

2014-02-05 Thread Pino Toscano
/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

[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

[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

[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

[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 @@

[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 @@

[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 +++

[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

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 ^ '] in Quoting? If oldhost contains a ' character + some Augeas

[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

[Libguestfs] Handling different architectures in virt-builder

2014-02-14 Thread Pino Toscano
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 mailing list Libguestfs

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

2014-02-17 Thread Pino Toscano
by the target name, so our custom rules won't apply basically. Curiously, I hit that last weekend when rebuilding on my Debian testing (which has automake 1.14, unlike my current F19 which has 1.13), but didn't have the occasion to debug it yet. -- Pino Toscano

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 always produce a x86_64 image, regardless

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-$version-$arch c) to not break

[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 ---

[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

[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

[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

[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 +++

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 + 1 file changed, 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 +++

[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 +++

[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. ---

[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

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 in the future

[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 ---

[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

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 outputs to print also

[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

  1   2   3   4   5   6   7   8   9   10   >