Description of problem: $ echo '{ "execute": "qmp_capabilities" }' '{ "execute": "query-qmp-schema" }' '{ "execute": "quit" }' | qemu-system-x86_64 -display none -machine "accel=kvm:tcg" -qmp stdio {"QMP": {"version": {"qemu": {"micro": 90, "minor": 1, "major": 3}, "package": "qemu-4.0.0-0.2.rc0.fc31"}, "capabilities": ["oob"]}} ALSA lib confmisc.c:767:(parse_card) cannot find card '0' ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM default sdl: SDL_OpenAudio failed sdl: Reason: ALSA: Couldn't open audio device: No such file or directory ALSA lib confmisc.c:767:(parse_card) cannot find card '0' ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM default sdl: SDL_OpenAudio failed sdl: Reason: ALSA: Couldn't open audio device: No such file or directory audio: Failed to create voice `pcspk' qemu-system-x86_64: Initialization of device isa-pcspk failed: Initializing audio voice failed and then qemu exits with code 1. There are several problems here: (1) All the ALSA error messages and exiting with non-zero code. Seems like audio is screwed up somehow. (2) More importantly the normal output from the QMP command (ie. the "return" statements) is missing. Version-Release number of selected component (if applicable): qemu-4.0.0-0.2.rc0.fc31.x86_64 How reproducible: 100% Steps to Reproduce: 1. See above.
I see that libvirt sets an environment variable (QEMU_AUDIO_DRV=none) which indeed suppresses these errors. Is that the current advice when running qemu to query QMP?
I think this is a bug in qemu, but I have suggested a workaround for libguestfs: https://www.redhat.com/archives/libguestfs/2019-March/msg00128.html
Historically QEMU upstream defaulted to --audio-drv-list=oss This is awful so Fedora has for a long time built QEMU with --audio-drv-list=pa,sdl,alsa,oss Upstream recently tried to change its default to --audio-drv-list=pa,alsa,sdl,oss but it turns out this was bad because both the alsa and sdl audio drivers in QEMU have completely broken probing logic. This causes them to claim they can support audio even when no audio hardware exists on the host. This results in problems like the huge pile of errors shown above which often casues QEMU to fail to start: https://bugs.launchpad.net/qemu/+bug/1816052 Thus upstream finally decided on --audio-drv-list=pa,oss None of this explains why you would see a regression in libguestfs though as Fedora has been enabling the broken audio drivers for ages. I wonder if we should drop sdl & alsa from Fedora builds though. PulseAudio is good enough for desktop virt under the normal user session. For server virt running as root, spice audio tunnelling is better bet. There could some people relying on alsa or sdl, but it is problematic as shown above.
> I wonder if we should drop sdl & alsa from Fedora builds though. PulseAudio > is good enough for desktop virt under the normal user session. For server > virt running as root, spice audio tunnelling is better bet. > There could some people relying on alsa or sdl, but it is problematic as > shown above. All four audio drivers (pa, alsa, sdl, oss) are built as module on modular builds, so there also is the option to move sdl + alsa to sub-rpms (and not install them by default) instead of disabling them completely.
(In reply to Gerd Hoffmann from comment #4) > > All four audio drivers (pa, alsa, sdl, oss) are built as module on modular > builds, > so there also is the option to move sdl + alsa to sub-rpms (and not install > them > by default) instead of disabling them completely. fedora qemu packaging has that, qemu-audio-X. qemu-system-X-core doesn't require them, but qemu-system-X does, for back compat. But like dan says it's not clear what's causing this to pop up now
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle. Changing version to '31'.
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle. Changing version to 31.
This message is a reminder that Fedora 31 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora 31 on 2020-11-24. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '31'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 31 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 31 changed to end-of-life (EOL) status on 2020-11-24. Fedora 31 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.