Commit Graph

12295 Commits

Author SHA1 Message Date
Susant Sahani
799b04fe3e daemon: Convert do_set_uuid_random to table-driven dispatch
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-24 09:49:03 +00:00
Susant Sahani
174014933a daemon: use table-driven dispatch in do_set_uuid
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-24 09:49:03 +00:00
Susant Sahani
301b9bc481 daemon: set-label: Convert to table-driven dispatch
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-24 09:47:21 +00:00
Susant Sahani
276897c4df daemon: Use modern compound literal for SIGPIPE ignore
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-21 18:58:00 +00:00
Susant Sahani
25485036a6 fuse: Modernize SIGPIPE handler using compound literal
No functional change.

Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-21 14:04:23 +00:00
Susant Sahani
4f19d68565 daemon: Use designated initializer for struct sockaddr_un
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-21 14:02:14 +00:00
Susant Sahani
3940b79041 parted: Modernize check_parttype() with table-driven mapping
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-21 13:57:26 +00:00
Richard W.M. Jones
18d9769dc3 python: Include <Python.h> first
Python is broken and requires that we include <Python.h> before all
other headers so it can make inadvisable definitions of
_POSIX_C_SOURCE and other things.  This wasn't a problem before, but a
recent change to glibc makes this necessary now.

See also a similar commit in nbdkit:
f924c3c34b

I also removed the -Wcast-align suppression as that is no longer
needed.
2025-11-20 21:00:29 +00:00
Susant Sahani
e04a450ec7 daemon: modernize program_of_csum() using table lookup
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-20 13:11:47 +00:00
Susant Sahani
3c56167615 daemon: use compound literal in send_error()
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-20 11:22:56 +00:00
Susant Sahani
4b81c6f2b1 daemon: use compound literal for reply header
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-20 11:22:56 +00:00
Susant Sahani
b983586eb3 daemon: modernize send_file_write() with compound literal
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-20 11:22:56 +00:00
Susant Sahani
bad58301fb daemon: use compound literal for zero timeval in check_for_library_cancellation
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-20 11:22:56 +00:00
Susant Sahani
60c06f3287 daemon: modernize send_file_end() with compound literal
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-20 11:22:56 +00:00
Susant Sahani
a0c9b41d35 daemon: modernize notify_progress_no_ratelimit: compound literal
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-20 10:36:57 +00:00
Susant Sahani
23257770a8 daemon: modernize pulse_mode_start with compound literals
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-20 08:47:44 +00:00
Susant Sahani
6c8763dcb5 daemon: modernize pulse_mode_cancel with compound literals
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-20 08:47:44 +00:00
Susant Sahani
0326b61157 fish: Modernize signal handler setup using compound literals
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-19 20:32:46 +00:00
Richard W.M. Jones
f2dbcdcce9 github: Use ./configure --enable-werror
We should test with compiler warnings turned into errors, to avoid
warnings being inadvertently introduced in new code.
2025-11-19 19:37:47 +00:00
Susant Sahani
9a871a1948 fish: Initialize more CLEANUP_FREE variables to NULL
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-19 15:14:39 +00:00
Susant Sahani
7e5ace69bc fish: use compound literal to reset SIGPIPE handler
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-19 15:14:24 +00:00
Richard W.M. Jones
bb4c105554 docs: Add another release note that was missed in previous commit
Fixes: commit 9d278d858f
2025-11-19 14:15:47 +00:00
Richard W.M. Jones
9d278d858f docs: Add outline release notes for libguestfs 1.58
This will be released some time in December.
2025-11-19 13:43:56 +00:00
Richard W.M. Jones
f1c9ed7556 docs/guestfs-building.pod: Require libvirt >= 11.10.0
This (actually unreleased) version of libvirt is required because of
bugs in parallel relabelling of the kernel and initrd.  For details
see:

https://github.com/libguestfs/libguestfs/issues/234
https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/AZCDGCUYCRM3TLFIWSS5P2UMCAFRDNJ4/

Thanks: Cole Robinson
2025-11-19 13:18:47 +00:00
Yuri Chornoivan
13a6674a2b Translated using Weblate (Ukrainian)
Currently translated at 100.0% (962 of 962 strings)

