Commit Graph

11865 Commits

Author SHA1 Message Date
Richard W.M. Jones
91303865c7 website: Fix paths to development and stable releases on the website
(cherry picked from commit b6a3689d89)
2023-02-21 20:57:52 +00:00
Richard W.M. Jones
b2d32cda03 Update common submodule to latest
(cherry picked from commit cfe7d39b40)
2023-02-21 20:42:45 +00:00
Richard W.M. Jones
46bd83b8a5 valgrind: Add another libvirt suppression
It seems as if this is just a variation on the previous libvirt
suppression.

==2042391== 61 (48 direct, 13 indirect) bytes in 1 blocks are definitely lost in
 loss record 267 of 507
==2042391==    at 0x4846464: calloc (vg_replace_malloc.c:1340)
==2042391==    by 0x54EE318: g_malloc0 (gmem.c:163)
==2042391==    by 0x5017D4C: virClassNew (virobject.c:189)
==2042391==    by 0x523CCB9: virDataTypesOnce.lto_priv.0 (datatypes.c:111)
==2042391==    by 0x4D8BE42: __pthread_once_slow (pthread_once.c:116)
==2042391==    by 0x50345E1: virOnce (virthread.c:44)
==2042391==    by 0x523CD6A: virGetConnect (datatypes.c:121)
==2042391==    by 0x51FBC1F: virConnectOpenInternal (libvirt.c:893)
==2042391==    by 0x51FCC11: virConnectOpenAuth (libvirt.c:1271)
==2042391==    by 0x4A3ECAD: guestfs_int_open_libvirt_connection.constprop.0 (li
bvirt-auth.c:224)
==2042391==    by 0x4A1D62A: launch_libvirt.lto_priv.0 (launch-libvirt.c:389)
==2042391==    by 0x4993739: guestfs_launch (launch.c:114)

(cherry picked from guestfs-tools commit 8790af0266a808c8a04927bb5039be06cbc3da54)

(cherry picked from commit 4ed83ffdbe)
2023-02-21 20:42:41 +00:00
Richard W.M. Jones
59ac5ba943 valgrind: Update suppression for PCRE2 transition
OCaml PCRE.compile doesn't free up regexps if they are stored in
globals.  However the valgrind suppression for this matched the old
function name, not the new PCRE2 name.  Valgrind errors looked like:

==1799651== 145 bytes in 1 blocks are possibly lost in loss record 2,927 of 4,168
==1799651==    at 0x484186F: malloc (vg_replace_malloc.c:381)
==1799651==    by 0x4D5F2E5: pcre2_compile_8 (pcre2_compile.c:10250)
==1799651==    by 0x29E077: guestfs_int_pcre_compile (pcre-c.c:196)
==1799651==    by 0x2B725F: camlOVA__entry (OVA.ml:392)
==1799651==    by 0x2859A8: caml_program (in /home/rjones/d/virt-v2v/v2v/virt-v2v)
==1799651==    by 0x40F9D8: caml_start_program (in /home/rjones/d/virt-v2v/v2v/virt-v2v)
==1799651==    by 0x40FD86: caml_startup_common (in /home/rjones/d/virt-v2v/v2v/virt-v2v)
==1799651==    by 0x40FDDC: caml_startup (in /home/rjones/d/virt-v2v/v2v/virt-v2v)
==1799651==    by 0x28523F: main (in /home/rjones/d/virt-v2v/v2v/virt-v2v)

(cherry picked from virt-v2v commit 2949109ff9f7a081b1a4b475b9f7bcbef5b45ee0)

(cherry picked from commit ede3632612)
2023-02-21 20:42:35 +00:00
Richard W.M. Jones
75c30fe750 Rework Std_utils.Option so it works like the OCaml stdlib module
OCaml 4.08 introduces a stdlib Option module which looks a bit like
ours but has a number of differences.  In particular our functions
Option.may and Option.default have no corresponding functions in
stdlib, although there are close enough equivalents.

This change was automated using this command:

$ perl -pi.bak \
  -e 's/Option.may/Option.iter/g; s/Option.default /Option.value ~default:/g' \
  `git ls-files`

Update common module to include:

  commit cffa077323fafcdfcf78e230c022afa891a6b3ff
  Author: Richard W.M. Jones <rjones@redhat.com>
  Date:   Mon Feb 20 12:11:51 2023 +0000

    mlstdutils: Rework the Option module to be compatible with stdlib

(cherry picked from commit 250ee85839)
2023-02-21 20:42:25 +00:00
Richard W.M. Jones
2cfb5420fe python: Avoid leaking py_array and py_args in event callbacks
See also:

