On Friday, 16 June 2017 12:26:55 CEST Richard W.M. Jones wrote:
> This just duplicated libosinfo information, and because it was never
> tested it didn't work most of the time.
> ---
lib/osinfo.c is needed for the upcoming virt-builder-repository tool,
so in case we could just move it over there.
On Monday, 19 June 2017 15:31:29 CEST Richard W.M. Jones wrote:
> After the previous refactoring, we are able to link the daemon to
> common/utils, and also remove some of the "duplicate" functions that
> the daemon carried ("duplicate" in quotes because they were often not
> exact duplicates).
>
On Monday, 19 June 2017 17:44:40 CEST Richard W.M. Jones wrote:
> On Mon, Jun 19, 2017 at 05:38:53PM +0200, Pino Toscano wrote:
> > On Monday, 19 June 2017 15:31:26 CEST Richard W.M. Jones wrote:
> > > These won't be used by the daemon, so interferes with us using
> > > common/utils in the daemon,
OK, fixed now. Also the same mistake in daemon/Makefile.am in
the following commit.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
libguestfs lets you edit virtual machines. Supports
On Monday, 19 June 2017 15:31:28 CEST Richard W.M. Jones wrote:
> The reason it's not just ‘utils.h’ is because Pino is worried that we
> might pick up /usr/include/utils.h from a rogue library.
> ---
> diff --git a/python/MANIFEST.in b/python/MANIFEST.in
> index 116367d16..69db7e5ce 100644
> ---
---
daemon/devsparts.c| 21 -
daemon/devsparts.ml | 11 +++
daemon/devsparts.mli | 6 ++
generator/actions_core.ml | 1 +
4 files changed, 14 insertions(+), 25 deletions(-)
diff --git a/daemon/devsparts.c b/daemon/devsparts.c
index
Just a code movement, no change.
---
docs/C_SOURCE_FILES | 1 +
lib/Makefile.am | 1 +
lib/hivex.c | 111 +++
lib/inspect-fs-windows.c | 83 ---
4 files changed, 113 insertions(+), 83
---
daemon/parted.c | 176 +-
daemon/parted.ml | 74 ++-
daemon/parted.mli | 5 ++
generator/actions_core.ml | 3 +
4 files changed, 96 insertions(+), 162 deletions(-)
diff --git a/daemon/parted.c
---
daemon/md.c | 66 ---
daemon/md.ml | 37 ++
daemon/md.mli | 1 +
generator/actions_core.ml | 1 +
generator/daemon.ml | 27 +++
5 files changed, 66 insertions(+),
---
daemon/devsparts.c| 15 ---
daemon/devsparts.ml | 2 ++
daemon/devsparts.mli | 2 ++
generator/actions_core.ml | 1 +
4 files changed, 5 insertions(+), 15 deletions(-)
diff --git a/daemon/devsparts.c b/daemon/devsparts.c
index 1aacb8e16..12e779326 100644
---
On Mon, Jun 19, 2017 at 05:38:53PM +0200, Pino Toscano wrote:
> On Monday, 19 June 2017 15:31:26 CEST Richard W.M. Jones wrote:
> > These won't be used by the daemon, so interferes with us using
> > common/utils in the daemon, so they are moved to a different library.
> > ---
>
> I checked it
Move the list_filesystems API into the daemon, reimplementing it in
OCaml. Since this API makes many other API calls, it runs a lot
faster in the daemon.
---
daemon/Makefile.am| 2 +
daemon/ldm.ml | 3 +
daemon/ldm.mli| 2 +
daemon/listfs.ml | 156
This also reimplements the lv_canonical function in OCaml. We cannot
call the original C function because it calls reply_with_perror which
would break the OCaml bindings.
---
daemon/Makefile.am| 3 +-
daemon/findfs.c | 94 ---
---
.gitignore | 1 +
daemon/Makefile.am | 1 +
generator/OCaml.ml | 8
generator/OCaml.mli | 1 +
generator/daemon.ml | 116 +++-
generator/main.ml | 2 +
6 files changed, 127 insertions(+), 2 deletions(-)
diff --git
Used to handle broken commands like parted, sgdisk which print errors
on stdout.
---
daemon/utils.ml | 19 ++-
daemon/utils.mli | 11 +--
2 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/daemon/utils.ml b/daemon/utils.ml
index 48f6b9c5c..808e575fd 100644
It is sometimes useful to be able to call these from OCaml code.
---
generator/daemon.ml | 23 ++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/generator/daemon.ml b/generator/daemon.ml
index fd01e5d8a..1d7461f8c 100644
--- a/generator/daemon.ml
+++
---
daemon/Makefile.am| 2 ++
daemon/parted.c | 42
daemon/parted.ml | 55 +++
daemon/parted.mli | 19
generator/actions_core.ml | 1 +
5 files changed, 77
---
daemon/Makefile.am| 2 +
daemon/md.c | 125 --
daemon/md.ml | 48 ++
daemon/md.mli | 19 +++
generator/actions_core.ml | 1 +
5 files changed, 101 insertions(+), 94
---
daemon/Makefile.am| 2 ++
daemon/ldm.c | 82 ---
daemon/ldm.ml | 52 ++
daemon/ldm.mli| 20
generator/actions_core.ml | 2 ++
5 files changed, 76 insertions(+),
Some of the oldest and most core APIs, reimplemented.
This also moves the strange ‘mount_vfs_nochroot’ function into
btrfs.c.
---
daemon/Makefile.am| 2 +
daemon/btrfs.c| 43
daemon/daemon.h | 6 ---
daemon/mount.c| 99
---
daemon/Makefile.am| 2 +
daemon/btrfs.c| 175 --
daemon/btrfs.ml | 127 +
daemon/btrfs.mli | 26 +++
generator/actions_core.ml | 2 +
generator/daemon.ml | 5 +-
---
daemon/Makefile.am| 2 +
daemon/realpath.c | 187 --
daemon/realpath.ml| 83
daemon/realpath.mli | 19 +
generator/actions_core.ml | 1 +
5 files changed, 105 insertions(+), 187
---
daemon/Makefile.am| 2 +
daemon/lvm.c | 151 --
daemon/lvm.ml | 92
daemon/lvm.mli| 19 ++
generator/actions_core.ml | 1 +
5 files changed, 114 insertions(+), 151
This also demonstrates usage of optional arguments.
---
daemon/Makefile.am| 2 ++
daemon/is.c | 41 -
daemon/is.ml | 44
daemon/is.mli | 21 +
---
daemon/Makefile.am| 2 ++
daemon/link.c | 16
daemon/link.ml| 25 +
daemon/link.mli | 19 +++
generator/actions_core.ml | 1 +
5 files changed, 47 insertions(+), 16 deletions(-)
diff --git
The previously library-side ‘file_architecture’ API is reimplemented
in the daemon, in OCaml.
There are some significant differences compared to the C
implementation:
- The C code used libmagic. That is replaced by calling the ‘file’
command (because that is simpler than using the library).
This also implements support for String (Mountable, _)
parameters.
---
daemon/Makefile.am| 4
daemon/blkid.c| 6 --
daemon/blkid.ml | 40
daemon/blkid.mli | 19 +++
daemon/mountable.ml
‘file’ is a small, self-contained API which runs a single command, so
it's a good test case for reimplementing APIs.
---
daemon/Makefile.am| 2 ++
daemon/file.c | 80 ---
daemon/file.ml| 60
---
.gitignore | 1 +
daemon/Makefile.am | 43 ++-
daemon/daemon_utils_tests.ml | 48
daemon/dummy.c | 2 ++
docs/C_SOURCE_FILES | 1 +
5 files changed, 94
This just duplicated libosinfo information, and because it was never
tested it didn't work most of the time.
---
docs/C_SOURCE_FILES| 2 -
generator/actions_inspection.ml| 67 ---
generator/actions_inspection_deprecated.ml | 61 +++
inspector/Makefile.am
This change allows parts of the daemon to be written in the OCaml
programming language. I am using the ‘Main Program in C’ method along
with ‘-output-obj’ to create an object file from the OCaml code /
runtime, as described here:
https://caml.inria.fr/pub/docs/manual-ocaml/intfc.html
v6 was posted here:
https://www.redhat.com/archives/libguestfs/2017-June/msg00103.html
and this requires the utilities refactoring posted here:
https://www.redhat.com/archives/libguestfs/2017-June/msg00169.html
Inspection is now complete[*], although not very well tested. I'm
intending to
On Monday, 19 June 2017 15:31:26 CEST Richard W.M. Jones wrote:
> These won't be used by the daemon, so interferes with us using
> common/utils in the daemon, so they are moved to a different library.
> ---
I checked it again, and the daemon does use structs cleanups:
$ cat generator/main.ml
This implements all of:
val int_of_le16 : string -> int64
val le16_of_int : int64 -> string
val int_of_be16 : string -> int64
val be16_of_int : int64 -> string
val int_of_le32 : string -> int64
val le32_of_int : int64 -> string
val int_of_be32 : string -> int64
val be32_of_int : int64 ->
The ‘Progress’ module is a self-contained library with the only
dependencies being:
- the C ‘progress’ implementation
Move it to a separate ‘common/mlprogress’ directory.
This change is pure code refactoring.
---
.gitignore| 1 +
Makefile.am
This refactoring change just moves the cleanup functions around in the
common/utils directory.
libxml2 cleanups are moved to a separate object file, so that we can
still link to libutils even if the main program is not using libxml2
anywhere.
cleanup.c is renamed to cleanups.c.
A new header
After the previous refactoring, we are able to link the daemon to
common/utils, and also remove some of the "duplicate" functions that
the daemon carried ("duplicate" in quotes because they were often not
exact duplicates).
Also this removes the duplicate reimplementation of (most) cleanup
The reason it's not just ‘utils.h’ is because Pino is worried that we
might pick up /usr/include/utils.h from a rogue library.
---
.gitignore | 2 +-
builder/index-validate.c | 2 +-
builder/pxzcat-c.c
Create a module ‘C_utils’ containing functions like ‘drive_name’ and
‘shell_unquote’ which come from the C utilities.
The new directory ‘common/mlutils’ also contains the ‘Unix_utils’
wrappers around POSIX functions missing from the OCaml stdlib.
---
.gitignore |
These won't be used by the daemon, so interferes with us using
common/utils in the daemon, so they are moved to a different library.
---
.gitignore | 8 +++---
Makefile.am | 4 ++-
align/Makefile.am| 2 ++
The ‘Xml’ module is a self-contained library of bindings for libxml2,
with no other dependencies.
Move it to a separate ‘common/mlxml’ directory.
This is not pure refactoring. For unclear reasons, the previous
version of ‘Xml.parse_file’ read the whole file into memory and then
called
The ‘Visit’ module is a self-contained library with the only
dependencies being:
- the C ‘visit’ implementation
- the guestfs OCaml bindings
Move it to a separate ‘common/mlvisit’ directory.
This change is not entirely refactoring. Two other fixes are made:
- remove unsafe use of
Char.mem tells you if a byte is a member of a string.
String.span and String.cspan are like the C functions strspn and
strcspn.
---
common/mlstdutils/std_utils.ml | 27 +++
common/mlstdutils/std_utils.mli | 12
common/mlstdutils/std_utils_tests.ml
This is present in the daemon, but the function could be used
throughout the code.
---
common/utils/cleanups.c | 9 +
common/utils/cleanups.h | 4
2 files changed, 13 insertions(+)
diff --git a/common/utils/cleanups.c b/common/utils/cleanups.c
index c9a34c2ef..47da587bb 100644
---
This was only used inside the library, so move it there.
---
.gitignore | 2 +-
common/utils/Makefile.am | 4 +---
common/utils/guestfs-internal-frontend.h | 12
docs/C_SOURCE_FILES | 2 +-
generator/UEFI.ml
This is just the utilities part of the patch series from:
https://www.redhat.com/archives/libguestfs/2017-June/msg00103.html
I believe this addresses everything raised in comments on that
patch series.
Rich.
___
Libguestfs mailing list
On Fri, Jun 16, 2017 at 03:24:40PM +0200, Pino Toscano wrote:
> On Thursday, 15 June 2017 19:05:54 CEST Richard W.M. Jones wrote:
> > The new module ‘Std_utils’ contains only functions which are pure
> > OCaml and depend only on the OCaml stdlib. Therefore these functions
> > may be used by the
On Mon, Jun 19, 2017 at 10:25:33AM +0200, Pino Toscano wrote:
> On Friday, 16 June 2017 16:58:53 CEST Richard W.M. Jones wrote:
> > On Fri, Jun 16, 2017 at 03:24:55PM +0200, Pino Toscano wrote:
> > > On Thursday, 15 June 2017 19:05:55 CEST Richard W.M. Jones wrote:
> > > > Those cleanups which
On Mon, Jun 19, 2017 at 10:30:47AM +0200, Pino Toscano wrote:
> On Friday, 16 June 2017 17:03:34 CEST Richard W.M. Jones wrote:
> > On Fri, Jun 16, 2017 at 03:42:35PM +0200, Pino Toscano wrote:
> > > NACK to utils.h -- in the past I've seen a couple of libraries
> > > installing public includes as
get_index now gets a new template parameter. Setting it to true will
make the index parsing less picky about missing important data. This
can be used to parse a partial index file.
---
builder/builder.ml | 2 +-
builder/index_parser.ml | 26 ++
virt-builder-repository allows users to easily create or update
a virt-builder source repository out of disk images. The tool can
be run in either interactive or automated mode.
---
.gitignore | 3 +
builder/Makefile.am | 84 +-
In order to further reuse the osinfo database parsing in OCAML, this
commit extracts the XML processing for the distro ISOs and places it
into a newly created callback.
This will later help other code to traverse the osinfo DB files and
let them extract what they need from them.
---
lib/osinfo.c
Add a function to properly write virt-builder source index entries.
Note that this function is very similar to Index.print_entry that is
meant for debugging purposes.
---
.gitignore| 1 +
builder/Makefile.am | 36 +++-
builder/index.mli | 3 +
This function will allow more OCaml-ish processing of XPath queries
with multiple results.
---
mllib/xpath_helpers.ml | 9 +
mllib/xpath_helpers.mli | 4
2 files changed, 13 insertions(+)
diff --git a/mllib/xpath_helpers.ml b/mllib/xpath_helpers.ml
index d651fab23..c66a21c44 100644
Provide osinfo database parsing API in OCaml.
---
lib/osinfo.c | 39 +
mllib/Makefile.am | 11 --
mllib/osinfo-c.c | 103 ++
mllib/osinfo.ml | 26 ++
mllib/osinfo.mli | 31
5
---
mllib/common_utils.ml | 6 ++
mllib/common_utils.mli | 3 +++
2 files changed, 9 insertions(+)
diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml
index 6a9b08973..8ed7c7554 100644
--- a/mllib/common_utils.ml
+++ b/mllib/common_utils.ml
@@ -1188,3 +1188,9 @@ let inspect_decrypt g
Rename test-virt-builder-docs.sh into test-docs.sh to include test
for another tool's documentation.
---
builder/Makefile.am | 4 ++--
builder/{test-virt-builder-docs.sh => test-docs.sh} | 0
2 files changed, 2 insertions(+), 2 deletions(-)
rename
Hi all,
Here is an update of the series fixing Pino's latest comment.
It just doesn't implement the change based on never-accepted
run commands patch.
Cédric Bosdonnat (9):
lib/osinfo.c: Extract xml processing into a callback
lib: extract osinfo DB traversing API
mllib: ocaml wrapper for
Split lib/osinfo.c to provide an API for other pieces of code (namely
mllib) to reuse it. The ISO-related processing is thus moved into a
lib/osinfo-iso.c file.
---
lib/Makefile.am | 2 +
lib/osinfo-iso.c | 462 +++
lib/osinfo.c | 420
On Friday, 16 June 2017 17:03:34 CEST Richard W.M. Jones wrote:
> On Fri, Jun 16, 2017 at 03:42:35PM +0200, Pino Toscano wrote:
> > NACK to utils.h -- in the past I've seen a couple of libraries
> > installing public includes as utils.h. They have been fixed, but
> > I'd like to avoid conflicts
On Friday, 16 June 2017 16:58:53 CEST Richard W.M. Jones wrote:
> On Fri, Jun 16, 2017 at 03:24:55PM +0200, Pino Toscano wrote:
> > On Thursday, 15 June 2017 19:05:55 CEST Richard W.M. Jones wrote:
> > > Those cleanups which only depend on libc, gnulib or libxml2 are split
> > > out into a
61 matches
Mail list logo