Commit Graph

12121 Commits

Author SHA1 Message Date
Richard W.M. Jones
e43ca19129 daemon: inspect: Resolve Ubuntu 22+ /dev/disk/by-id/dm-uuid-LVM-... in fstab
Linux + LVM supports device names like /dev/disk/by-id/dm-uuid-LVM-
followed by two concatenated UUIDs, firstly for the volume group and
secondly for the logical volume.  We can reverse those to get the
device name (/dev/VG/LV).

fstab entries look like:

  # / was on /dev/vg0/lv-0 during curtin installation
  /dev/disk/by-id/dm-uuid-LVM-OzFWT6NHkstr1hcmrWRRMDGPn9xdZj1YOOycQ533186x288FdU6UubU3OlnWJz6D / ext4 defaults 0 1
  # /usr was on /dev/vg0/lv-1 during curtin installation
  /dev/disk/by-id/dm-uuid-LVM-OzFWT6NHkstr1hcmrWRRMDGPn9xdZj1YZu53m4ZssZ8Jeb3I14RAJwIj5YlHIb9P /usr ext4 defaults 0 1

The upshot of this fix is that we are now able to correctly inspect
and run virt-v2v on Ubuntu 22+ guests with split /usr.  In particular,
we correctly map /etc/fstab entries like the above to LV device names,
which means that /usr merging now works correctly.

Reported-by: Jaroslav Spanko
Thanks: Daniel Berrange
Fixes: https://issues.redhat.com/browse/RHEL-87493
2025-04-16 21:12:49 +01:00
Richard W.M. Jones
a73f248369 daemon: Rewrite {pvs,vgs,lvs}-full APIs in OCaml
These were previously written in very convoluted C which had to deal
with parsing the crazy output of the "lvm" command.  In fact the
parsing was so complex that it was generated by the generator.  It's
easier to do this in OCaml.

These are basically legacy APIs.  They cannot be expanded and LVM
already supports many more fields.  We should replace these with APIs
for getting single named fields from LVM.
2025-04-16 21:12:49 +01:00
Richard W.M. Jones
3f9078261c Update common submodule
Pulls in these commits:

  Richard W.M. Jones (2):
      mltools: Fix memory leak in OCaml binding of libosinfo
      mlstdutils: Implement String.implode
