Commit Graph

456 Commits

Author SHA1 Message Date
Pino Toscano
957549cd2d Remove mlaugeas and mllibvirt leftovers
Update according to the removal of the embedded copies of augeas-ocaml,
and libvirt-ocaml from the common submodule.
2019-12-16 18:55:01 +01:00
Pino Toscano
fb7e21be96 build: switch embedded copy of ocaml-augeas
Use the newer copy shipped locally as bundled, instead of the one in
the common submodule, as the latter copy will go away soon.
2019-12-16 18:33:49 +01:00
Richard W.M. Jones
58ab39ba34 Remove boot and qemu analysis tools into a separate project.
These have now moved here:
https://github.com/libguestfs/libguestfs-analysis-tools

This commit removes them and updates guestfs-performance(1) to point
to the new location.
2019-11-28 15:37:31 +00:00
Pino Toscano
08481e05d0 build: ignore unused submodules
Do not build the mlv2v, and mllibvirt submodules, as they are not used.
2019-11-28 13:09:21 +01:00
Richard W.M. Jones
85c99edec1 v2v: Remove virt-v2v.
It has moved to a new repository:
https://github.com/libguestfs/virt-v2v
2019-11-13 12:49:55 +00:00
Richard W.M. Jones
8097dc16e7 Version 1.41.6. 2019-10-15 13:34:40 +01:00
Richard W.M. Jones
8f3210c875 Replace common/ with git submodule.
This directory contains code which is shared between libguestfs and
the tools.  It now points to a new repository:

https://github.com/libguestfs/libguestfs-common
2019-10-15 13:34:39 +01:00
Richard W.M. Jones
20c2dfbe00 generator, customize, v2v: Only place generated files in libguestfs or common.
After the proposed split of the libguestfs repo, we will end up with
the following layout:

  libguestfs.git
      common -> git submodule libguestfs-common.git
      generator

  virt-v2v.git
      common -> git submodule libguestfs-common.git

  guestfs-tools.git
      common -> git submodule libguestfs-common.git

The generator will only be able to write to libguestfs directories and
the common directory/submodule.  This is mostly the case already with
only 6 exceptions:

  customize/customize-options.pod
  customize/customize-synopsis.pod
  customize/customize_cmdline.ml
  customize/customize_cmdline.mli
  v2v/uefi.ml
  v2v/uefi.mli

This commit moves these files around so they appear under common/ml*

It is somewhat unsatisfactory because it involves copying files
around, but there are some mitigating factors:

(1) Any changes now give us more freedom to develop faster and thus
clean things up in future.

(2) The v2v/uefi files ought to go away in future anyway.

This is simple code motion and should have no effect on the built
programs or tests.
2019-10-14 18:37:29 +01:00
Richard W.M. Jones
ddfec6a97d customize: Move Firstboot and SELinux_relabel modules to common/mlcustomize.
These two modules are a dependency of virt-v2v.  Since we intend to
split virt-v2v from the other OCaml virt-* programs, we cannot have a
dependency between virt-v2v and virt-customize.  Instead we must move
the modules to a common directory (common/mlcustomize) and have both
tools depending on the modules from there.

This is simple refactoring and should not affect how the programs work
or are tested.
2019-10-14 12:36:47 +01:00
Martin Kletzander
da71714a9a build: Move po subdir after everything else except po-docs
Otherwise it complains about missing files that it has no rules for, for example
`builder/index-parser.c`.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2019-09-20 10:01:16 +01:00
Pino Toscano
dea9636c59 Remove remaining virt-p2v bits
Remove (almost) all the remaining bits related to virt-p2v.
2019-09-10 17:52:16 +02:00
Pino Toscano
2c02adb8ba Remove virt-p2v
This removes only the tool itself, and all the bits strictly needed to
not break the build.

This is now available as separate tool in its own repository:
https://github.com/libguestfs/virt-p2v
2019-09-10 17:52:16 +02:00
Richard W.M. Jones
cce016dfe3 docs: Remove p2v/ directory from generated docs files.
make[2]: *** No rule to make target '../p2v/about-authors.c', needed by 'internal-documentation.pod'.  Stop.

