Commit Graph

11557 Commits

Author SHA1 Message Date
Richard W.M. Jones
2ebacabd68 golang: Fix quoting in Makefile.
Fixes: commit c8cab6219f
Fixes: commit 95de3f6c50
2021-04-09 14:27:11 +01:00
Richard W.M. Jones
afe7e16c0f golang: Fix build when libguestfs is not already installed.
See similar fix in libnbd:
031aaefaa8

Fixes: commit 95de3f6c50
2021-04-09 14:27:01 +01:00
Richard W.M. Jones
536b5ed993 Version 1.45.5. v1.45.5 2021-04-09 11:39:10 +01:00
Richard W.M. Jones
4c6de453f1 golang: Add go.mod to EXTRA_DIST.
Fixes: commit 95de3f6c50
2021-04-09 11:38:37 +01:00
Richard W.M. Jones
026b52c848 build: Remove m4/.gitignore from EXTRA_DIST.
This file was removed when we got rid of gnulib, but left in
EXTRA_DIST by mistake.

Fixes: commit 0f54df53d2
2021-04-09 11:37:49 +01:00
Richard W.M. Jones
c8cab6219f golang: Try to deal with srcdir != builddir builds.
Updates: commit 95de3f6c50
Thanks: Gianfranco Costamagna
2021-04-09 11:05:17 +01:00
Richard W.M. Jones
93c2d09136 golang: Partially fix the tests.
./guestfs.go:4945:16: conversion from _Ctype_char (int8) to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)
./guestfs.go:7320:16: conversion from _Ctype_char (int8) to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)
./guestfs.go:7335:16: conversion from _Ctype_char (int8) to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)
2021-04-08 12:59:17 +01:00
Richard W.M. Jones
95de3f6c50 golang: Fix bindings for golang 1.16.
See https://blog.golang.org/go116-module-changes
2021-04-08 12:55:19 +01:00
Richard W.M. Jones
0f54df53d2 build: Remove gnulib.
As part of our efforts to clean up and simplify libguestfs, removing
gnulib deletes a large dependency that we mostly no longer use and
causes problems for new users trying to build the library from source.

A few modules from gnulib are still used (under a compatible license)
and these are copied into gnulib/lib/
2021-04-08 11:36:40 +01:00
Richard W.M. Jones
48e7520ec5 lib/guestfs-internal.h: Remove need to include gnulib "hash.h" here.
Centrally including "hash.h" means everything that needs this header
file (everything in lib/) has to depend on gnulib.
2021-04-08 11:12:17 +01:00
Richard W.M. Jones
9cfa1c410f Remove use of gnulib glthread.
This gnulib feature abstracts away threads, locks and TLS, and also
allowed libguestfs to be linked with or without pthread.  However
since pthread these days is part of glibc and so every program is
using pthread, and we want to get rid of gnulib as a dependency, just
use pthread directly.
2021-04-08 11:12:17 +01:00
Richard W.M. Jones
5244d11bd7 generator/bindtests.ml: Remove use of gnulib intprops.h 2021-04-06 13:27:02 +01:00
Richard W.M. Jones
b18ac489db Version 1.45.4. v1.45.4 2021-04-03 12:10:13 +01:00
Richard W.M. Jones
bf28bc01db tests: Fix isoinfo test.
Also remove GUESTFS_ISO_SYSTEM_ID.

