RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1983493 - Qemu should prompt fatal error and quit with an unsupported audiodev
Summary: Qemu should prompt fatal error and quit with an unsupported audiodev
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: qemu-kvm
Version: unspecified
Hardware: x86_64
OS: All
low
low
Target Milestone: rc
: ---
Assignee: Marc-Andre Lureau
QA Contact: Lili Zhu
URL:
Whiteboard:
Depends On: 2135806
Blocks: 1788807
TreeView+ depends on / blocked
 
Reported: 2021-07-18 23:54 UTC by Guo, Zhiyi
Modified: 2023-05-09 07:42 UTC (History)
9 users (show)

Fixed In Version: qemu-kvm-7.2.0-1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-09 07:19:27 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2023:2162 0 None None None 2023-05-09 07:19:56 UTC

Description Guo, Zhiyi 2021-07-18 23:54:46 UTC
Description of problem:
Qemu should prompt fatal error and quit with an unsupported audiodev

Version-Release number of selected component (if applicable):
qemu-kvm-6.0.0-23.module+el8.5.0+11740+35571f13.x86_64


How reproducible:
100%

Steps to Reproduce:
1.Start a qemu process with an unsupported audiodev:
# /usr/libexec/qemu-kvm  -audiodev id=audio1,driver=pa
audio: Unknown audio driver `pa'
audio: warning: Using timer based audio emulation
VNC server running on ::1:5900


Actual results:
qemu process reports warning and start

Expected results:
qemu should prompt fatal error and quit

Additional info:

Comment 1 Klaus Heinrich Kiwi 2021-07-19 18:00:53 UTC
(In reply to Guo, Zhiyi from comment #0)

> 
> Actual results:
> qemu process reports warning and start
> 
> Expected results:
> qemu should prompt fatal error and quit
> 
> Additional info:

Not a functional issue.. I'm going to re-set it to low priority / low severity - feel free to discuss

Comment 2 Klaus Heinrich Kiwi 2021-08-25 17:32:20 UTC
(In reply to Klaus Heinrich Kiwi from comment #1)
> (In reply to Guo, Zhiyi from comment #0)
> 
> > 
> > Actual results:
> > qemu process reports warning and start
> > 
> > Expected results:
> > qemu should prompt fatal error and quit
> > 
> > Additional info:
> 
> Not a functional issue.. I'm going to re-set it to low priority / low
> severity - feel free to discuss

FYI, I created a separate RFE bug to actually enable / support the Pulseaudio backend:
Bug 1997725

This bz is orthogonal, in that we need to fail in a more indicative way when the audio backend was not compiled-in. Probably an upstream discussion is needed.

Comment 3 John Ferlan 2021-09-09 13:29:52 UTC
Bulk update: Move RHEL-AV bugs to RHEL9. If necessary to resolve in RHEL8, then clone to the current RHEL8 release.

Comment 5 Yanan Fu 2022-12-20 09:18:03 UTC
QE bot(pre verify): Set 'Verified:Tested,SanityOnly' as gating/tier1 test pass.

Comment 8 Guo, Zhiyi 2022-12-28 11:36:30 UTC
Hi Lili, 

    I cannot verify whether the normal condition works: /usr/libexec/qemu-kvm  -audiodev id=audio1,driver=pa -vnc :2 on my server(dell 940xa, but any servers should not matter)
I guess this is due to the desktop environment need to be configured with normal user(for starting audio device normally) and properly there should be audio device on host as well, here is the strace hint I see:
# strace /usr/libexec/qemu-kvm  -audiodev id=audio1,driver=spice -vnc :2
...
munmap(0x7fbbd281f000, 43703)           = 0
newfstatat(AT_FDCWD, "/run/user/0/pulse/pid", 0x7fbbd431ef28, 0) = -1 ENOENT (No such file or directory)
write(2, "audio: ", 7audio: )                  = 7
write(2, "Could not init `pa' audio driver"..., 33Could not init `pa' audio driver
) = 33
exit_group(1)                           = ?
+++ exited with 1 +++
...

So can you help to verify this issue with a proper audio env?

Thanks!

Zhiyi

