249 Commits

Author SHA1 Message Date
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
e9eaf4d889 docs: Split release notes by release.
See analogous change in nbdkit for the rationale:

98395d6f7a
2019-11-13 12:49:54 +00:00
Richard W.M. Jones
8097dc16e7 Version 1.41.6. 2019-10-15 13:34:40 +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
Richard W.M. Jones
0977f4b909 v2v: xen: Replace qemu block ssh driver with nbdkit-ssh-plugin.
Initially this is a like-for-like replacement, but in future commits
this will allow us to implement:

 - password authentication (instead of SSH agent)

 - bandwidth throttling

 - readahead

Note this requires nbdkit >= 1.12.
2019-10-08 13:15:10 +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
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
Richard W.M. Jones
2a5ea2892e Version 1.41.1. 2019-09-02 10:12:38 +01:00
Richard W.M. Jones
c873e04b26 Update docs/C_SOURCE_FILES. 2019-08-20 16:11:49 +01:00
Richard W.M. Jones
ab09bc25c7 build: Update miscellaneous files.
BUGS
docs/C_SOURCE_FILES
po/POTFILES
po/POTFILES-ml

These files are normally updated by ‘make dist’ but as we've not had a
release in a while they had not been updated for some time.
2019-07-29 12:57:24 +01:00
Pino Toscano
fe96e24001 p2v: generate C about data authors from AUTHORS file
Create a small Perl script to generate about-authors.c from the p2v
AUTHORS file at build time, instead of generating in the generator
at dist time.
2019-07-03 12:41:02 +02:00
Pino Toscano
796ce74f31 p2v: move kernel config to perl script
Instead of generating the p2v kernel config using the OCaml generator,
create a Perl script to do this job, mostly at build time.  This is done
to rely less on the generator for p2v, and because the generation of
these sources is quick enough that it can be done at build time (instead
of shipping the generated sources in dist tarballs).

The generate-p2v-config.pl mimics what generator/p2v_config.ml --
namings, and general structure are kept close to that for comparison.

The two C sources are created at build time by the script; however, the
p2v-config.h header is generated at configure time: this is done because
p2v-config.h is included by p2v.h (another header), which in turn is
included by all the p2v C sources -- automake is not able to properly
resolve the dependency, and thus it would not be generated properly.
2019-07-01 13:58:13 +02:00
Pino Toscano
31d72dc463 build: raise augeas requirement to 1.2.0
It is widely available also on older distributions.
2019-05-30 09:12:32 +02:00
Pino Toscano
a871f6c251 v2v: switch to ocaml-libvirt
Currently virt-v2v has few custom C-based functions for libvirt
operations, which are limited in what they do, and there is a lot of
duplicated code.

Instead, switch to ocaml-libvirt for all the libvirt interaction
currently done by the Libvirt_utils module.  This has few advantages:
- each input & output module now opens a libvirt connection only once,
  only when needed
- no need to pass URIs and passwords around, if not needed
- a wider range of libvirt APIs can now be used, with no need to create
  bindings manually

The hierarchy of input_libvirt* classes is changed to take a Lazy object
with the libvirt connection, accessing it through a "proctected" method:
this way, the connection is opened only at the first access.
Also, the Libvirt_utils module now is just helpers around the Libvirt
module, to centralize error handling, and few common operations.
2019-05-20 13:40:19 +02:00
Corentin Noël
4f96e823d3 gobject: Add Vala binding support
RWMJ: Add optional dependency on vala to the docs.
2019-01-23 13:05:59 +00:00
Richard W.M. Jones
1db0140428 docs: Finalize release notes for 1.40.
Updates commit 0ce8ecdf66.
2019-01-15 14:44:16 +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
0ce8ecdf66 Update release notes for 1.40 release. 2019-01-07 20:03:40 +00:00
Richard W.M. Jones
6d5959a045 common/utils: Move libxml2 writer macros to a common header file.
In some places when generating XML output in C code we use some clever
macros:

  start_element ("memory") {
    attribute ("unit", "MiB");
    string_format ("%d", g->memsize);
  } end_element ();

