Commit Graph

12342 Commits

Author SHA1 Message Date
Anders Roxell
7fee08e53f tar_in: add keepdirlink option for --keep-directory-symlink
Add a new optional boolean argument 'keepdirlink' to tar_in that passes
--keep-directory-symlink to tar. This preserves existing symlinks to
directories when extracting, which is important for usrmerge systems
where /lib is a symlink to /usr/lib.

Without this option, extracting a tarball containing lib/modules/...
to / would replace the /lib symlink with a real directory, breaking
the system.

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
2026-01-19 12:39:59 +00:00
Richard W.M. Jones
5da8102f5f lib/qemu.c: Don't start the guest when checking QMP properties
When checking for QMP properties, we run a qemu command and interact
with the QMP console.  However we also start the guest running (there
is no actual guest in this situation).  This occasionally causes this
line to be printed:

  libguestfs: generic_qmp_test: 3: {"timestamp": {"seconds": 1768823946, "microseconds": 898287}, "event": "GUEST_PANICKED", "data": {"action": "poweroff", "info": {"core": 0, "psw-addr": 0, "reason": "disabled-wait", "psw-mask": 562956395872256, "type": "s390"}}}\r\n

which confuses our parser.

As there is no reason to start the non-existent guest, add the -S
option which causes qemu to start up in a paused state.