Translation: libguestfs/libguestfs-master
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/libguestfs-master/uk/
2025-11-18 22:12:33 +00:00
Susant Sahani
da0239382a fish: Use size_t instead of int for iteration over an array
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-18 16:44:25 +00:00
Susant Sahani
042d1f829a fish: Initialize variable to NULL
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-18 14:40:49 +00:00
Weblate
1ba1b2abfc 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-11-18 08:22:08 +00:00
Pavel Borecki
8ecfb35346 Translated using Weblate (Czech)
Currently translated at 46.3% (445 of 960 strings)

Translation: libguestfs/libguestfs-master
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/libguestfs-master/cs/
2025-11-18 08:22:08 +00:00
Weblate
f39cf9fcb4 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-11-18 08:22:08 +00:00
Ettore Atalan
8f871229f1 Translated using Weblate (German)
Currently translated at 33.9% (326 of 960 strings)

Translation: libguestfs/libguestfs-master
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/libguestfs-master/de/
2025-11-18 08:22:08 +00:00
Susant Sahani
f057044480 fish: Use size_t instead of int for iteration over an array
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-13 16:59:48 +00:00
Richard W.M. Jones
1aff72549c tests/protocol/test-both-ends-cancel.sh: Delete this test
It tests a corner case that we don't experience in real life (although
it can happen).  Moreover the test often hangs, so we're not proving
anything except that there's a very obscure bug that we haven't fixed
and probably won't ever fix.
2025-11-06 18:35:50 +00:00
Cole Robinson
fde79f7c91 tests: test-network.sh: check guest gets expected IP
I wanted to confirm that some selinux AVCs I was seeing were not
causing runtime issues

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2025-11-05 14:41:49 -05:00
Cole Robinson
e209e14f4c tests: test-nbd.pl: label unix socket svirt_image_t
Part of this test uses `qemu-nbd -k SOCKPATH`, and passes
that socket to libvirt. SOCKPATH will have label user_home_t,
which svirt_t can't access, so running with selinux enforcing this
test will always fail.

Manually change the socket label to svirt_image_t which makes
selinux happy.

Note: libvirt does not relabel most (all?) externally managed socket
paths. I think this is correct, since in theory this could be a
socket shared with other processes, so its up to the user to ensure
DAC/MAC permissions are acceptable for their usecase.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2025-11-05 14:41:49 -05:00
Cole Robinson
50bd1fc4c2 tests: gdisk: skip if sgdisk not found on host
really what we need is sgdisk in the appliance, but for test suite
purposes this check is enough IMO

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2025-11-05 14:41:49 -05:00
Cole Robinson
005e701b77 tests: don't print absolute paths in test output
To match other non-libtool tests.