This commit which is mostly refactoring moves the repeated definitions
of these macros into a common header file.

I also took this opportunity to change / clean up the macros:

 - The macros are now documented properly.

 - comment() and empty_element() macros are now available everywhere.

 - Error handling has been made generic.

 - Added do..while(0) around some of the macros to make them safe to
   use in all contexts.
2018-11-02 15:15:04 +00:00
Richard W.M. Jones
970dccf147 docs: Allow enhanced comments for macros (ie. #define). 2018-11-02 13:44:26 +00:00
Richard W.M. Jones
38f688b8b5 build: Rebuild docs/C_SOURCE_FILES and po/POTFILES.
Remove:

common/utils/libxml2-utils.c
common/utils/libxml2-utils.h

These were accidentally added by
commit a63d02f8f1 because of a bad
interactive rebase.
2018-08-22 15:28:50 +01:00
Richard W.M. Jones
a63d02f8f1 mltools: JSON: Rename Yajl module as JSON_parser and move to common/mltools.
Commit bd1c5c9f4d changed all the code
to use Jansson instead of yajl.  However it didn't change the OCaml
module name (still Yajl).

This commit changes the module to a neutral name ("JSON_parser") and
moves it into common/mltools so it can be used by other tools.

This leaves us in a slightly awkward situation of having two JSON-ish
OCaml modules (JSON for creating trees and JSON_parser for parsing
them) with incompatible types.  That is left for future work to
resolve.  (It should be easier to do now that both modules live in the
same directory.)

This is just renaming and general refactoring.  There should be no
change in functionality.
2018-08-22 15:18:57 +01:00
Richard W.M. Jones
040cb93717 Version 1.39.8. 2018-07-27 12:06:04 +01:00
Richard W.M. Jones
264f7ae9dd docs: building: autotools and gettext must be installed separately.
Thanks: Nir Soffer
2018-06-25 08:48:21 +01:00
Richard W.M. Jones
a4d5548a45 docs: security: Document CVE-2018-11806.
Qemu: slirp: heap buffer overflow while reassembling fragmented
datagrams.
2018-06-06 11:02:19 +01:00
Pino Toscano
aa078b362e Update documentation/translation file indexes
Followup of commits cc04573927, and
commit d00e860ef0.
2018-04-20 13:04:29 +02:00
Richard W.M. Jones
55b347d71c Version 1.39.1. 2018-03-13 12:17:28 +00:00
Yuri Chornoivan
5f8bba5d52 docs: Fix typo in man page. 2018-02-23 09:54:08 +00:00
Pino Toscano
eb4fbe96c9 build: mandate Jansson >= 2.7
Since we use APIs added in Jansson 2.7 (e.g. json_string_length), then
raise the minimum version required to that version.

Fixes commit bd1c5c9f4d.
2018-02-13 13:07:22 +01:00
Pino Toscano
bd1c5c9f4d Switch from YAJL to Jansson
While YAJL mostly works fine, it did not see any active development in
the last 3 years.  OTOH, Jansson is another JSON C implementation, with
a very liberal license, and a much nicer API.

Hence, switch all of libguestfs from YAJL to Jansson:
- configure checks, and buildsystem in general
- packages pulled in the appliance
- actual implementations
- contrib scripts
- documentation

This also makes use of the better APIs available (e.g. json_object_get,
json_array_foreach, and json_object_foreach).  This does not change the
API of our OCaml Yajl module.
2018-02-12 11:24:06 +01:00
Richard W.M. Jones
ed1c8fcfd7 docs: Finalize release notes for 1.38. 2018-02-09 09:39:00 +00:00
Yuri Chornoivan
7e4f03d2c2 Fix minor typos 2018-02-08 13:20:34 +01:00
Richard W.M. Jones
b10aa60d54 docs: Remove or correct links to virt-tools.org.
Unfortunately I wasn't able to find a good reference for checking if
your hardware virt is enabled.

Thanks: Yuri Chornoivan
2018-02-07 14:49:25 +00:00
Richard W.M. Jones
900cdc9d8e docs: release notes: Hivex 1.3.14 is _not_ required. 2018-02-07 13:26:23 +00:00
Pino Toscano
82fbf294fd daemon: build also without Hivex.OPEN_UNSAFE (RHBZ#1493048)
Do a configure check for the OPEN_UNSAFE flag in the OCaml binding of
Hivex, using it only when available.  This makes it possible to use
hivex < 1.3.14 to build libguestfs (the daemon, actually).

Amend the building documentation accordingly, bringing the minimum
version of hivex back as it was before
commit 64f49df747.
2018-02-06 17:27:23 +01:00
Richard W.M. Jones
ee36f582d4 docs: Update release notes for 1.38 release. 2018-02-06 13:27:45 +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
e25a54f5bf docs: building: OCaml >= 4.01 is required (not 4.02).
Fix incorrect version number in the manual.

Fixes commit 2cdd2eb795.
2017-10-10 12:13:36 +01:00
Richard W.M. Jones
fbf044a11c m4: Rename guestfs_*.m4 to guestfs-*.m4.
For consistency with other code.
2017-10-06 14:36:16 +01:00
Richard W.M. Jones
2cdd2eb795 build: Require OCaml >= 4.01.
RHEL 6, Debian <= 7 and Ubuntu < 14.04 are no longer supported
(unless OCaml and other components are upgraded).

See: https://www.redhat.com/archives/libguestfs/2017-September/msg00203.html
2017-10-05 11:32:54 +01:00
Richard W.M. Jones
bbd54295d3 daemon: Reimplement statvfs API in OCaml, drop gnulib fallback.
common/mlutils: Unix_utils.StatVFS.statvfs: This commit implements a
full-featured binding for the statvfs(3) function.

We then use this to reimplement the daemon statvfs API in OCaml.

Note that the Gnulib fallback is dropped in this commit.  It
previously referenced non-existent field names in the fs_usage struct
so it didn't work.  Also it's not necessary as POSIX has supported
statvfs(3) since 2001, it's supported in *BSD, macOS > 10.4, and there
is already a Windows fallback.
2017-10-04 15:25:32 +01:00
Richard W.M. Jones
cd304ad838 common/mltools: Rename Common_utils to Tools_utils.
Reflecting the purpose of this module now, which is to act as a place
for utility functions shared only by the OCaml virt tools.
2017-09-28 14:39:23 +01: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
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
Pino Toscano
531316cc3f build: improve and simplify distro detection
Add a --with-distro=ID argument for configure, so it is possible to
manually specify the distro to use for the packages (in case os-release
does not provide ID=.., or the ID is not recognized yet).

In the case when --with-distro is not set, keep doing the autodetection,
but using os-release only, i.e. dropping the checks for all the other
-release files -- since there is --with-distro, older distros with no
os-release can still be used.

RWMJ: Add documentation to guestfs-building(1).
2017-09-25 14:49:17 +01:00
Richard W.M. Jones
41df9aaf90 lib: Move guestfs_int_download_to_tmp and remove inspect.c.
Move the last remaining function ‘guestfs_int_download_to_tmp’ to
lib/inspect-icon.c (the main, but not only user of this function).
Then remove lib/inspect.c entirely.

This is not quite code motion because I updated the comment for the
function to reflect what it does in reality.
2017-09-21 18:05:07 +01:00
Richard W.M. Jones
64f49df747 docs: hivex >= 1.3.14 is required (RHBZ#1493048).
Bug reported by Jean-Christophe Manciot.
2017-09-20 17:57:47 +01:00
Richard W.M. Jones
3a00c4d179 Remove inspection from the C library and switch to daemon/OCaml implementation. 2017-09-16 22:27:16 +01:00