Comment 9 Lili Zhu 2023-01-10 08:42:41 UTC
(In reply to Guo, Zhiyi from comment #8)
> Hi Lili, 
> 
>     I cannot verify whether the normal condition works:
> /usr/libexec/qemu-kvm  -audiodev id=audio1,driver=pa -vnc :2 on my
> server(dell 940xa, but any servers should not matter)
> I guess this is due to the desktop environment need to be configured with
> normal user(for starting audio device normally) and properly there should be
> audio device on host as well, here is the strace hint I see:
> # strace /usr/libexec/qemu-kvm  -audiodev id=audio1,driver=spice -vnc :2
> ...
> munmap(0x7fbbd281f000, 43703)           = 0
> newfstatat(AT_FDCWD, "/run/user/0/pulse/pid", 0x7fbbd431ef28, 0) = -1 ENOENT
> (No such file or directory)
> write(2, "audio: ", 7audio: )                  = 7
> write(2, "Could not init `pa' audio driver"..., 33Could not init `pa' audio
> driver
> ) = 33
> exit_group(1)                           = ?
> +++ exited with 1 +++
> ...
> 
> So can you help to verify this issue with a proper audio env?
> 
> Thanks!
> 
> Zhiyi

Hi

1. I defined a guest with non-root user
$ virsh list --all
 Id   Name      State
--------------------------
 -    rhel9.2   shut off

2. check the pulseaudio service
$ systemctl --user status pipewire-pulse.service 
● pipewire-pulse.service - PipeWire PulseAudio
     Loaded: loaded (/usr/lib/systemd/user/pipewire-pulse.service; enabled; preset: disabled)
     Active: active (running) since Tue 2023-01-10 09:21:50 CST; 7h ago
TriggeredBy: ● pipewire-pulse.socket
   Main PID: 2503 (pipewire-pulse)
      Tasks: 2 (limit: 201947)
     Memory: 30.9M
        CPU: 29.697s
     CGroup: /user.slice/user-1000.slice/user/session.slice/pipewire-pulse.service
             └─2503 /usr/bin/pipewire-pulse

Jan 10 09:21:50 localhost.localdomain systemd[2485]: Started PipeWire PulseAudio.
Jan 10 09:21:50 localhost.localdomain pipewire-pulse[2530]: 536870912


3. configure the guest with pulseaudio backend
$ virsh dumpxml rhel9.2 |grep audio
    <audio id='1' type='pulseaudio' serverName='/run/user/1000/pulse/native'/>

4. start the guest
$ virsh start rhel9.2 
error: Failed to start domain 'rhel9.2'
error: internal error: process exited while connecting to monitor: pulseaudio: pa_context_connect() failed
pulseaudio: Reason: Connection refused
pulseaudio: Failed to initialize PA contextaudio: Could not init `pa' audio driver

I will check with the audio driver I installed later

Comment 10 Lili Zhu 2023-01-10 09:03:26 UTC
Tested the bug with:
qemu-kvm-7.2.0-3.el9.x86_64
libvirt-8.10.0-2.el9.x86_64

1. check the audiodev supported by this qemu
$ /usr/libexec/qemu-kvm -audiodev ?
Available audio drivers:
none
pa
wav

2. prepare a guest with non-root user
$ virsh list --all
 Id   Name      State
--------------------------
 -    rhel9.2   shut off

3. config the guest with an unsupported audiodev
$ virsh dumpxml rhel9.2 |grep audio
 <audio id='1' type='coreaudio'/>

4. start the guest
$ virsh start rhel9.2 
error: Failed to start domain 'rhel9.2'
error: internal error: process exited while connecting to monitor: audio: Unknown audio driver `coreaudio'

Qemu prompted fatal error and quit with an unsupported audiodev

Comment 12 Lili Zhu 2023-02-15 07:33:51 UTC
Tested with:
libvirt-9.0.0-3.el9.x86_64
qemu-kvm-7.2.0-6.el9.x86_64


1. define a guest with non-root user
$ virsh list --all
 Id   Name             State
--------------------------------
 1    avocado-vt-vm1   running

2. check the guest audio related definition
...
   <graphics type='vnc' port='5900' autoport='yes' listen='127.0.0.1'>
      <listen type='address' address='127.0.0.1'/>
    </graphics>
    <sound model='ich9'>
      <alias name='sound0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1b' function='0x0'/>
    </sound>
    <audio id='1' type='pulseaudio' serverName='/run/user/1000/pulse/native'/>
...

3. start the guest
$ virsh start avocado-vt-vm1 
error: Failed to start domain 'avocado-vt-vm1'
error: internal error: process exited while connecting to monitor: pulseaudio: pa_context_connect() failed
pulseaudio: Reason: Connection refused
pulseaudio: Failed to initialize PA contextaudio: Could not init `pa' audio driver

4. solve the issues mentioned by setroubleshoot
# setsebool -P virt_use_xserver 1
# ausearch -c 'qemu-kvm' --raw | audit2allow -M my-qemukvm
# semodule -X 300 -i my-qemukvm.pp

5. start the guest
$ virsh start avocado-vt-vm1
Domain 'avocado-vt-vm1' started

6. check the qemu cmd line
$ ps aux |grep audio
...
 -audiodev {"id":"audio1","driver":"pa","server":"/run/user/1000/pulse/native"} -vnc 127.0.0.1:0,audiodev=audio1 -device {"driver":"cirrus-vga","id":"video0","bus":"pcie.0","addr":"0x1"} -device {"driver":"ich9-intel-hda","id":"sound0","bus":"pcie.0","addr":"0x1b"} -device {"driver":"hda-duplex","id":"sound0-codec0","bus":"sound0.0","cad":0,"audiodev":"audio1"}
...

7. Using virt-viewer to VM and perform audio playback inside VM, can work.

Comment 13 Lili Zhu 2023-02-15 08:30:15 UTC
For the selinux issues in Comment #12, will be tracked in Bug #2169944

According to Comment #10 and Comment #12, mark the bug as verified.

Comment 15 errata-xmlrpc 2023-05-09 07:19:27 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: qemu-kvm security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2023:2162


Note You need to log in before you can comment on or make changes to this bug.