Since we're going to remove the whole p2v subdirectory shortly anyway,
it was simplest to ignore the whole directory.
2019-09-02 12:34:07 +01:00
Richard W.M. Jones
0d0c3eb1dd docs: Remove generated file common/mllibvirt/libvirt_c.c.
Avoids this error when building from git:

make[2]: *** No rule to make target '../common/mllibvirt/libvirt_c.c', needed by 'internal-documentation.pod'.  Stop.

This file doesn't have any generated docs or gettext annotations in it
so adding it to these files is useless anyway.
2019-09-02 12:22:25 +01:00
Hiroyuki_Katsura
3bbd00c83e Rust bindings: Add Rust bindings
This patch includes Actions and their tests. Missing:

- Events
- Examples

Rust bindings: Add create / close functions

Rust bindings: Add 4 bindings tests

Rust bindings: Add generator of structs

Rust bindings: Add generator of structs for optional arguments

Rust bindings: Add generator of function signatures

Rust bindings: Complete actions

Rust bindings: Fix memory management

Rust bindings: Add bindtests

Rust bindings: Add additional 4 bindings tests

Rust bindings: Format test files

Rust bindings: Incorporate bindings to build system
2019-07-29 10:28:31 +01:00
Pino Toscano
498f940419 contrib: move p2v files within p2v 2019-07-03 12:41:02 +02:00
Pino Toscano
5c4bd181b6 v2v: test-harness: stop using the external ocaml-libvirt
Use the embedded copy.
2019-05-20 13:40:19 +02:00
Pino Toscano
99493eeddd common: Bundle the libvirt-ocaml library for use by virt-v2v
Add a copy of the libvirt-ocaml library, currently available at:
  https://libvirt.org/git/?p=libvirt-ocaml.git;a=summary
This is a snapshot at commit d3ed8dcf1b0a6a8a855ceecbe0bb97f21e6665e3,
which has all the features we need (and that builds fine).
It is expected to stay synchronized with upstream, until there is a new
upstream release, and it will be widespread enough.
2019-05-20 13:32:59 +02:00
Pino Toscano
c0d95dcde8 v2v: require libvirt
While there are input modes that do not use libvirt, making libvirt
mandatory for virt-v2v slightly simplifies the code now, and allow for
further improvements/integration with libvirt later on.
2019-05-20 13:30:23 +02:00
Richard W.M. Jones
61b86bac2e v2v: -o rhv-upload: Allow configure to set the nbdkit Python version.
No functional change, but it does allow downstream distributions to
adjust the nbdkit Python plugin used by virt-v2v -o rhv-upload mode:

./configure --with-virt-v2v-nbdkit-python-plugin=...
2019-01-16 11:57:57 +00:00
Richard W.M. Jones
05d4fcb64d Update copyright dates for 2019.
This command run over the source:

perl -pi.bak -e 's/(20[01][0-9])-2018/$1-2019/g' `git ls-files`
2019-01-08 11:58:30 +00:00
Richard W.M. Jones
e515352f84 utils: Add utility to find maximum number of virtio-scsi disks.
This is an evolution of a Perl script that I originally wrote for this
bug:

https://bugzilla.redhat.com/show_bug.cgi?id=1478201
2018-04-20 15:25:20 +01:00
Richard W.M. Jones
dc44de5e23 authors: Add a list of aliases.
This handles the case where a single author has multiple different
names in the git commit history.
2018-02-09 09:39:00 +00:00
Richard W.M. Jones
212762c593 Update copyright dates for 2018.
Run the following command over the source:

  perl -pi.bak -e 's/(20[01][0-9])-2017/$1-2018/g' `git ls-files`
2018-01-04 15:30:10 +00:00
Richard W.M. Jones
80fa8a91e3 Rename mllib -> common/mltools.
This directory which previously contained random modules and functions
now has an official purpose: to be the place for any OCaml utility
needed by the OCaml virt tools.

