[Libguestfs] [PATCH v2 3/3] find_block: added API tests

2016-09-19 Thread Matteo Cafasso
NTFS file system always has the Boot file at block 0. This reliable information helps testing the API. Signed-off-by: Matteo Cafasso --- tests/tsk/Makefile.am| 1 + tests/tsk/test-find-block.sh | 66 2 files changed, 67

[Libguestfs] [PATCH v2 1/3] New API: internal_find_block

2016-09-19 Thread Matteo Cafasso
The internal_find_block command searches all entries referring to the given filesystem data block and returns a tsk_dirent structure for each of them. For filesystems such as NTFS which do not delete the block mapping when removing files, it is possible to get multiple non-allocated entries for

[Libguestfs] [PATCH v2 2/3] New API: find_block

2016-09-19 Thread Matteo Cafasso
Library's counterpart of the daemon's internal_find_block command. It writes the daemon's command output on a temporary file and parses it, deserialising the XDR formatted tsk_dirent structs. It returns to the caller the list of tsk_dirent structs generated by the internal_find_block command.

[Libguestfs] [PATCH v2 0/3] New API - find_block

2016-09-19 Thread Matteo Cafasso
v2: - use boolean field in struct - move refactoring to previous series Matteo Cafasso (3): New API: internal_find_block New API: find_block find_block: added API tests daemon/tsk.c | 90 generator/actions.ml | 25

Re: [Libguestfs] [PATCH v7 0/4] New API - find_inode

2016-09-19 Thread Pino Toscano
On Monday, 19 September 2016 19:42:48 CEST Matteo Cafasso wrote: > v7: > > - Merge src/tsk.c refactoring patch with #4 of find_block series > > Matteo Cafasso (4): > lib: logic refactoring > New API: internal_find_inode > New API: find_inode > find_inode: added API tests LGTM, pushed.