Before: PASS: /path/to/libguestfs.git/tests/c-api/.libs/test-config
After:  PASS: c-api/.libs/test-config

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2025-11-05 14:41:49 -05:00
Richard W.M. Jones
28bc6ca6b9 lib/match.c: Emit a debug message if pcre2_match returns an unexpected error
When iterating on commit 3c1554e7f2 ("lib: Add new app2_class field
for classifying applications") in early versions I was accidentally
passing NULL to match().  Unexpectedly this returned 1 (ie. matching).
This happened because we did not correctly handle other errors apart
from PCRE2_ERROR_NOMATCH from pcre2_match.

Emit a debug message when this happens, and return no match.

To test this I ran these commands, and there was no output:

  $ make && LIBGUESTFS_DEBUG=1 LIBGUESTFS_TRACE=1 make check
  $ find -name '*.log' | xargs grep 'match.*unexpected error'
2025-11-05 15:23:12 +00:00
Richard W.M. Jones
07079ea6fc Version 1.57.6. v1.57.6 2025-11-04 16:20:10 +00:00
Richard W.M. Jones
a419076bd3 build: Remove config.rpath from EXTRA_DIST
Fixes: commit a497a24ecf
2025-11-04 16:19:08 +00:00
Richard W.M. Jones
476a78c75f Update common submodule
Add this generated change:

  Richard W.M. Jones (1):
      structs/structs-print.c: Update this generated file
2025-11-04 15:59:02 +00:00
Richard W.M. Jones
1db2b7837f daemon: inspect_get_windows_group_policy
Windows group policy objects (GPOs) are restrictions that can be added
by an administrator to Windows to lock down various operations.  From
our point of view the ones that matter involve restricting the ability
to inject device drivers.

Previously virt-v2v detected group policy here:

9bb2e7d470/convert/convert_windows.ml (L69)

We would like to report group policy through the libguestfs API and
tools such as virt-inspector, so move the code that is used to detect
group policy to libguestfs.  A new API is introduced that returns
whether group policy was found (only for Windows guests) during
inspection of the software registry.

Fixes: https://issues.redhat.com/browse/RHEL-125846
2025-11-04 15:56:33 +00:00
Richard W.M. Jones
355f8a5413 daemon/inspect_fs_windows.ml: Debug number of children
Just adds a useful debugging statement.
2025-11-04 15:56:33 +00:00
Richard W.M. Jones
344d96e158 lib/inspect-apps.c: Match name, display name and publisher across all regexs
For McAfee VirusScan, the name is bogus and the display name is the
actual name:

  <application>
    <name>{CE15D1B6-19B6-4D4D-8F43-CF5D2C3356FF}</name>
    <display_name>McAfee VirusScan Enterprise</display_name>
    <version>8.8.04001</version>
    <install_path>C:Program Files (x86)McAfeeVirusScan Enterprise\</install_path>
    <publisher>McAfee, Inc.</publisher>
    <url>http://www.mcafeesecurity.com/</url>
  </application>

Simplify the existing ad hoc code so we just match name, display name
and publisher (if present) against all the virus scanning strings.
2025-11-04 15:56:33 +00:00
Richard W.M. Jones
3c1554e7f2 lib: Add new app2_class field for classifying applications
Existing virt-v2v code uses some simple heuristics for detecting
Windows anti-virus software:

7520185504/convert/windows.ml

Replicate exactly this code as a new field in the struct returned by
guestfs_inspect_get_applications2.  Because of limitations with the
API, we must use one of the existing spare fields in the struct, and
it must have the same type (a string), so we are limited in the design
of this new API.  I chose to return a primary classification for the
application, with the only classification possible so far being
"antivirus" (or "" if not).  This allows the possibility of future
expansion of use of this field if we need to in future.

Fixes: https://issues.redhat.com/browse/RHEL-125846
2025-11-04 15:56:33 +00:00
Cole Robinson
04705f2aba gobject: skip test run-tests-retvalues
This is currently broken, and gobject bits are slated to be
removed entirely, so just disable this test.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2025-11-03 15:54:03 -05:00
Cole Robinson
967587b061 ruby: fix deprecation warnings
Convert to TypedData_Get_Struct which has been in ruby since 2009

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2025-11-03 15:53:50 -05:00
Cole Robinson
a497a24ecf build: remove config.rpath
It was added in d4a1c3a778 for gnulib, but since then gnulib
is no longer a submodule, and it does not seem to be required
for the build anylonger.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2025-10-29 09:58:28 -04:00
Cole Robinson
12acfa7de3 build: replace AM_GNU_GETTEXT with simpler LIBINTL check
This reverts "m4: Add junk required to make 'AM_GNU_GETTEXT' work"
commit b9f75ca5b8

And replaces AM_GNU_GETTEXT call with a simpler LIBINTL check
(recommended by claude).

For linux builds on glibc it doesn't appear we need anything
from autotools here, since libintl.h is always available.

For some other cases like macos I think this new minimal check
covers us in the common case.

There are definitely more obscure corner cases that gettext
m4 magic covers but I suspect none of them really matter for
any platforms libguestfs already functions on.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2025-10-29 09:58:28 -04:00
Cole Robinson
4d3197c3c9 tests: python: fix test820RHBZ912499.py
This tests adding a running libvirt domain to libguestfs.
This was never really a safe real-world example AFAICT because it
creates qemu overlays on top of disks that are opened writeable
by the source guest.

Nowadays qemu uses write locks to reject this type of behavior,
and the test fails.

Adjust things so the source VM opens its storage readonly, but
we are still confirming that add_libvirt_dom doesn't mess up
selinux labels.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2025-10-23 11:22:55 +01:00