This is just code movement, I didn't (yet) rename or move any of the
modules.
2017-09-28 14:39:23 +01:00
Richard W.M. Jones
abf43c40ca po: Add common/ml* directories to POTFILES-ml.
Although it's not too likely that these libraries will contain
translatable strings, it's consistent to add them to po/POTFILES-ml
because mllib/*.ml are also in this file.
2017-09-28 14:39:23 +01:00
Richard W.M. Jones
2b00983f23 common/mlgettext: Move common_gettext.ml{,i} to common/mlgettext.
Mostly just code motion, but common_gettext.mli was the same whether
or not ocaml-gettext exists, so instead of generating it, add the file
to git.
2017-09-28 14:39:22 +01:00
Richard W.M. Jones
d38fcf280a tests: Check that every *.ml file has a corresponding *.mli file.
This is so that we can finally express OCaml dependencies correctly.
2017-09-21 18:05:07 +01:00
Richard W.M. Jones
2ffb8a6b25 common: Bundle the ocaml-augeas library for use by the daemon.
This commit bundles the ocaml-augeas library (upstream here:
http://git.annexia.org/?p=ocaml-augeas.git;a=summary).  It's identical
to the upstream version and should remain so.

We can work towards using system ocaml-augeas, when it's more widely
available.
2017-09-16 22:27:16 +01:00
Richard W.M. Jones
38359eaf3e daemon: Restore PCRE regular expressions in OCaml code.
When parts of the daemon were previously converted to OCaml, the
previous PCRE regexps were converted to Str regexps.  Restore the
original PCRE regexps.

There was also one case where an original call to glob(3) was replaced
by a Str regexp, and this is replaced by a PCRE regexp (although it is
in fact identical in this instance).

This updates commit b48da89dd6
and commit eeda6edca1
and commit 2ca0fa778d.
2017-08-03 17:36:09 +01:00
Richard W.M. Jones
f33db99edf common: Add a lightweight OCaml binding for PCRE.
This uses the gnulib TLS macros.
2017-08-03 17:36:09 +01:00
Richard W.M. Jones
d5b6f1df5f daemon: Allow parts of the daemon and APIs to be written in OCaml.
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

Furthermore, change the generator to allow individual APIs to be
implemented in OCaml.  This is picked by setting:

  impl = OCaml <ocaml_function>;

The generator creates ‘do_function’ (the same one you would have to
write by hand in C), with the function calling the named
‘ocaml_function’ and dealing with marshalling/unmarshalling the OCaml
parameters.
2017-07-27 22:31:22 +01:00
Richard W.M. Jones
f5f7f00a46 gobject: Remove gtk-doc (RHBZ#1465665).
The gobject bindings are adequately covered in the usual manual pages:
guestfs(3).  There is no need for separate generation of gtk-doc.
Also generating gtk documentation is the slowest part of the build,
and the tooling around gtk-doc is broken
(https://bugzilla.redhat.com/show_bug.cgi?id=1465665).

Note this removes the configure ‘--enable-gtk-doc’ option.  Using this
option now gives a warning, but is otherwise ignored:

  configure: WARNING: unrecognized options: --enable-gtk-doc
2017-07-10 17:03:19 +01:00
Richard W.M. Jones
8be72935dc mllib, v2v: Split out OCaml utils bindings ‘common/mlutils’.
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.
2017-07-10 17:01:59 +01:00
Richard W.M. Jones
5efebd8c7e utils: Split out structs cleanups and printing into common/structs.
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.
2017-07-10 17:01:59 +01:00
Richard W.M. Jones
61d4891ef4 mllib: Split ‘Common_utils’ into ‘Std_utils’ + ‘Common_utils’.
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 generator.

The new module is moved to ‘common/mlstdutils’.

This also removes the "<stdlib>" hack, and the code which copied the
library around.

Also ‘Guestfs_config’, ‘Libdir’ and ‘StringMap’ modules are moved
since these are essentially the same.

The bulk of this change is just updating files which use
‘open Common_utils’ to add ‘open Std_utils’ where necessary.
2017-07-10 17:01:59 +01:00
Richard W.M. Jones
989292c146 mllib: Move Xml (libxml2) OCaml bindings to common/mlxml.
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 ‘xmlReadMemory’.  This was quite inefficient, and unnecessary
because we could use ‘xmlReadFile’ to read and parse the file
efficiently.  Changing the code to use ‘xmlReadFile’ also removes the
unnecessary dependency on ‘Common_utils.read_whole_file’.
2017-07-10 17:01:59 +01:00
Richard W.M. Jones
9254c8f152 mllib: Move Progress OCaml bindings to common/mlprogress.
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.
2017-07-10 17:01:59 +01:00
Richard W.M. Jones
746a87cbf8 mllib: Move Visit OCaml bindings to common/mlvisit.
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 CLEANUP_FREE from a function which could
   raise an OCaml exception (cleanup handlers would not be called
   correctly if the exception is thrown)

 - don't link directly to common/visit/visit.c, but instead use
   the library (common/visit/libvisit.la)
2017-07-10 17:01:59 +01:00
Richard W.M. Jones
cfab7e122b configure: Fix the release date so that it's impossible to forget about.
Add a RELEASES file which contains the release date for each version
of libguestfs.  When a new version is released, the configure script
checks that the date has not been omitted from the file.

This also fixes the release date for version 1.37.16 which I omitted
from commit 9455f21237.
2017-06-23 15:02:19 +01:00
Richard W.M. Jones
f861c13855 maintainer: Unset LC_ALL before running Python script to list bugs.
Gnulib installs two files: ‘GNUmakefile’ and ‘maint.mk’.  The first
one runs the second one, and the second one sets LC_ALL=C universally.

However this breaks the ‘bugzilla’ script (or Python) because some
bugs contain non-ASCII characters in their Summary.  The script prints
this error:

  Traceback (most recent call last):
    File "/usr/bin/bugzilla", line 1117, in <module>
      main()
    File "/usr/bin/bugzilla", line 1112, in main
      _format_output(bz, opt, buglist)
    File "/usr/bin/bugzilla", line 702, in _format_output
      print(format_field_re.sub(bug_field, opt.outputformat))
  UnicodeEncodeError: 'ascii' codec can't encode characters in position 108-109: ordinal not in range(128)

The simplest fix for this is to unset LC_ALL before running the
external script, so that the normal locale settings are used.
2017-06-22 14:32:26 +01:00
Richard W.M. Jones
13cc6faedb maintainer: New layout of libguestfs website. 2017-06-21 22:23:12 +01:00
Richard W.M. Jones
581c4bcc1d common: Add a simple mini-library for handling qemu command and config files. 2017-05-08 11:14:46 +01:00
Matteo Cafasso
f3d3136a17 yara_scan: added API tests
Signed-off-by: Matteo Cafasso <noxdafox@gmail.com>
2017-05-02 13:42:29 +01:00
Richard W.M. Jones
5a4b72122b dist: Add AUTHORS to EXTRA_DIST and remove from dist-hook.
It's a normal file now and can be distributed in the usual way.

Fixes commit 34755dd86a.
2017-03-25 18:30:28 +00:00
Richard W.M. Jones
34755dd86a generator, p2v: Generate AUTHORS and p2v/about-authors.c from a single place.
This also improves the "Credits" box in virt-p2v.  With Gtk >= 3.4
this can now show all contributors organized by the nature of their
contribution.
2017-03-25 14:04:44 +00:00
Richard W.M. Jones
80d3e05483 tests: Add infrastructure for running certain tests as root.
'[sudo] make check-root' is analogous to 'make check-slow'.
2017-03-13 15:01:12 +00:00
Richard W.M. Jones
51a703775c tests: Rename test-data/test-utils.sh -> tests/test-functions.sh.
This is pure code motion.
2017-02-21 17:23:22 +00:00
Richard W.M. Jones
e46b07ca1b docs/C_SOURCE_FILES, po/POTFILES: Remove duplicate files.
Because v2v/test-harness is a subdirectory of v2v, and because both
paths are listed in $(DIST_SUBDIRS), using find $(DIST_SUBDIRS) will
list files in v2v/test-harness twice.  (This probably happens in other
directories too, but I noticed it here.)  The easiest fix for this is
simply to use 'sort -u' to remove the duplicates.
2017-02-15 15:05:47 +00:00
Richard W.M. Jones
3a8e2babed contrib: Sort patches into alphabetical order and add to EXTRA_DIST.
We also have to use AM_INIT_AUTOMAKE(tar-pax), since otherwise
automake uses some ancient tar format that doesn't support a filename
this long.  (See: https://noiselabs.io/2010/02/27/tar-file-name-is-too-long-max-99/
for a clear explanation)

Fixes commit b702ec19e8.
2017-02-10 13:08:03 +00:00