9481 Commits

Author SHA1 Message Date
Richard W.M. Jones
2c3b829bd8 Version 1.35.0. v1.35.0 2016-08-08 13:46:24 +01:00
Richard W.M. Jones
4c84033d8c Version 1.34.0. v1.34.0 2016-08-08 12:49:58 +01:00
Richard W.M. Jones
f4e4a668ae Update website for 1.34 release. 2016-08-08 12:37:25 +01:00
Richard W.M. Jones
4ad5652c99 Update release notes.
Also remove "draft" logo since these are close to being finalized
for the 1.34 release.
2016-08-08 12:31:15 +01:00
Tomáš Golembiovský
4ddc0add85 v2v: fix regex replacement in grub2_update_console
The replacement string was wrong. There are only two match groups in the
regular expression, not three.

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
2016-08-08 11:00:15 +02:00
Tomáš Golembiovský
56e5cf14e9 v2v: do not hide the error, rather report it
The Invalid_argument exception is there to catch unexpected situation
when rpm returns no output. Such situation should be reported rather
then hidden.

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
2016-08-05 18:09:10 +02:00
Pino Toscano
34c7215a2f ruby: ignore -Wshift-overflow warnings
There seems to be a -Wshift-overflow bug in a Ruby 2.3 header, so
add a GCC diagnostic override to avoid build failures with
--enable-werror.
2016-08-05 18:09:10 +02:00
Richard W.M. Jones
71de3d49a3 sparsify: Add a regression test for RHBZ#1364347.
Add a regression test for the previous commit.
2016-08-05 15:10:50 +01:00
Richard W.M. Jones
4d5335a56d sparsify: Warn instead of error if a filesystem cannot be fstrimmed (RHBZ#1364347).
Thanks:  Xianghua Chen
2016-08-05 15:10:50 +01:00
Richard W.M. Jones
116a41d048 daemon: fstrim: Turn "discard operation is not supported" into ENOTSUP.
Because we run the external fstrim command we don't have access to the
kernel errno when it fails.  However in the case where it prints this
specific error message, turn that into errno ENOTSUP.
2016-08-05 15:10:50 +01:00
Richard W.M. Jones
97b6b4a4eb sparsify: Exit with error code 3 if fstrim is not supported by the appliance.
This replaces the indirect exception catching from
commit 931aec5b88 with a direct feature
test.

Fixes commit 931aec5b88.
2016-08-05 12:16:54 +01:00
Richard W.M. Jones
7de25f7d71 build: Line up "OCAMLOPT" with other silent rules.
Tidies up commit 0b94c4d3bb.
2016-08-05 10:37:46 +01:00
Richard W.M. Jones
a11a7ebbc3 build: Add silent rules for podwrapper.
Also quietens the podwrapper script itself, as there is no reason to
print 'wrote <output>' for each output file.
2016-08-04 23:33:58 +01:00
Richard W.M. Jones
320b053178 Version 1.33.49. v1.33.49 2016-08-04 22:34:42 +01:00
Pino Toscano
0b94c4d3bb build: add simple custom silent rules for automake
Add makefile variables to enable silent rules for simple command
invocations, such as ocamlc, ocamlopt, javac, and erlc.

This reduces the log output when building with silent rules, still
showing the full command lines otherwise.
2016-08-04 16:18:33 +02:00
Pino Toscano
5630e0eb05 dib: add --drive-format
Allow to specify the format of the helper drive, to avoid relying on the
format autodetection.  This is the same approach used also in all the
other tools.
2016-08-04 14:43:21 +02:00
Pino Toscano
6e198634ac firstboot: make SysV symlinks as relative on Debian
Turn the rc.d symlinks for the guestfs-firstboot service as relative,
instead of absolute paths: the result is the same (the service works the
same), and this way is more coherent with symlinks created by
update-rc.d.
2016-08-04 13:53:31 +02:00
Pino Toscano
d394e01c2b firstboot: rename systemd and sysvinit
Currently we install a systemd service named firstboot.service and a
SysV service named virt-sysprep-firstboot.  On systems where systemd is
the init system and runs with the SysV compatibility, the different
names make systemd handle them as different services, and thus trying to
run the firstboot script runner twice.

Rename both the systemd service and the SysV one to guestfs-firstboot:
the new name is less generic, and allows the systemd service to be
shadowed by the SysV service (and thus running just once).

Also cleanup the old services: the old SysV service can be removed
directly, since its former name had "virt-sysprep" in it, and so there
could not be much room for confusion and conflict.  Regarding the old
systemd service: to avoid leaving it behind, a simple cleanup strategy
is in place, checking the content of the old firstboot.service to really
ensure we are removing one of our versions of this file.
2016-08-04 13:44:03 +02:00
Pino Toscano
1d32637c64 dib: export FS_TYPE for elements
Export FS_TYPE for the elements, so they can know what is the filesystem
created.

This was implemented in diskimage-builder upstream as
commit be521bdec6233530cc952be246a66f1957b0dd58.
2016-08-04 12:16:35 +02:00
Pino Toscano
8ad870e563 dib: add docker output format
Implement the "docker" output format, to import an image into docker.

This was implemented in diskimage-builder upstream as
commit 1187f9d5df6d6eddba478ac75d3834391480755f and
commit edc06a20e57bdf0a9a03949b54395008d73520dc.
2016-08-04 12:16:35 +02:00
Richard W.M. Jones
d14a8f500c Version 1.33.48. v1.33.48 2016-08-04 10:00:06 +01:00
Richard W.M. Jones
9d387b5eeb po: Update POTFILES. 2016-08-04 09:52:07 +01:00
Richard W.M. Jones
9fc0418db5 mllib: _exit should return 'a
Fixes commit 0dfa96c043.
2016-08-04 09:27:43 +01:00
Richard W.M. Jones
bdfce1995b Version 1.33.47. v1.33.47 2016-08-03 16:43:54 +01:00
Pino Toscano
d12be6625a dib: rework run of extra-data.d hooks (RHBZ#1362354)
Instead of running them before lanching the appliance with the disks and
then uploading the result after root.d hooks run, mount the root in the
local temporary directory using FUSE and then run the hooks on the
guest.  Other than being closer to what diskimage-builder does, it also
avoids issues with the extra-data.d scripts assuming to find things
already, and we don't error out while trying to unpack files on the
guest.

Since virt-dib requires FUSE now, build it only if FUSE is supported.
2016-08-03 16:48:11 +02:00
Pino Toscano
5077c02046 mllib: move _exit from v2v as Exit module
Move the OCaml binding to C _exit to an own module.

Just code motion, adapting v2v in the process.
2016-08-03 15:01:59 +02:00
Pino Toscano
2cb053d3fe mllib: check for executable existance in run_command (RHBZ#1362357)
run_command uses Unix.create_process which forks a child process, and
executes execve: the latter fails when the executable does not exist,
triggering the exit which, in older OCaml versions [1], also runs the
at_exit handlers.

Since there is not much that can be done to avoid this on the OCaml
side, to keep run_command working also in older OCaml version then
manually search for the existance of the given executable, exiting with
code 127 (as a shell does) in this case.

[1] http://caml.inria.fr/mantis/view.php?id=7209
2016-08-03 10:07:04 +02:00
Pino Toscano
398b940ea4 mllib: move which and its exception from dib
Rename it from "tool" to "executable" in the process, but otherwise
it is just code motion (with minimal adjustments in dib).
2016-08-03 10:07:04 +02:00
Richard W.M. Jones
c8c181e8d9 launch: libvirt: Autodetect backing format for readonly drive overlays (RHBZ#1354335).
If the user doesn't specify a format (ie. they want autodetection),
and the drive is set to read-only, previously we created a qcow2
overlay to protect the drive but didn't set the backing_fmt field.
However libvirt disabled this so now libvirt doesn't work at all on
qcow2 files that have no backing_fmt field set.

We must therefore do autodetection in libguestfs and use that to set
the backing_fmt field.

We were already doing autodetection in the non-readonly case, so this
commit refactors that code into a new function
("get_source_format_or_autodetect") and uses it on the readonly path
too.
2016-08-02 20:33:57 +01:00
Richard W.M. Jones
3b9cc56a45 v2v: linux: Ignore unused string return value of 'file_owner'.
Because we didn't give the type of 'g' there wasn't sufficient
information for the type checker to pick up this problem.  By
specifying the real type of 'g' in a type annotation, that reveals the
problem.

Thanks: Pino Toscano, Nyoxi on IRC.
2016-08-02 12:11:32 +01:00
Tomáš Golembiovský
75d3c5d3c9 v2v: fixed file_owner function
What was happening in file_owner function did not match the description
in the comment. When a path is owned by multiple packages the returned
string was in fact a concatenation of the names of all packages that own
it. E.g. for `Linux.is_file_owned g inspect "/etc"` the returned value
was "filesystemyum" (i.e. "filesystem" + "yum").

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
2016-08-01 15:37:39 +02:00
Richard W.M. Jones
1d3f075502 v2v: xml: Rename internal xpath_new_context function.
This change is not necessary, but is consistent with the naming scheme
of the rest of the code in this file.
2016-07-31 17:20:08 +01:00
Richard W.M. Jones
9e0022cea8 v2v: xml: Link to libxml2 website.
No change, just finessing the documentation.
2016-07-31 17:04:16 +01:00
Pino Toscano
19b0ae6c65 lvm: do not pass --cache to vgscan
This breaks lvm setups with no lvmetad, and it seems to not be needed
even with lvmetad.

Reverts parts of commit 2c4f154b91.
2016-07-29 17:21:25 +02:00
Pino Toscano
12c05d5c36 osinfo: fix reading of shared osinfo DB
$OSINFO_SYSTEM_DIR (or its /usr/share/osinfo fallback) represents the
top-level directory of the osinfo data, while we need to read the "os"
subdirectory of it.

Fixes commit c2ae46a9eb.
2016-07-29 11:36:37 +02:00
Richard W.M. Jones
fa2949b7a5 docs: In API overview, add note that you should free returned values. 2016-07-29 09:09:17 +01:00
Pino Toscano
11a359c76c osinfo: do not assume every media is an installer
The osinfo has an "installer" attribute in <media>, which defaults to
true, and there are few entries which are marked as not.
2016-07-28 15:53:26 +02:00
Pino Toscano
bfedfb6e3c osinfo: simplify reading of attributes from <media>
Directly query the attributes in the media node, instead of using an
XPath expression to read it.

Saves ~10ms when parsing the libosinfo DB on a Fedora 24 installation
(other than making the code easier).
2016-07-28 15:32:31 +02:00
Pino Toscano
38ef48cde5 utils: add new CLEANUP_XMLFREE cleanup, to call xmlFree()
Small cleanup helper to dispose xmlChar* buffers.
2016-07-28 15:30:49 +02:00
Pino Toscano
2ed76e6f17 build: improve Gtk check
Check the presence of Gtk properly depending on the value of --with-gtk:
if a specific version is chosen, then let PKG_CHECK_MODULES fail if that
version if not found, otherwise fallback from gtk3 to gtk2 to no gtk.

Also move few common AC_SUBST in a single place.
2016-07-28 10:56:58 +02:00
Richard W.M. Jones
108509ec19 docs: hacking: Add a section describing the build system. 2016-07-27 19:02:49 +01:00
Richard W.M. Jones
7561d1bcae docs: hacking: Improve documentation on how OCaml programs are built. 2016-07-27 19:02:27 +01:00
Richard W.M. Jones
c008dd15a7 Version 1.33.46. v1.33.46 2016-07-27 15:09:18 +01:00
Pino Toscano
0a808d986a builder: fix EOF check with flex >= 2.6.1
It looks like flex 2.6.1 changed [1] the return code for EOF in
yyinput.  Therefore, use the right value depending on the version of
flex which generates the lexer.

[1] f863c9490e
2016-07-27 15:24:29 +02:00
Pino Toscano
a6330e9d3a appliance: run systemd-tmpfiles also for /run
Setup the volatile /run in the appliance also with the tmpfiles
configurations available.  In particular, setting up correctly the lvm
bits allow lvmetad to run.
2016-07-26 18:24:40 +02:00
Pino Toscano
7367945647 daemon: lvm: improve filter for LVs with activationskip flag set
Commit 2e16e3e993 added lv_active=active
as additional condition when listing LVs, to ignore those with the
activationskip flag set.  OTOH, this check is too broad, and matches
also other kind of LVs.

Change the condition to lv_skip_activation!=1, so matching precisely
what was meant, and only that.

Related to: RHBZ#1306666
2016-07-26 18:24:39 +02:00
Pino Toscano
2c4f154b91 daemon: lvm-filter: start lvmetad better
Currently lvmetad is started in init, and thus using the system
(= appliance) configuration of lvm.  Later on, in the daemon, a local
copy of the lvm configuration is setup, and set it for use using the
LVM_SYSTEM_DIR environment variable: this means only the programmes
executed by the daemon will use the local lvm configuration, and not
lvmetad.

Thus manually start lvmetad from the daemon, right after having setup
the local lvm configuration, and still without failing if it cannot be
executed.

Additionally, since lvmetad now respects the right configuration, make
sure to update its cache when rescanning the VGs by passing --cache to
vgscan.
2016-07-26 18:24:31 +02:00
Pino Toscano
5ce19cec4c daemon: lvm-filter: set also global_filter
When editing the lvm configuration to set the LVM filter, edit the
'global_filter' key in addition to 'filter': the latter is not used when
lvmetad is running, when only the former works.
2016-07-26 16:58:53 +02:00
Pino Toscano
ca1f8efd29 daemon: lvm: change the separator character to '\r'
Commit b91b39e06a changed the separator to
':', although this creates parsing issues when there are fields with
colons (for example lv_tags=imgbased:pool).

Change once more the separator, but this time using a non-printable
character such as '\r': while it will produce uglier debug logs, this
should greatly reduce the possibilities of conflicts with texts of
metadata.
2016-07-26 14:46:49 +02:00
Pino Toscano
1b8e6c7880 osinfo: map "sled" as "sles"
The "sles" distribution string in libguestfs represents both SLES and
SLED, so map the osinfo descriptions of "sled" distributions as "sles".
2016-07-26 11:55:31 +02:00