Fixes: commit 2f587bbaec
2021-04-03 12:02:35 +01:00
Richard W.M. Jones
278d0d3226 lib/appliance-kcmdline.c: Read UUID directly from appliance.
Instead of using the external file utility, read the UUID directly
from the extfs filesystem.  file 5.40 broke parsing of UUIDs
(https://bugs.astron.com/view.php?id=253).

Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1945122
2021-03-31 13:45:17 +01:00
Richard W.M. Jones
2f587bbaec daemon: Read ISO9660 Primary Volume Descriptor directly.
It turns out we can read the information we need for the isoinfo API
directly from the ISO9660 PVD.  We don't need to use either isoinfo or
xorriso.  This also has the advantages of reducing by 1 the number of
dependencies in the appliance, and reducing potential vulnerability to
a crafted ISO file.

This also fixes timezone calculation for the datetime fields.

Thanks: Thomas Schmitt
Updates: commit efb8a766ca
2021-03-31 11:35:32 +01:00
Richard W.M. Jones
efb8a766ca daemon: Allow xorriso as an alternative to isoinfo.
Currently the guestfs_isoinfo and guestfs_isoinfo_device APIs run
isoinfo inside the appliance to extract the information.

isoinfo is part of genisoimage which is somewhat dead upstream.
xorriso is supposedly the new thing.  (For a summary of the situation
see: https://wiki.debian.org/genisoimage).

This commit rewrites the parsing from C to OCaml to make it easier to
deal with, and allows you to use either isoinfo or xorriso.

Mostly the same fields are available from either tool, but xorriso is
a bit more awkward to parse.
2021-03-30 15:21:54 +01:00
Richard W.M. Jones
2216ab2e32 tests: Prefer xorriso over genisoimage to generate test.iso
This Debian page explains the upstream situation:
https://wiki.debian.org/genisoimage

On Fedora, xorriso provides a compatibility program called "mkisofs".
However this is not present in Debian.  Hence the choice to look for
the program called "xorrisofs".
2021-03-30 13:57:30 +01:00
Richard W.M. Jones
49b8b69cb8 daemon/xfs.c: Fix error message.
Fixes: commit 87206e4e9e
2021-03-30 12:56:58 +01:00
Richard W.M. Jones
0b7207b8c3 Version 1.45.3. v1.45.3 2021-03-29 19:42:29 +01:00
Richard W.M. Jones
8317279c35 m4/guestfs-find-db-tool.m4: Remove unused file.
Fixes: commit 42e5e7cfdb
2021-03-29 18:38:39 +01:00
Richard W.M. Jones
cb8c4d90e1 podwrapper: Use the tarball release date to calculate the stable date.
Fixes: commit eb53d74ba2
2021-03-29 18:29:15 +01:00
Richard W.M. Jones
df983200d7 po/POTFILES: Fix list of files for translation.
Fixes: commit c9ee831aff
2021-03-29 18:25:57 +01:00
Richard W.M. Jones
42e5e7cfdb test-data/phony-guests: Fix phony RPM database, fix virt-inspector test.
libguestfs 1.45.3 now reads the RPM database using librpm, which means
our old phony database created by db_dump can no longer work.  Instead
provide a real (but very minimal) sqlite database.

This commit also fixes the virt-inspector test since the RPM database
contents are now different.
2021-03-29 17:26:43 +01:00
Richard W.M. Jones
fef73bce7e inspection: Return RPM epoch.
Fixes: commit c9ee831aff
2021-03-27 09:31:00 +00:00
Richard W.M. Jones
c9ee831aff inspection: Fix inspection of recent RPM guests using non-BDB.
Recent RPM-based guests have switched from using Berkeley DB (BDB) to
sqlite.  In order to inspect these guests (and earlier ones) we need
to stop using the hokey parsing of the BDB and use librpm APIs
instead.

This commit adds a new internal API so we can call librpm from the
daemon, and changes the library part to use the new API for RPM-based
guests.

This change removes the requirement for BDB tools like db_dump.

See also:
http://lists.rpm.org/pipermail/rpm-ecosystem/2021-March/000751.html
http://lists.rpm.org/pipermail/rpm-ecosystem/2021-March/000754.html
https://blog.fpmurphy.com/2011/08/programmatically-retrieve-rpm-package-details.html

This breaks the virt-inspector test (now in the separate guestfs-tools
repository).  However this is not a bug in libguestfs, but a bug in
the phoney Fedora guest that we use for testing - we created a
BDB-style RPM database which was supposed to be just enough to make
the old code work.  The new code using real librpm needs
/usr/lib/rpm/rpmrc (not present in the phoney image) and also cannot
parse the phoney database, so we will need to separately rework that
test.

Thanks: Panu Matilainen
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1766487
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1409024
2021-03-26 16:26:00 +00:00
Richard W.M. Jones
94e64b28be daemon: chroot: Fix long-standing possible deadlock.
The child (chrooted) process wrote its answer on the pipe and then
exited.  Meanwhile the parent waiting for the child to exit before
reading from the pipe.  Thus if the output was larger than a Linux
pipebuffer then the whole thing would deadlock.
2021-03-26 16:06:03 +00:00
Richard W.M. Jones
48a35c117e tests: btrfs: Use a valid sector size in the test.
Latest btrfs seems to reject 512 byte sector size.  It may be because
of the specific hardware that I'm running the test on.  Anyway using a
4K sector size works.

libguestfs: error: mkfs_btrfs: /dev/sda1: ERROR: invalid sectorsize 512, expected range is [4K, 64K]
2021-03-25 11:57:37 +00:00
Richard W.M. Jones
5b01bcda17 tests: Source test-command and test-pwd from the correct directory.
Fixes: commit 6d32773e81
2021-03-25 11:55:10 +00:00
Richard W.M. Jones
3b1ed4c9bc build: Use correct ounit2 OCaml module.
Also update common module to get the same fix.
2021-03-25 08:26:42 +00:00
Richard W.M. Jones
4991fe5259 bash-completion: Remove completion scripts for tools.
These have moved to guestfs-tools.

Fixes: commit 733d2182b6
2021-03-23 11:08:42 +00:00
Richard W.M. Jones
eb53d74ba2 Don't include huge ChangeLog in the tarball.
Adds a few megabytes which people can easily get from the git
repository.
2021-03-23 10:00:12 +00:00
Richard W.M. Jones
09639387aa Version 1.45.2. v1.45.2 2021-03-22 16:41:30 +00:00
Richard W.M. Jones
008cda2bd2 generator: Do not build mlcustomize if directory does not exist.
When shipping the libguestfs tarball we do not necessarily have
common/mlcustomize.  If we run the generator in this situation then
don't try to generate files in the non-existent directory.

See-also: commit 7ced2b9354
2021-03-22 16:37:55 +00:00
Richard W.M. Jones
b0b2979dce tests: Fix EXTRA_DIST.
Fixes: commit 6d32773e81
2021-03-22 16:27:07 +00:00
Richard W.M. Jones
9dddd8ec62 tests/mount-local/test-parallel-mount-local.c: Fix bogus -fanalyzer warning.
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99716 for the reduced
test case.
2021-03-22 15:52:22 +00:00
Richard W.M. Jones
e0a1106103 daemon: Don't return bogus failure from readdir.
This was returning "readdir: Invalid argument" which is actually
impossible (readdir(3) cannot fail with EINVAL).  It turns out that
the problem is just errno from some other place leaking out.
2021-03-22 14:56:10 +00:00
Richard W.M. Jones
e282558581 tests/charsets/test-charset-fidelity.c: Print all errors.
Not just the first error.
2021-03-22 14:49:41 +00:00
Richard W.M. Jones
b5b22893a1 tests/charsets/test-charset-fidelity.c: Fix code indentation regression.
A previous commit adding assert statements (to make -fanalyzer happy)
accidentally broke this test.

Fixes: commit 8a4275c568
2021-03-22 14:49:09 +00:00
Richard W.M. Jones
9108ad152d daemon/btrfs.c: Ignore mkfs.btrfs allocstart option.
This was deprecated in btrfs 4.14.1 and recently removed (see
btrfs-progs commit 4bd94dba8a "btrfs-progs: mkfs: remove alloc start
options and docs").  If the option is set simply ignore it.
2021-03-22 14:26:57 +00:00
Richard W.M. Jones
1eb055bd46 tests/nbd/test-nbd.pl: Multiple improvements.
Use qemu-nbd --pid-file option so we don't have to use an arbitrary
sleep.

Enable all parts of the test, since everything should work now with
various upstream bugs having been fixed in the 8 years since the test
was originally written.
2021-03-22 14:12:43 +00:00
Richard W.M. Jones
d4ab4ff683 tests: Fix test for new libcap output.
libcap commit 177cd41803 ("A more compact form for the text
representation of capabilities.") changed the format used by
cap_to_text(3), breaking our test.  Change the test to cope.  This
will break with older libcap now, but there's not a lot we can do
about it.
2021-03-22 13:52:41 +00:00
Richard W.M. Jones
245d1a3d7c python: Ignore code style error E128. 2021-03-22 13:19:19 +00:00
Richard W.M. Jones
6d32773e81 tests: Run the tests in parallel.
Before this change the tests ran in about 12m34 and afterwards in
about 6m20, although the real change is more dramatic if you only run
tests from the tests/ subdirectory (as language tests still run serially).

This breaks valgrinding for now, which I intend to fix properly later.
2021-03-18 16:28:55 +00:00
Richard W.M. Jones
ff3fdb0418 tests/regressions: Remove virt-resize test rhbz1285847.sh
This test was correctly copied into the new guestfs-tools repository
when virt-resize was moved there along with the other tools.  However
it was never removed from libguestfs.  We were effectively running the
test on the installed virt-resize.

Fixes: commit 733d2182b6
2021-03-18 13:55:20 +00:00
Richard W.M. Jones
22e9b682a4 tests: Remove obsolete automake2junit script.
Originally added in commit 38fbda9d37 as
a way to integrate the output from automake into CI systems, but not
actually used.
2021-03-18 13:54:44 +00:00
Richard W.M. Jones
13ceb6a87b appliance: Use <cpu mode="maximum"/> for -cpu max on libvirt.
Note this requires libvirt >= 7.1.0 which was only released in March 2021.

With an older libvirt you will see this error:

  Original error from libvirt: unsupported configuration: Invalid mode attribute 'maximum' [code=67 int1=-1]

In theory we could check if this is supported by looking at the
libvirt capabilities and fall back, but this commit does not do that,
in the expectation that most people will be using the default backend
(direct) and on Fedora/RHEL we will add an explicit minimum version
dependency to the package.

qemu support has been around quite a bit longer (at least since 2017).

Fixes: commit 30f74f38bd
2021-03-18 12:42:35 +00:00
Richard W.M. Jones
24e112c1b7 perl: Remove dependency on Win::Hivex::*
This is used in virt-win-reg, but that tool have moved out to
guestfs-tools so the dependency is no longer needed by libguestfs
itself.

Fixes: commit 733d2182b6
2021-03-18 12:19:55 +00:00
Richard W.M. Jones
061be6bb84 tests: Remove dependency on Sys::Virt.
This was only used for a single rule (check-valgrind-local-guests)
which ran "make check-valgrind" on local guests.  This was never
really used by me and was fairly inadvisable anyway, so we can easily
remove it and thus remove the dependency on perl Sys::Virt.
2021-03-18 12:16:28 +00:00
Sam Eiderman
5d686b92a6 launch: libvirt, direct: Add force_kvm backend setting.
By using:

  export LIBGUESTFS_BACKEND_SETTINGS=force_kvm

you can force the backend to use KVM and never fall back to
TCG (software emulation).
2021-03-16 16:11:23 +00:00