Re: [Libguestfs] [PATCH 3/3] OCaml tools: add crypto support (RHBZ#1362649)

2016-09-19 Thread Richard W.M. Jones
On Mon, Sep 19, 2016 at 07:12:46PM +0200, Pino Toscano wrote: > Make use of the additional command line arguments, and API needed to > decrypt LUKS partitions. > > This affects only virt-customize, virt-get-kernel, virt-sparsify, and > virt-sysprep, as they are the main OCaml tools interacting

Re: [Libguestfs] [PATCH 2/3] mllib: expose disk decrypt functionalities

2016-09-19 Thread Richard W.M. Jones
On Mon, Sep 19, 2016 at 07:12:45PM +0200, Pino Toscano wrote: > +let inspect_decrypt g = > + (* Note we pass original 'g' even though it is not used by the > + * callee. This is so that 'g' is kept as a root on the stack, and > + * so cannot be garbage collected while we are in the

Re: [Libguestfs] [PATCH 1/3] fish: move disk decryption helpers in own file

2016-09-19 Thread Richard W.M. Jones
On Mon, Sep 19, 2016 at 07:12:44PM +0200, Pino Toscano wrote: > This way it is easier to use them outside the rest of the code in > guestfish for inspection & mount. > > Just code motion, no behaviour changes. > --- > align/Makefile.am | 1 + > cat/Makefile.am | 1 + >

[Libguestfs] [PATCH 2/3] mllib: expose disk decrypt functionalities

2016-09-19 Thread Pino Toscano
Expose via Common_utils the C functions & variables (part of guestfish) that handle decryption of LUKS partitions, and the additional command line arguments to tune the way they work. This way it will be easy to provide (basic) crypto support also in OCaml-based tools. Related to: RHBZ#1362649

[Libguestfs] [PATCH 3/3] OCaml tools: add crypto support (RHBZ#1362649)

2016-09-19 Thread Pino Toscano
Make use of the additional command line arguments, and API needed to decrypt LUKS partitions. This affects only virt-customize, virt-get-kernel, virt-sparsify, and virt-sysprep, as they are the main OCaml tools interacting with user-provided images. --- customize/customize_main.ml| 5 -

[Libguestfs] [PATCH 0/3] add crypto/LUKS support in some OCaml-based tools

2016-09-19 Thread Pino Toscano
Hi, this series refactors some guestfish code (not much), and exposes it via Common_utils, so it is possible to decrypt LUKS partitions when using virt-customize, virt-get-kernel, virt-sparsify, and virt-sysprep. This brings them closer in features with C tools. Most probably a couple more of

[Libguestfs] [PATCH 1/3] fish: move disk decryption helpers in own file

2016-09-19 Thread Pino Toscano
This way it is easier to use them outside the rest of the code in guestfish for inspection & mount. Just code motion, no behaviour changes. --- align/Makefile.am | 1 + cat/Makefile.am | 1 + df/Makefile.am| 1 + diff/Makefile.am | 1 + edit/Makefile.am | 1

[Libguestfs] [PATCH v7 1/4] lib: logic refactoring

2016-09-19 Thread Matteo Cafasso
Code changes in preparation for new APIs. Signed-off-by: Matteo Cafasso --- src/tsk.c | 39 +-- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/src/tsk.c b/src/tsk.c index 90177ab..ecafcb7 100644 --- a/src/tsk.c +++

[Libguestfs] [PATCH v7 2/4] New API: internal_find_inode

2016-09-19 Thread Matteo Cafasso
The internal_find_inode command searches all entries referring to the given inode and returns a tsk_dirent structure for each of them. The command is able to retrieve information regarding deleted or unaccessible files where other commands such as stat or find would fail. The gathered list of

[Libguestfs] [PATCH v7 4/4] find_inode: added API tests

2016-09-19 Thread Matteo Cafasso
NTFS file system always has the MFT file at inode 0. This reliable information helps testing the API. Signed-off-by: Matteo Cafasso --- tests/tsk/Makefile.am| 3 +- tests/tsk/test-find-inode.sh | 66 2 files changed, 68

[Libguestfs] [PATCH v7 3/4] New API: find_inode

2016-09-19 Thread Matteo Cafasso
Library's counterpart of the daemon's internal_find_inode command. It writes the daemon's command output on a temporary file and parses it, deserialising the XDR formatted tsk_dirent structs. It returns to the caller the list of tsk_dirent structs generated by the internal_find_inode command.

[Libguestfs] [PATCH v7 0/4] New API - find_inode

2016-09-19 Thread Matteo Cafasso
v7: - Merge src/tsk.c refactoring patch with #4 of find_block series Matteo Cafasso (4): lib: logic refactoring New API: internal_find_inode New API: find_inode find_inode: added API tests daemon/tsk.c | 52 ++ generator/actions.ml

Re: [Libguestfs] [PATCH 0/4] New API - find_block

2016-09-19 Thread Pino Toscano
On Saturday, 17 September 2016 18:18:52 CEST Matteo Cafasso wrote: > This series is ready for review but requires the previous one to be merged > first: > https://www.redhat.com/archives/libguestfs/2016-September/msg00101.html > > The find_block API allows the User to search all the filesystem

Re: [Libguestfs] [PATCH 4/4] TSK: small refactoring

2016-09-19 Thread Pino Toscano
On Saturday, 17 September 2016 18:18:56 CEST Matteo Cafasso wrote: > Removed duplicated code. > > Signed-off-by: Matteo Cafasso > --- As mentioned in another email, I'd like this to be a single change with the return parse_filesystem_walk -> parse_dirent_file rename. >

Re: [Libguestfs] [PATCH 1/4] New API: internal_find_block

2016-09-19 Thread Pino Toscano
On Saturday, 17 September 2016 18:18:53 CEST Matteo Cafasso wrote: > The internal_find_block command searches all entries referring to the > given filesystem data block and returns a tsk_dirent structure > for each of them. > > For filesystems such as NTFS which do not delete the block mapping >

Re: [Libguestfs] [PATCH v6 0/6] New API - find_inode

2016-09-19 Thread Pino Toscano
On Saturday, 17 September 2016 00:04:22 CEST Matteo Cafasso wrote: > This series should be ready for merge > > v6: > > - rebase on master > > - changes according to last comments The series looks much better now -- thanks. I just pushed patches #1 and #2, as they are fine. Regarding patch #3,