2025-04-16 21:12:49 +01:00
Richard W.M. Jones
bcd6b3ec3a generator: Fix implementation of FUUID for OCaml functions
This was implemented wrongly.  In the XDR protocol, UUIDs are fixed
buffers of length 32.  We can just use memcpy to copy from the OCaml
string to the UUID, but we have to ensure the string length returned
by OCaml is correct (if not we just assert, it's an internal error).

(It didn't even compile before, so we know it was never used).
2025-04-16 21:12:49 +01:00
Richard W.M. Jones
7a1ffd744b daemon: inspect: Resolve Ubuntu 22+ /dev/disk/by-uuid/ in fstab
Ubuntu 22= uses /dev/disk/by-uuid/ followed by a filesystem UUID in
fstab entries.  Resolve these to mountables.

A typical fstab entry looks like this:

  # /boot was on /dev/vda2 during curtin installation
  /dev/disk/by-uuid/b4e56462-5a64-4272-b76d-f5e58bd8f128 /boot ext4 defaults 0 1

The comment is generated by the installer and appears in the fstab.
This entry would be translated to /dev/sda2.
2025-04-16 21:12:49 +01:00
rwmjones
6fb268997e Merge pull request #186 from rwmjones/2025-fdevice
Implement struct FDevice type in the generator and use it for `pvs_full`
2025-04-16 21:11:57 +01:00
Richard W.M. Jones
5a16d1120f generator: Use new FDevice type for the pvs-full pv_name field
Remove the code which did explicit reverse device name translation,
and use the generator's code instead.
2025-04-16 12:27:07 +01:00
Richard W.M. Jones
0ff73a42c7 generator: Implement struct FDevice type
This acts just like FString except that we do reverse device name
translation on it.  The only use is in the 'pvs-full' API where we
will use it (in a subsequent commit) to reverse translate the pv_name
field (a device name) before returning it from the daemon.

Compare this to the 'pvs' API which also returns a list of device
names, but using the generator's 'RStructList (RDevice,...)'  return
type, where RDevice is similarly reverse translated.

Note in the library-side bindings, because the name has already been
translated in the daemon, we just treat it exactly the same as
FString.  The vast majority of this patch is this mechanical change.
2025-04-16 12:27:07 +01:00
Richard W.M. Jones
2d1e894130 daemon: inspect: Add some debugging of /usr merging 2025-04-16 10:28:41 +01:00
rwmjones
7d561ee6f0 Merge pull request #178 from crobinso/osinfo-doc-tweak
common: update submodule
2025-04-09 21:33:28 +01:00
Cole Robinson
abdec091c4 common: update submodule
Cole Robinson (2):
          mltools: decouple and simplify osinfo device support checks
          mlcustomize: disable `--inject-virtio-win osinfo`

    Richard W.M. Jones (3):
          mltools: Fix de-oUnit-ized tests
          mltools: Unreference various objects
          Revert "mltools: Unreference various objects"

And update customize docs to match

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2025-04-09 16:12:44 -04:00
rwmjones
945d4e0663 Merge pull request #177 from weblate/weblate-libguestfs-libguestfs-master
Translations update from Fedora Weblate
2025-04-04 11:10:10 +01:00
Weblate
8cad86d63c 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/
2025-04-04 12:06:26 +02:00
Ricky Tigg
1b27b7ed1a Translated using Weblate (Finnish)
Currently translated at 9.7% (94 of 960 strings)

Translation: libguestfs/libguestfs-master
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/libguestfs-master/fi/
2025-04-04 12:06:26 +02:00
Richard W.M. Jones
8f375320c3 Version 1.55.8. v1.55.8 2025-04-03 19:31:16 +01:00
Richard W.M. Jones
f523684a0b lib/launch-libvirt.c: Remove fallback <emulator> for Arm
This "hopefully temporary hack" was actually added 12 years ago in
commit 37e1e0da5a ("arm: launch: libvirt: Force <emulator>.")
2025-03-31 18:19:00 +01:00
rwmjones
3951893849 Merge pull request #176 from weblate/weblate-libguestfs-libguestfs-master
Translations update from Fedora Weblate
2025-03-31 15:16:09 +01:00
Ettore Atalan
4a8acbf87d Translated using Weblate (German)
Currently translated at 33.8% (325 of 960 strings)

Translation: libguestfs/libguestfs-master
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/libguestfs-master/de/
2025-03-31 13:53:35 +02:00
Richard W.M. Jones
85c8445e1e build: Remove use of oUnit
This added no value over just running ordinary tests.  This also
removes a complicated OCaml dependency.
2025-03-22 12:41:39 +00:00
rwmjones
2f0fa0fd23 Merge pull request #175 from weblate/weblate-libguestfs-libguestfs-master
Translations update from Fedora Weblate
2025-03-22 11:47:37 +00:00
Weblate
693465e057 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/
2025-03-22 11:53:58 +01:00
Ricky Tigg
4d6387da3f Translated using Weblate (Finnish)
Currently translated at 1.1% (152 of 13341 strings)

Translation: libguestfs/libguestfs-docs-master
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/libguestfs-docs-master/fi/
2025-03-22 11:53:58 +01:00
Richard W.M. Jones
090ea7656e build: Remove detection of lex and yacc
These are not required by libguestfs.  They were used by virt-builder,
but that tool has now been moved to a separate project
(guestfs-tools).

Fixes: commit 733d2182b6
2025-03-22 10:51:21 +00:00
Richard W.M. Jones
f7083e588e build: Add heading about basic build environment
(cherry picked from
virt-v2v commit c523c63a4916b5620666341dad54bf5d999c1fbe)
2025-03-16 13:58:56 +00:00
Richard W.M. Jones
21ae4c37b7 build: Only use ANSI colour sequences if stdout is a terminal
https://stackoverflow.com/a/10022396
2025-03-11 21:04:20 +00:00
Richard W.M. Jones
3a8947323b build: Colourize features
Print yes features in green and no features in red.
2025-03-11 15:31:17 +00:00
Richard W.M. Jones
cf75c12a9e build: Embolden headings in configure output
If using a colour terminal, display headings in bold.
2025-03-11 15:30:18 +00:00
Richard W.M. Jones
471d328b9e build: Add 'feature' and 'print' to display configured features.
Borrow 'feature' and 'print' functions from nbdkit and use these to
display configured features in a simpler and more consistent way.
2025-03-11 15:28:50 +00:00
Richard W.M. Jones
e765e31f3a Version 1.55.7. v1.55.7 2025-03-11 14:44:16 +00:00
Richard W.M. Jones
4176b2043f daemon: Fix loongarch64 detection on RHEL 9
$ rpm -q file
file-5.39-16.el9.x86_64
$ file ./test-data/binaries/bin-loongarch64-dynamic
./test-data/binaries/bin-loongarch64-dynamic: ELF 64-bit LSB pie executable, *unknown arch 0x102* version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-loongarch-lp64d.so.1, BuildID[sha1]=7622a1a70bf6e697851ac3790557e1ca686459b5, for GNU/Linux 5.19.0, stripped

Updates: commit 729d6d55ea
2025-03-11 13:40:14 +00:00
Richard W.M. Jones
bf4a6c2f85 build: Remove unused website/download/builder/ directory 2025-03-11 11:00:29 +00:00
Richard W.M. Jones
31fa712aa0 lib: Print kernel utsname in debug output
Useful for debugging problems caused by the host kernel.  In
particular we were looking at a problem with passt creating a user
namespace but didn't know what exact kernel was being used.
2025-03-10 18:56:39 +00:00
rwmjones
01909c51ff Merge pull request #174 from weblate/weblate-libguestfs-libguestfs-master
Translations update from Fedora Weblate
2025-03-05 12:34:03 +00:00
Yuri Chornoivan
58a72cb2aa Translated using Weblate (Ukrainian)
Currently translated at 100.0% (960 of 960 strings)

Translation: libguestfs/libguestfs-master
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/libguestfs-master/uk/
2025-03-05 07:38:45 +01:00
rwmjones
4401d81654 Merge pull request #173 from weblate/weblate-libguestfs-libguestfs-master
Translations update from Fedora Weblate
2025-03-04 08:39:52 +00:00
Weblate
8876360d97 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/
2025-03-03 22:09:20 +01:00
Krascovict Petrov
f63f88a5bf Translated using Weblate (Portuguese (Brazil))
Currently translated at 0.1% (24 of 13337 strings)

Translation: libguestfs/libguestfs-docs-master
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/libguestfs-docs-master/pt_BR/
2025-03-03 22:09:20 +01:00
denisecheng
0c70675aae support TencentOS
Signed-off-by: denisecheng <denisecheng@tencent.com>
Fixes: https://github.com/libguestfs/libguestfs/pull/172
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
2025-03-03 14:22:37 +00:00
Jacob Reger
f81444ccad libguestfs: Rust binding build error and warning fixes
Internal error type did not implement the necessary traits to be
treated as a proper Rust error. This would cause ergonomic issues
with manual error handling and with error handling crates like
anyhow. Implement the Display and Error trait for internal Error
type. This also fixes the build warnings.

Signed-off-by: Jacob Reger <regerjacob@gmail.com>
2025-02-25 22:00:12 +00:00
Jacob Reger
d7d5264ce8 libguestfs: Rust binding build error and warning fixes
Fixed break in Rust bindings where callback registering expected a
*const i8, but were provided with a *const c_char. Changed to be both
*const c_char in alignment with the libguestfs documentation.

Signed-off-by: Jacob Reger <regerjacob@gmail.com>
2025-02-25 21:53:36 +00:00
Richard W.M. Jones
95ed25aba6 Version 1.55.6. v1.55.6 2025-02-19 16:42:52 +00:00
Richard W.M. Jones
47ac4871b2 daemon: New command_out and sh_out APIs
These APIs allow you to capture output from guest commands that
generate more output than the protocol limit allows.

Thanks: Nijin Ashok
Fixes: https://issues.redhat.com/browse/RHEL-80159
2025-02-19 12:01:10 +00:00
Richard W.M. Jones
8d61b04dd6 ruby: Make sure all object files are cleaned up
There were several, large *.o files left over after 'make clean':

$ ls ruby/ext/guestfs/
actions-0.c  actions-2.c  actions-4.c  actions-6.c    handle.c
actions-0.o  actions-2.o  actions-4.o  actions-6.o    handle.o
actions-1.c  actions-3.c  actions-5.c  actions.h      module.c
actions-1.o  actions-3.o  actions-5.o  extconf.rb.in  module.o
2025-02-18 11:57:07 +00:00
Richard W.M. Jones
a1ecc0006c tests/syslinux/test-syslinux.pl: Send skip messages to stderr
Otherwise they won't appear in test-suite.log.
2025-02-18 11:55:07 +00:00
Richard W.M. Jones
3749443464 tests/syslinux/test-syslinux.pl: Fix disk image location
tests/Makefile.am assumes the test image is located in
tests/syslinux/, but we actually created it in tests/.  Fix the
location, and also ensure the test will clean it up after running
successfully.
2025-02-18 11:53:41 +00:00
Richard W.M. Jones
14e78e9ac8 Version 1.55.5. v1.55.5 2025-02-18 10:10:03 +00:00
Richard W.M. Jones
72cfaff5c5 Update copyright dates for 2025
Automated using this command:

perl -pi.bak -e 's/(20[012][0-9])-20[12][01234]/$1-2025/g' `git ls-files`
2025-02-16 17:00:46 +00:00
Richard W.M. Jones
1b7d905d43 logo: Restore year banner in logo
Fixes: commit e2c7bddf10
2025-02-16 16:57:43 +00:00
Richard W.M. Jones
32644856e7 build: Remove test-functions.sh which was moved and renamed
Fixes: commit b5fbc7e617
2025-02-16 15:39:31 +00:00
Richard W.M. Jones
b5fbc7e617 tests: Replace $TEST_FUNCTIONS
Replace strange $TEST_FUNCTIONS variable/expansion thing with
something more like what we use in nbdkit, a simple tests/functions.sh
script that gets sourced into each test script.

Update the common submodule to get:

  commit 8137d47d0e654065391151eb275e3b64f230f6f5
  Author: Richard W.M. Jones <rjones@redhat.com>
  Date:   Thu Feb 13 11:13:55 2025 +0000

    mlcustomize, mltools: Replace $TEST_FUNCTIONS

    TEST_FUNCTIONS is being removed from libguestfs and guestfs-tools (it
    was removed from virt-v2v a while back).  Make the same adjustment in
    the common submodule.

(and some other commits which are not relevant to libguestfs)
2025-02-13 11:15:34 +00:00