Commit Graph

12313 Commits

Author SHA1 Message Date
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
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