For some reason this only happens on s390x but I think it could happen
on all architectures, so it may be a timing issue or something
particular about s390x firmware.
2026-01-19 12:03:59 +00:00
Richard W.M. Jones
bbbc982bf5 lib/qemu.c: Add debugging to generic_qmp_test()
This function fails sometimes on s390x, but it's hard to tell what is
going on because of insufficient debugging.
2026-01-19 10:27:24 +00:00
Richard W.M. Jones
0fe8c0492c lib/qemu.c: Turn debug messages which are really errors into error()
Commit 669eda1e24 ("lib/launch-direct.c: Simplify test for KVM, remove
qemu caching") made it so that failure of generic_qmp_test() will
cause launch to fail.  However we still used debug messages to print
the error, so unless you have debugging enabled you wouldn't see any
error message if this function fails.

Updates: commit 669eda1e24
2026-01-19 10:20:55 +00:00
Hosted Weblate
d16be4592b 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/
2026-01-06 12:57:49 +00:00
Andi Chandler
aeebfc34c3 Translated using Weblate (English (United Kingdom))
Currently translated at 55.7% (7384 of 13236 strings)

Translation: libguestfs/libguestfs-docs-master
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/libguestfs-docs-master/en_GB/
2026-01-06 12:57:49 +00:00
Richard W.M. Jones
d618d8eb0c Version 1.58.0. v1.58.0 2026-01-05 16:19:15 +00:00
Richard W.M. Jones
522c564298 docs/guestfs-release-notes-1.58.pod: Update for 1.58 release 2026-01-05 16:16:43 +00:00
Richard W.M. Jones
c7b204bce3 daemon/device-name-translation.c: Fix btrfs volume reverse translation
Devices associated with btrfs volumes are not reverse-translated
(e.g., btrfsvol:/dev/sdX to sdY).

Forward translation occurs, creating a path mismatch.  This causes
errors in subsequent btrfs commands.

Thanks: Arye Yurkovsky
2025-12-10 12:31:15 +00:00
Arye Yurkovsky
62b0e2ab64 daemon: lvm_utils: Further narrow stat failure to ENOENT
Missed the 2nd stat
2025-12-08 17:40:59 +00:00
Arye Yurkovsky
6aebf70e18 daemon: lvm_utils: Narrow stat failure to ENOENT
And remove redundant parantheses.
To only catch the failure we want to catch.
2025-12-08 17:40:59 +00:00
Arye Yurkovsky
c7228cd1ce daemon: lvm_utils: Handle stat errors
lvm returns logical volumes even if they're broken, for instance when a
physical volume is missing in their volume group.
In such cases, stat would fail to resolve the provided path.
Handle such cases by skipping such failures when finding the matching
lvm device.
2025-12-08 17:40:59 +00:00
Richard W.M. Jones
c56e6ff39b Version 1.57.7. v1.57.7 2025-12-04 13:16:56 +00:00
Susant Sahani
3c73a71626 tests: drop test-btrfs-misc perl file
Fixes: commit c27f3d41b1

Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-12-04 10:53:07 +00:00
Susant Sahani
1387e7f6a8 tests: nbd - convert to python
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-12-03 15:39:41 +00:00
Susant Sahani
fff03b7135 tests: selinux-label - convert to python
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-12-03 15:35:19 +00:00
Susant Sahani
1f739979bb tests: lvm-mapping - convert to python
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-12-03 15:32:56 +00:00
Susant Sahani
8f187bf97b tests: console-debug - convert to python
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-12-03 15:30:54 +00:00
Susant Sahani
bab46df1c6 tests: disk-labels - convert to python
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-12-03 15:29:26 +00:00
Susant Sahani
7f7eeb6668 tests: btrfs - subvolume-default convert to python
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-12-02 10:44:23 +00:00
Susant Sahani
c27f3d41b1 tests: btrfs - test-btrfs-misc convert to python
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-12-02 10:44:23 +00:00
Susant Sahani
7df1e9c359 tests: journal - convert to python
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-12-02 10:42:43 +00:00
Susant Sahani
817fb83742 tests: xfs - convert to python
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-12-02 10:37:05 +00:00
Susant Sahani
bd75288c5a fuse: use modern sigaction initialization for ignored signals
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-12-01 16:28:12 +00:00
Susant Sahani
19c40e5f34 tests: tmpdirs - convert to python
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-12-01 16:17:19 +00:00
Richard W.M. Jones
40fdcd0146 fish: Fix const correctness in strrchr
In C23, strchr or strrchr on a const parameter now returns a const
pointer.  We saw this error:

destpaths.c: In function ‘complete_dest_paths_generator’:
destpaths.c:165:9: error: assignment discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
  165 |       p = strrchr (text, '/');
      |         ^
2025-12-01 14:00:57 +00:00
Fco. Javier F. Serrador
fa7a18ed36 Translated using Weblate (Spanish)
Currently translated at 4.1% (551 of 13236 strings)

Translation: libguestfs/libguestfs-docs-master
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/libguestfs-docs-master/es/

Translated using Weblate (Spanish)

Currently translated at 62.8% (605 of 962 strings)

Translation: libguestfs/libguestfs-master
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/libguestfs-master/es/
2025-12-01 12:01:42 +00:00
Susant Sahani
4349548c83 lib/create: explicitly close fd and report close(2) errors
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-27 13:15:11 +00:00
Susant Sahani
192e086f66 lib/create: fix indentation in guestfs_impl_disk_create()
Convert tabs to spaces and align parameters correctly.

Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-27 11:04:10 +00:00
Susant Sahani
a3a4fc2ba9 lib/create: use bool for is_power_of_2() return type
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-27 11:03:19 +00:00
Susant Sahani
60f60e9f4e lib/create: use compound initializer for BLKDISCARD range 2025-11-27 11:02:06 +00:00
Susant Sahani
7d22402500 lib: Use bool type for allocated flag in disk creation
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-27 08:48:25 +00:00
Susant Sahani
3aaaf4f667 lib: Use compound initialization for buffer in disk creation
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-27 08:48:02 +00:00
Susant Sahani
cf6ac9aeba lib: Add automatic file descriptor cleanup using CLEANUP_CLOSE attrib
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-27 08:46:51 +00:00
Susant Sahani
40e549294e drives: Modernize guestfs_impl_add_drive_opts initialization
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-26 15:17:50 +00:00
Susant Sahani
b4d795c13d lib: Modernize guestfs_int_drive_protocol_to_string to use static array
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-26 15:17:50 +00:00
Susant Sahani
19b208777a fuse: Modernize mount_local_readdir with compound literal struct stat init
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-26 15:16:56 +00:00
Susant Sahani
257bfad817 appliance: Modernize guestfs_int_build_appliance with compound literal
No functional change.

Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-26 15:15:33 +00:00
Susant Sahani
0a8d1aefef daemon: tsk - Fix memory leak
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-24 11:15:23 +00:00
Susant Sahani
b5000cf547 daemon: send_dirent_info: Use designated compound literal for tsk_dirent
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-24 11:15:23 +00:00
Richard W.M. Jones
56da6b36d3 daemon: btrfs: Simplify snapshot code and fix invalid memory access
The existing code had a bug which you can demonstrate by doing:

  $ guestfish -N fs:btrfs:10G -m /dev/sda1 \
  btrfs-subvolume-create /sub :
  btrfs-subvolume-snapshot /sub /snap1 : \
  btrfs-subvolume-snapshot /sub /snap123 : \
  btrfs-subvolume-snapshot /sub /snap123456 : \
  btrfs-subvolume-show /sub
  ...
  libguestfs: error: appliance closed the connection unexpectedly.
  This usually means the libguestfs appliance crashed.

As the code for parsing the output and creating the comma-separated
list of snapshots was unncessarily complicated in the first place,
simplify it.  This also fixes the bug.

This also adds a regression test.

Thanks: Arye Yurkovsky
Link: https://lists.libguestfs.org/archives/list/guestfs@lists.libguestfs.org/thread/QV5VDHIH7WRUNAE54K6OEOKJMWL6M7EM/
2025-11-24 10:44:44 +00:00
Susant Sahani
6c8e3992fc fuse: Modernize mount_local_getattr with compound literal stat init
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-24 10:14:37 +00:00
Susant Sahani
b0f3d711cb lib: fuse - Replace strdup + safe_malloc with safe_strdup/safe_memdup in copy_xattr_list
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-24 10:14:37 +00:00
Susant Sahani
c3ccd2164f fuse: Modernize mount_local_statfs using compound literal statvfs init
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-24 10:14:37 +00:00
Susant Sahani
8ce7e08e1b drive-create: Modernize create_drive_file using compound literal
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-24 10:09:03 +00:00
Susant Sahani
0bd33f87ce daemon: stat_to_statns: Modernize with designated initializer
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-24 09:58:22 +00:00
Susant Sahani
0c437e52d6 daemon: bind_mount: Initialize struct bind_state with compound literal
Signed-off-by: Susant Sahani <ssahani@redhat.com>
2025-11-24 09:58:05 +00:00
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