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 1992197 - vmstate differs between -audiodev and QEMU_AUDIO_DRV when no sound frontends devs present.
Summary: vmstate differs between -audiodev and QEMU_AUDIO_DRV when no sound frontends ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: qemu-kvm
Version: 9.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: beta
: ---
Assignee: Dr. David Alan Gilbert
QA Contact: Guo, Zhiyi
URL:
Whiteboard:
Depends On: 1991671
Blocks: 1977891
TreeView+ depends on / blocked
 
Reported: 2021-08-10 17:51 UTC by Dr. David Alan Gilbert
Modified: 2022-10-21 05:58 UTC (History)
8 users (show)

Fixed In Version: 6.1.0-rc3
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1991671
Environment:
Last Closed: 2022-10-21 05:42:00 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-93089 0 None None None 2021-08-10 17:55:29 UTC

Description Dr. David Alan Gilbert 2021-08-10 17:51:20 UTC
9.0 final should pick this automatically, but I'm assuming we'll want to pick up a fix earlier into 9.0 beta-ish

+++ This bug was initially created as a clone of Bug #1991671 +++

Description of problem:

Consider the two ways of configuring the QEMU audio backend

$ QEMU_AUDIO_DRV=none ./qemu-system-x86_64 -cdrom ~/Downloads/Fedora-Workstation-Live-x86_64-32-1.6.iso -S -monitor stdio

and

$ qemu-system-x86_64 -cdrom ~/Downloads/Fedora-Workstation-Live-x86_64-32-1.6.iso -S -monitor stdio -audiodev none,id=a

These both result in the exact same guest ABI, since nothing about audio backend affects the guest. They have the exact same backend behaviour too.

When live migrating, however, their vmstate differs

The config using -audiodev contains an extra "audio" section in its vmstate.

This appears to be because -audiodev is processed unconditionally at QEMU startup, while $QEMU_AUDIO_DRV is processed lazily when the first sound device is added to the VM (whether at cold boot, or hotplug at runtime).

Due to the lazy init for $QEMU_AUDIO_DRV, the 'audio' section doesn't get added to vmstate.

Amuzingly/frustratingly the "audio" vmstate section is entirely empty, so it serves no functional purpose during live migration, except to break compatibility in this way.


This has unfortunately broken live migration backwards compatibility since libvirt switched to using -audiodev instead of $QEMU_AUDIO_DRV, since libvirt will configure an audio backend regardless of whether any sound frontend device exists.

Version-Release number of selected component (if applicable):
qemu-kvm-6.0.0-26.module+el8.5.0+12044+525f0ebc.x86_64

How reproducible:
Always

Steps to Reproduce:
1. $ QEMU_AUDIO_DRV=none ./qemu-system-x86_64 -cdrom ~/Downloads/Fedora-Workstation-Live-x86_64-32-1.6.iso -S -monitor stdio
2. migrate 'exec:dd of=env.img'
3. $ qemu-system-x86_64 -cdrom ~/Downloads/Fedora-Workstation-Live-x86_64-32-1.6.iso -S -monitor stdio -audiodev none,id=a
4. migrate 'exec:dd of=args.img'
5. scripts/analyze-migration.py -f env.img
6. scripts/analyze-migration.py -f args.img

Actual results:
Extra "audio" section in args.img

Expected results:
vmstate is identical for both ways of configuring audio backend.

Additional info:

--- Additional comment from Dr. David Alan Gilbert on 2021-08-09 17:34:37 BST ---

I think we might be able to fix this just by making a .needed on the audio vmstate to say never to send it.
Old qemu's should ignore the absence of one.

--- Additional comment from Dr. David Alan Gilbert on 2021-08-09 18:40:18 BST ---

Posted upstream as:

audio: Never send migration section

now, which downstream qemu's do you want that in?

--- Additional comment from Daniel Berrangé on 2021-08-10 13:42:21 BST ---

(In reply to Dr. David Alan Gilbert from comment #2)
> Posted upstream as:
> 
> audio: Never send migration section
> 
> now, which downstream qemu's do you want that in?

RHEL-AV 8.5 and RHEL-9.0  will both have libvirt versions which trigger this bug, so QEMU in those two streams.  Base RHEL 8.5 will still have older libvirt so doesn't need this in base QEMU.

Comment 1 Klaus Heinrich Kiwi 2021-08-11 12:36:14 UTC
(In reply to Dr. David Alan Gilbert from comment #0)
> 9.0 final should pick this automatically, but I'm assuming we'll want to
> pick up a fix earlier into 9.0 beta-ish
> 
[...]
> 
> RHEL-AV 8.5 and RHEL-9.0  will both have libvirt versions which trigger this
> bug, so QEMU in those two streams.  Base RHEL 8.5 will still have older
> libvirt so doesn't need this in base QEMU.

I'm assigning to you based on the original bug, but feel free to reassign if there's someone else in point to backport it.

Comment 2 Dr. David Alan Gilbert 2021-08-12 09:23:46 UTC
This is in 6.1.0-rc3 upstream, commit da77adbaf619c4d170cb
Dan's not too worried about it for beta; so I think we'll just let this automatically pick up on the rebase.


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