https://listman.redhat.com/archives/libguestfs/2023-February/030730.html
https://listman.redhat.com/archives/libguestfs/2023-February/030745.html
https://listman.redhat.com/archives/libguestfs/2023-February/030746.html

Fixes: commit 6ef5837e2d
Thanks: Laszlo Ersek, Eric Blake
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
(cherry picked from commit afa4d64fca)
2023-02-21 20:42:20 +00:00
Richard W.M. Jones
1b2e354359 Revert "python: fix call of Python handlers of events"
This reverts one part of commit 85235aec83 related to reference
counts.  Py_BuildValue always increments the reference count (when it
succeeds) and I could not reproduce the Python 3 problem that was
described there.

Reviewed-by: Laszlo Ersek <lersek@redhat.com>
(cherry picked from commit e07304de86)
2023-02-21 20:42:14 +00:00
Richard W.M. Jones
3328fe3820 build: Remove RELEASES file
The presence of this file complicates ./configure and you also have to
remember to update it on each release.  Replace it with a simple
RELEASE_DATE set in ./configure when the version is updated.

I also had to make a minor change to the generator which was using
this file both to check it was run from the source directory and to
get an exclusive lock.  We now use podwrapper.pl.in for this.

(cherry picked from commit f68752462e)
2023-02-21 20:41:34 +00:00
Richard W.M. Jones
b4f4df07fb rust: Don't fail 'make distclean' if cargo clean fails
It fails when run twice with:

  ../run cargo clean
  error: could not find `Cargo.toml` in `/home/rjones/d/libguestfs/rust` or any parent directory

As this is an optional step don't fail here.

(cherry picked from commit c7d54697ca)
2023-02-21 20:40:56 +00:00
Richard W.M. Jones
ecd0395a7c lib: Get rid of minimum libvirt version check
We require libvirt >= 0.10.2, and we included code to check this at
configure-, compile- and run-time.  Remove the checks at compile and
run time (keep the ./configure check).  Libvirt 0.10.2 was released
over 10 years ago so it's safe to assume that everyone has it by now.

(cherry picked from commit b9ccfe3e03)
2023-02-21 20:40:41 +00:00
Richard W.M. Jones
8578c62dc9 python: Use bytes instead of str for event callback buffer
The event callback gets a buffer parameter which is usually something
like a log message.  However as it comes from C it is not necessarily
well-formed (eg) UTF-8 but could contain any old sequence of bytes.

In the test case provided by the reporter, we failed to encode the
buffer as 'str' with this error:

  UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 137: unexpected end of data

Use 'bytes' instead.  Strictly speaking this changes the type
signature of the callbacks, but our existing Python tests which just
print the buffer using '%s' don't fail and in any case we don't
guarantee the stability of non-C APIs.

Reported-by: Yonatan Shtarkman
See: https://listman.redhat.com/archives/libguestfs/2023-February/030653.html
(cherry picked from commit bbf396fc55)
2023-02-21 20:39:59 +00:00
Richard W.M. Jones
86df8c9a1c python: Avoid crash if callback parameters cannot be built
In the case that building the parameters to the Python event callback
fails, args was returned as NULL.  We immediately tried to call
Py_INCREF on this which crashed.  Returning NULL means the Python
function threw an exception, so print the exception and return (there
is no way to return an error here - the event is lost).

Reported-by: Yonatan Shtarkman
See: https://listman.redhat.com/archives/libguestfs/2023-February/030653.html
(cherry picked from commit 6ef5837e2d)
2023-02-21 20:39:53 +00:00
Richard W.M. Jones
ceb1cf50e6 Version 1.50.0. v1.50.0 2023-02-07 11:23:45 +00:00
Richard W.M. Jones
e2c7bddf10 Update copyright dates for 2023
Run this command across the source:

  perl -pi.bak -e 's/(20[012][0-9])-20[12][012]/$1-2023/g' `git ls-files`

