Compare commits

...

5 Commits

Author SHA1 Message Date
Richard W.M. Jones
c99d727dba Version 1.58.1. 2026-01-19 19:47:04 +00:00
Richard W.M. Jones
afb648e7cd daemon/selinux.c: Fix compilation when no libselinux
/usr/bin/ld: /tmp/ccvSGq6E.ltrans7.ltrans.o:(.data.rel.ro+0x1f8): undefined reference to `optgroup_selinuxrelabel_available'

The reason is that we didn't include optgroup_selinuxrelabel_available
on the fallback / no libselinux code path.

Reported-by: David Runge
Thanks: Toolybird
Fixes: https://github.com/libguestfs/libguestfs/issues/290
Fixes: commit ed40333a23
(cherry picked from commit 548af2929e)
2026-01-19 18:55:42 +00:00
Richard W.M. Jones
499e4daf72 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.

(cherry picked from commit 5da8102f5f)
2026-01-19 18:55:27 +00:00
Richard W.M. Jones
880ccfe824 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.

(cherry picked from commit bbbc982bf5)
2026-01-19 18:55:19 +00:00
Richard W.M. Jones
c4eb878d52 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
(cherry picked from commit 0fe8c0492c)
2026-01-19 18:55:16 +00:00
5 changed files with 30 additions and 16 deletions

View File

@@ -20,8 +20,8 @@
# freeform string.
m4_define([libguestfs_major], [1])
m4_define([libguestfs_minor], [58])
m4_define([libguestfs_release], [0])
m4_define([release_date], [2026-01-05])
m4_define([libguestfs_release], [1])
m4_define([release_date], [2026-01-19])
AC_INIT([libguestfs],libguestfs_major.libguestfs_minor.libguestfs_release)
AC_SUBST([RELEASE_DATE],release_date)

View File

@@ -94,5 +94,6 @@ do_getcon (void)
#else /* !HAVE_LIBSELINUX */
OPTGROUP_SELINUX_NOT_AVAILABLE
OPTGROUP_SELINUXRELABEL_NOT_AVAILABLE
#endif /* !HAVE_LIBSELINUX */

View File

@@ -67,6 +67,7 @@ generic_qmp_test (guestfs_h *g, const char *qmp_command, char **outp)
CLEANUP_FREE char *line = NULL;
size_t allocsize = 0;
ssize_t len;
unsigned lineno;
guestfs_int_cmd_add_string_unquoted (cmd, "echo ");
/* QMP is modal. You have to send the qmp_capabilities command first. */
@@ -88,6 +89,7 @@ generic_qmp_test (guestfs_h *g, const char *qmp_command, char **outp)
#endif
"accel=kvm:hvf:tcg");
guestfs_int_cmd_add_string_unquoted (cmd, " -qmp stdio");
guestfs_int_cmd_add_string_unquoted (cmd, " -S");
guestfs_int_cmd_clear_capture_errors (cmd);
fd = guestfs_int_cmd_pipe_run (cmd, "r");
@@ -106,19 +108,30 @@ generic_qmp_test (guestfs_h *g, const char *qmp_command, char **outp)
perrorf (g, "fdopen");
return -1;
}
len = getline (&line, &allocsize, fp); /* line 1 */
lineno = 1; /* line 1 */
len = getline (&line, &allocsize, fp);
if (len >= 0) debug (g, "generic_qmp_test: %u: %s", lineno, line);
if (len == -1 || strstr (line, "\"QMP\"") == NULL) {
parse_failure:
debug (g, "did not understand QMP monitor output from %s", g->hv);
error (g, "did not understand QMP monitor output from %s", g->hv);
return -1;
}
len = getline (&line, &allocsize, fp); /* line 2 */
lineno++; /* line 2 */
len = getline (&line, &allocsize, fp);
if (len >= 0) debug (g, "generic_qmp_test: %u: %s", lineno, line);
if (len == -1 || strstr (line, "\"return\"") == NULL)
goto parse_failure;
len = getline (&line, &allocsize, fp); /* line 3 */
lineno++; /* line 3 */
len = getline (&line, &allocsize, fp);
if (len >= 0) debug (g, "generic_qmp_test: %u: %s", lineno, line);
if (len == -1 || strstr (line, "\"return\"") == NULL)
goto parse_failure;
*outp = safe_strdup (g, line);
/* The other lines we don't care about, so finish parsing here. */
ignore_value (getline (&line, &allocsize, fp)); /* line 4 */
ignore_value (getline (&line, &allocsize, fp)); /* line 5 */
@@ -126,7 +139,7 @@ generic_qmp_test (guestfs_h *g, const char *qmp_command, char **outp)
r = guestfs_int_cmd_pipe_wait (cmd);
/* QMP tests are optional, don't fail if the tests fail. */
if (r == -1 || !WIFEXITED (r) || WEXITSTATUS (r) != 0) {
debug (g, "%s wait failed or unexpected exit status", g->hv);
error (g, "%s wait failed or unexpected exit status", g->hv);
return -1;
}

View File

@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: libguestfs 1.58.0\n"
"Project-Id-Version: libguestfs 1.58.1\n"
"Report-Msgid-Bugs-To: guestfs@lists.libguestfs.org\n"
"POT-Creation-Date: 2026-01-05 16:18+0000\n"
"POT-Creation-Date: 2026-01-19 19:41+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View File

@@ -6,10 +6,10 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: libguestfs 1.58.0\n"
"Project-Id-Version: libguestfs 1.58.1\n"
"Report-Msgid-Bugs-To: https://bugzilla.redhat.com/enter_bug.cgi?"
"component=libguestfs&product=Virtualization+Tools\n"
"POT-Creation-Date: 2026-01-05 16:18+0000\n"
"POT-Creation-Date: 2026-01-19 19:41+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -4009,7 +4009,7 @@ msgstr ""
msgid "unable to parse domain capabilities XML returned by libvirt"
msgstr ""
#: lib/launch-libvirt.c:1461 lib/launch-libvirt.c:1709 lib/qemu.c:282
#: lib/launch-libvirt.c:1461 lib/launch-libvirt.c:1709 lib/qemu.c:295
#, c-format
msgid "realpath: could not convert %s to absolute path"
msgstr ""
@@ -4261,25 +4261,25 @@ msgstr ""
msgid "file receive cancelled by daemon"
msgstr ""
#: lib/qemu.c:419
#: lib/qemu.c:432
msgid ""
"discard cannot be enabled on this drive: the drive has a read-only overlay"
msgstr ""
#: lib/qemu.c:426
#: lib/qemu.c:439
msgid ""
"discard cannot be enabled on this drive: you have to specify the format of "
"the file"
msgstr ""
#: lib/qemu.c:436
#: lib/qemu.c:449
#, c-format
msgid ""
"discard cannot be enabled on this drive: qemu does not support discard for "
"%s format files"
msgstr ""
#: lib/qemu.c:456
#: lib/qemu.c:469
#, c-format
msgid ""
"discard cannot be enabled on this drive: protocol %s does not support "