Commit Graph

489 Commits

Author SHA1 Message Date
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
Richard W.M. Jones
b702ec19e8 contrib: p2v: Add scripts to build and test virt-p2v ISOs with RHEL 5, 6.
This adds a contrib script which can be used to build the virt-p2v ISO
on top of RHEL 5 or RHEL 6, i686 (32 bit) or x86-64 (64 bit) base.

There is also a script for testing the ISOs produced this way.
2017-02-09 17:52:45 +00:00
Richard W.M. Jones
c9a51b2fd2 po: Really ignore perl/lib/Sys/Guestfs.c (RHBZ#1417444).
Incorrect grep expression meant this file was not being ignored
before.

Thanks: Marius Cirsta
2017-01-29 13:34:03 +00:00
Richard W.M. Jones
8ee97b8859 p2v: Move miniexpect library to common/miniexpect.
No change, just code motion.
2017-01-26 15:05:47 +00:00
Richard W.M. Jones
db48870cf3 df: Move framework for processing domains in parallel to common/parallel.
Just code motion.
2017-01-26 15:05:47 +00:00
Richard W.M. Jones
a8c5739fd2 fish: Move edit, progress, windows under common/
Three more pieces of common code are moved under the common/
subdirectory.  This is just code motion.

Note that windows.[ch] wasn't even being used by guestfish.  That code
was only used in other virt tools.
2017-01-26 15:05:47 +00:00
Richard W.M. Jones
a9199a46b1 fish: Move fishcommon library to common/options.
This is mostly code motion but:

(1) I had to remove the compile-time COMPILING_GUESTFISH and
COMPILING_VIRT_RESCUE macros and replace them with runtime constants
and checks.

(2) I moved the fish/config.c file into this library.
2017-01-26 15:05:47 +00:00
Richard W.M. Jones
779bc1de23 cat: Move visit library to new directory common/visit.
Just code motion.
2017-01-26 15:05:46 +00:00
Richard W.M. Jones
f161c9ea57 Rename src/ to lib/ 2017-01-26 15:05:46 +00:00
Richard W.M. Jones
b53cec584d lib: Move utilities to new directory common/utils.
Just code motion.

This commit makes it clearer what is a utility and what is part of the
library.  It also makes it clear that we should rename:

  guestfs-internal-frontend.h -> utils.h
  guestfs-internal-frontend-cleanups.h -> cleanups.h (?)

but this commit does not make that change.
2017-01-26 15:05:46 +00:00
Richard W.M. Jones
88c0ce2397 lib: Share common protocol and errnostring libraries with the library and daemon.
This commit, which is just code motion, moves the common XDR protocol
code (libprotocol) and the common errno handling (liberrnostring) into
libraries which are each built once and shared between the library and
daemon.
2017-01-26 15:05:46 +00:00
Pino Toscano
55bf7de97c Update copyright dates for 2017
Run the following command over the source:

  perl -pi.bak -e 's/(20[01][0-9])-2016/$1-2017/g' `git ls-files`

(Thanks Rich for the perl snippet, as used in past years.)
2017-01-03 16:48:21 +01:00
Richard W.M. Jones
8f32e5d67e builder: Fix copying of virt-builder index.asc etc to website.
The definition of BUILDFILES was accidentally removed, resulting
in the error:

  cp  /home/rjones/d/websites/libguestfs/download/builder/
  cp: missing destination file operand after '/home/rjones/d/websites/libguestfs/download/builder/'

Fixes commit 65a0570385.
2016-12-11 18:23:11 +00:00
Richard W.M. Jones
2e7aecd1ad builder: Don't try to translate make-template.ml.
It fails with:

  File "../builder/templates/make-template.ml", line 1, characters 0-1:
  Parse error: [a_LIDENT] expected after "#" (in [implem])
  End_of_file
  An error occurs while processing.

In any case this doesn't matter because this file should not be
translated.

Fixes commit a1ea9a2599.
2016-12-10 16:20:34 +00:00
Richard W.M. Jones
546fd23504 builder: Add website/download/builder/* files to EXTRA_DIST.
Fixes commit 65a0570385.
2016-12-10 15:37:29 +00:00
Richard W.M. Jones
65a0570385 builder: Rearrange how template-building scripts work.
Create a new directory (builder/template).  Integrate all of the
scripts into a single program, so that templates are generated more
consistently.

This also changes how the index file is generated.  The script now
generates the index file fragment and saves it under version control,
and then generates the final index file by concatenating these.
(Previously the index was written by hand which was tedious and
error-prone.)

The new script also saves the generated kickstart under version
control so it can be referenced later.
2016-11-30 14:20:20 +00:00
Richard W.M. Jones
e73763de1f docs: Ignore ruby/ext/guestfs/extconf.h
Updates commit bd21993d77.
2016-10-25 22:30:30 +01:00
Richard W.M. Jones
67cc867da8 docs: Ignore php/extension/config.h.
Updates commit bd21993d77.
2016-10-25 21:59:19 +01:00