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)
This commit is contained in:
Richard W.M. Jones
2026-01-19 12:00:50 +00:00
parent 880ccfe824
commit 499e4daf72

View File

@@ -89,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");