and remove changes to po{,-docs}/*.po{,t} (these will be regenerated
later when we run 'make dist').
2023-02-07 10:50:48 +00:00
rwmjones
e4f0733bd7 Merge pull request #108 from weblate/weblate-libguestfs-libguestfs-master
Translations update from Fedora Weblate
2023-02-05 15:31:05 +00:00
Weblate
a1822fa1c6 Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: libguestfs/libguestfs-master
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/libguestfs-master/
2023-02-05 16:20:48 +01:00
Emilio Herrera
4bdefd23d3 Translated using Weblate (Spanish)
Currently translated at 2.0% (335 of 16046 strings)

Translation: libguestfs/libguestfs-docs-master
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/libguestfs-docs-master/es/
2023-02-05 16:20:48 +01:00
Richard W.M. Jones
34d378cef2 docs: Add outline release notes for forthcoming 1.50 stable release 2023-01-31 15:54:46 +00:00
Richard W.M. Jones
4f58017a5e lib/guestfs-internal-all.h: Use __restrict__ keyword for very old GCC
RHEL 7 GCC 4.8.5 does not allow the restrict keyword.  Use the
permitted alternative.
2023-01-31 15:54:46 +00:00
Richard W.M. Jones
8f6b82bc45 lib/guestfs-internal-all.h: Fix whitespace 2023-01-31 15:54:46 +00:00
Richard W.M. Jones
973e26dbd8 Update common module
Update common module to 3253cd99d135d5eb788a0477459b43a269e8cca6

No significant changes that affect virt-v2v now, but it adds some
extra functions to Std_utils that might be used one day.

Cherry picked from virt-v2v commit c7c9dac4f84580190b0e4f7c2e68970192f4bad3
2023-01-28 15:06:33 +00:00
Richard W.M. Jones
09c2a5404a Version 1.49.9. v1.49.9 2023-01-19 23:29:00 +00:00
Richard W.M. Jones
ed8a960bb8 build: Ignore new common/mldrivers in maintainer-check-extra-dist
This directory is not distributed in the tarball.

Fixes: commit 1a6485001c
2023-01-19 23:28:14 +00:00
Richard W.M. Jones
1a6485001c Update common submodule 2023-01-19 23:00:36 +00:00
Richard W.M. Jones
fbf7fe8793 build: Remove bundled copy of ocaml-augeas
This is now an external dependency.
2023-01-19 23:00:23 +00:00
Richard W.M. Jones
e0d23c861c generator: customize: Add --inject-qemu-ga and --inject-virtio-win
Add the new flags / operations for virt-customize.
2023-01-17 11:59:00 +00:00
rwmjones
76599aae80 Merge pull request #107 from weblate/weblate-libguestfs-libguestfs-master
Translations update from Fedora Weblate
2023-01-13 20:23:51 +00:00
Temuri Doghonadze
f325b26e4b Translated using Weblate (Georgian)
Currently translated at 14.4% (140 of 967 strings)

Translation: libguestfs/libguestfs-master
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/libguestfs-master/ka/
2023-01-13 21:20:16 +01:00
rwmjones
c75a323bf0 Merge pull request #106 from weblate/weblate-libguestfs-libguestfs-master
Translations update from Fedora Weblate
2022-12-23 19:04:18 +00:00
Jan Kuparinen
7dea806091 Translated using Weblate (Finnish)
Currently translated at 0.8% (138 of 16048 strings)

Translation: libguestfs/libguestfs-docs-master
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/libguestfs-docs-master/fi/
2022-12-23 19:20:01 +01:00
Temuri Doghonadze
c2d20611f2 Translated using Weblate (Georgian)
Currently translated at 14.3% (139 of 967 strings)

Translation: libguestfs/libguestfs-master
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/libguestfs-master/ka/
2022-12-23 19:20:01 +01:00
rwmjones
b258185eb4 Merge pull request #105 from weblate/weblate-libguestfs-libguestfs-master
Translations update from Fedora Weblate
2022-12-13 21:14:20 +00:00
Yuri Chornoivan
ad02353bf9 Translated using Weblate (Ukrainian)
Currently translated at 100.0% (967 of 967 strings)

Translation: libguestfs/libguestfs-master
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/libguestfs-master/uk/
2022-12-12 20:20:02 +01:00
rwmjones
23ae55a470 Merge pull request #104 from weblate/weblate-libguestfs-libguestfs-master
Translations update from Fedora Weblate
2022-12-11 19:26:10 +00:00
Weblate
56b1345399 Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: libguestfs/libguestfs-master
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/libguestfs-master/
2022-12-11 17:21:32 +01:00
Emilio Herrera
747ae003d5 Translated using Weblate (Spanish)
Currently translated at 2.0% (330 of 16046 strings)

Translation: libguestfs/libguestfs-docs-master
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/libguestfs-docs-master/es/
2022-12-11 17:21:31 +01:00
Richard W.M. Jones
73fb8719d2 Version 1.49.8. v1.49.8 2022-12-10 12:17:12 +00:00
Andrey Drobyshev
188aa9947f m4/guestfs-appliance.m4: add VIRTUOZZO to RedHat-based distros
This allows to detect VzLinux guest.

Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com>
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
2022-12-09 19:01:00 +00:00
Richard W.M. Jones
a84ff62478 tests/nbd: Remove bogus sleep
This is no longer needed since qemu-nbd now supports pidfiles

Fixes: commit 1eb055bd46
2022-12-02 12:02:49 +00:00
Richard W.M. Jones
dc9bdda084 tests/nbd: Unlink pidfile before running qemu-nbd
It might be left over from a previous failed run.  Best to unlink the
old file before starting qemu-nbd, so there's no possibility of
getting confused later when we wait for the file to appear.
2022-12-02 11:57:16 +00:00
Richard W.M. Jones
98ab261a05 tests/nbd: Move temporary files into tests/nbd/ subdirectory
This test fails for reasons I have not fully understood yet.  However
one thing I noticed is that the Unix domain socket and PID file used
the tests are placed in the tests/ directory, not the tests/nbd/
subdirectory, so let's fix that:

Starting qemu-nbd fedora-nbd.img -t --pid-file /home/rjones/d/libguestfs-rhel-9.2/tests/nbd.pid --format raw -p 63668 ...
Starting qemu-nbd fedora-nbd.img -t --pid-file /home/rjones/d/libguestfs-rhel-9.2/tests/nbd.pid --format raw -p 60684 ...
Starting qemu-nbd fedora-nbd.img -t --pid-file /home/rjones/d/libguestfs-rhel-9.2/tests/nbd.pid --format raw -k /home/rjones/d/libguestfs-rhel-9.2/tests/unix.sock ...

Fixes: commit 6d32773e81
2022-12-02 11:38:17 +00:00
Richard W.M. Jones
824c745748 lib: Return correct osinfo field for Windows 11
For Windows Client, we can only distinguish between Windows 10 and
Windows 11 using the build ID.  The product name in both cases is
"Windows 10 <something>", apparently intentionally.

References:
https://learn.microsoft.com/en-us/answers/questions/586619/windows-11-build-ver-is-still-10022000194.html
a263fe0b26/winsup/cygwin/wincap.cc (L429)
https://en.wikipedia.org/wiki/List_of_Microsoft_Windows_versions

After this fix, the output of virt-inspector changes to this, which is
a bit odd, but correct:

    <name>windows</name>
    <arch>x86_64</arch>
    <distro>windows</distro>
    <product_name>Windows 10 Pro</product_name>
    <product_variant>Client</product_variant>
    <major_version>10</major_version>
    <minor_version>0</minor_version>
    <windows_systemroot>/Windows</windows_systemroot>
    <windows_current_control_set>ControlSet001</windows_current_control_set>
    <osinfo>win11</osinfo>

Thanks: Yaakov Selkowitz
Reported-by: Yongkui Guo
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2012658
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2022-12-02 10:16:57 +00:00
Richard W.M. Jones
f3dd67affe New API: inspect_get_build_id
Add an API to return the build ID of the guest.  This to allow a
future change to be able to distinguish between Windows 10 and Windows 11
which can only be done using the build ID.

For Windows we can read the CurrentBuildNumber key from the registry.
For Linux there happens to be a BUILD_ID field in /etc/os-release.
I've never seen a Linux distro that actually uses this.

Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2022-12-02 10:16:57 +00:00
rwmjones
6efb44c4ff Merge pull request #103 from weblate/weblate-libguestfs-libguestfs-master
Translations update from Fedora Weblate
2022-12-01 20:47:31 +00:00
Yuri Chornoivan
32467fc6d4 Translated using Weblate (Ukrainian)
Currently translated at 100.0% (966 of 966 strings)

Translation: libguestfs/libguestfs-master
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/libguestfs-master/uk/
2022-12-01 20:19:49 +01:00
rwmjones
6397dbca64 Merge pull request #102 from weblate/weblate-libguestfs-libguestfs-master
Translations update from Fedora Weblate
2022-11-30 19:25:54 +00:00
Weblate
5c864d1e80 Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: libguestfs/libguestfs-master
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/libguestfs-master/
2022-11-30 19:20:36 +01:00
Temuri Doghonadze
772d7cb61f Translated using Weblate (Georgian)
Currently translated at 14.3% (138 of 965 strings)

Translation: libguestfs/libguestfs-master
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/libguestfs-master/ka/
2022-11-30 19:20:35 +01:00
Richard W.M. Jones
55fdf761b1 Version 1.49.7. v1.49.7 2022-11-28 11:08:52 +00:00
Richard W.M. Jones
fa305b709a python: Fix code style ("missing whitespace after keyword") 2022-11-28 10:32:21 +00:00