Bug 1972462

Summary: QEMU core dump when doing TLS migration via TCP
Product: Red Hat Enterprise Linux 9 Reporter: Leonardo Bras <leobras>
Component: qemu-kvmAssignee: Leonardo Bras <leobras>
qemu-kvm sub component: Live Migration QA Contact: Li Xiaohui <xiaohli>
Status: CLOSED CURRENTRELEASE Docs Contact:
Severity: unspecified    
Priority: unspecified CC: jinzhao, juzhang, mrezanin, virt-maint, xiaohli
Version: 9.0Flags: pm-rhel: mirror+
Target Milestone: beta   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-kvm-6.0.0-6.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-12-07 21:24:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Leonardo Bras 2021-06-16 01:36:58 UTC
Description of problem:
Qemu core dump when do tls migration on two hosts:
(qemu) qemu-kvm: ../util/yank.c:107: yank_unregister_instance: Assertion `QLIST_EMPTY(&entry->yankfns)' failed.
Aborted (core dumped)


Version-Release number of selected component (if applicable):

hosts info: kernel-5.13.0-0.rc4.33.el9.x86_64 & 
qemu-kvm-6.0.0-5.el9.x86_64.rpm    
guest info: kernel-4.18.0-305.8.el8.x86_64


How reproducible:
100%


Steps to Reproduce:
1.Generate a keys.psk in current dir, and username '$user'
2.Boot a vm as tls server on dst host:
-object tls-creds-psk,dir=.,endpoint=server,id=tls0 \
-incoming defer 
3.Boot a vm as tls client on src host:
-object tls-creds-psk,dir=.,endpoint=client,username=$user,id=tls0 
4.On dst host (qemu) console:
 migrate_set_parameter tls-creds tls0
 migrate_incoming tcp:localhost:1234
On src host (qemu) console:
 migrate_set_parameter tls-creds tls0
 migrate tcp:localhost:1234

Actual results:
During migration, qemu on src&dst host hit core dump:
(qemu) qemu-kvm: ../util/yank.c:107: yank_unregister_instance: Assertion `QLIST_EMPTY(&entry->yankfns)' failed.
Aborted (core dumped)


Expected results:
Migration succeed, vm works well after migration

Comment 1 Leonardo Bras 2021-06-16 01:41:06 UTC
Patch got accepted upstream at:
https://gitlab.com/qemu-project/qemu/-/commit/7de2e8565335c13fb3516cddbe2e40e366cce273 (master)

Downstream patch posted at Gitlab:
https://gitlab.com/redhat/rhel/src/qemu-kvm/qemu-kvm/-/merge_requests/10

Comment 2 Leonardo Bras 2021-06-18 13:30:58 UTC
I moved the downstream MR to centos-stream:
https://gitlab.com/redhat/centos-stream/src/qemu-kvm/-/merge_requests/10

Comment 5 Yanan Fu 2021-06-22 05:05:00 UTC
QE bot(pre verify): Set 'Verified:Tested,SanityOnly' as gating/tier1 test pass.

Comment 6 Li Xiaohui 2021-06-22 09:52:48 UTC
Run automation over tls migration test requirement with rhel9.0 and win2022 guests, all cases passed.

hosts info:
kernel-5.13.0-0.rc4.33.el9.x86_64 & qemu-img-6.0.0-6.el9.x86_64

Automation Logs link:
http://kvmqe-tools.qe.lab.eng.nay.redhat.com/logjump.html?target=pek&path=xiaohli/bz1972462


Mark this bz verified per Comment 5 and Comment 6(Notes tls test requirement cover the case in this bz, so remove SanityOnly).