Bug 1967051

Summary: With snapshot image boot guest hit core dumped
Product: Red Hat Enterprise Linux 9 Reporter: Zhenyu Zhang <zhenyzha>
Component: qemu-kvmAssignee: Virtualization Maintenance <virt-maint>
qemu-kvm sub component: qcow2 QA Contact: Zhenyu Zhang <zhenyzha>
Status: CLOSED DUPLICATE Docs Contact:
Severity: medium    
Priority: medium CC: coli, drjones, jinzhao, juzhang, qzhang, virt-maint, xuwei, yihyu
Version: 9.0   
Target Milestone: beta   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-06-02 11:43:40 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 Zhenyu Zhang 2021-06-02 11:30:36 UTC
Description of problem:
With snapshot image boot guest hit core dumped

Version-Release number of selected component (if applicable):
Host Distro: RHEL-9.0.0-20210531.2
Host Kernel: kernel-5.13.0-0.rc3.25.el9.aarch64
Guest Kernel: kernel-5.13.0-0.rc3.25.el9.aarch64
qemu-kvm: qemu-kvm-6.0.0-4.el9

How reproducible:
2/15

Steps to Reproduce:
1.boot guest
/usr/libexec/qemu-kvm \
-name 'avocado-vt-vm1'  \
-sandbox on  \
-blockdev node-name=file_aavmf_code,driver=file,filename=/usr/share/edk2/aarch64/QEMU_EFI-silent-pflash.raw,auto-read-only=on,discard=unmap \
-blockdev node-name=drive_aavmf_code,driver=raw,read-only=on,file=file_aavmf_code \
-blockdev node-name=file_aavmf_vars,driver=file,filename=/home/kvm_autotest_root/images/avocado-vt-vm1_rhel900-aarch64-virtio-scsi.qcow2_VARS.fd,auto-read-only=on,discard=unmap \
-blockdev node-name=drive_aavmf_vars,driver=raw,read-only=off,file=file_aavmf_vars \
-machine virt,gic-version=host,pflash0=drive_aavmf_code,pflash1=drive_aavmf_vars \
-device pcie-root-port,id=pcie-root-port-0,multifunction=on,bus=pcie.0,addr=0x1,chassis=1 \
-device pcie-pci-bridge,id=pcie-pci-bridge-0,addr=0x0,bus=pcie-root-port-0  \
-nodefaults \
-device pcie-root-port,id=pcie-root-port-1,port=0x1,addr=0x1.0x1,bus=pcie.0,chassis=2 \
-device virtio-gpu-pci,bus=pcie-root-port-1,addr=0x0 \
-m 8192  \
-smp 4,maxcpus=4,cores=2,threads=1,sockets=2  \
-cpu 'host' \
-chardev socket,wait=off,id=qmp_id_qmpmonitor1,server=on,path=/tmp/monitor-qmpmonitor1-20210601-232721-rKMTmhoL  \
-mon chardev=qmp_id_qmpmonitor1,mode=control \
-chardev socket,wait=off,id=qmp_id_catch_monitor,server=on,path=/tmp/monitor-catch_monitor-20210601-232721-rKMTmhoL  \
-mon chardev=qmp_id_catch_monitor,mode=control  \
-serial unix:'/tmp/serial-serial0-20210601-232721-rKMTmhoL',server=on,wait=off \
-object rng-random,filename=/dev/random,id=passthrough-BTIY6oyJ \
-device pcie-root-port,id=pcie-root-port-2,port=0x2,addr=0x1.0x2,bus=pcie.0,chassis=3 \
-device virtio-rng-pci,id=virtio-rng-pci-ShgEvZy0,rng=passthrough-BTIY6oyJ,bus=pcie-root-port-2,addr=0x0 \
-device pcie-root-port,id=pcie-root-port-3,port=0x3,addr=0x1.0x3,bus=pcie.0,chassis=4 \
-device qemu-xhci,id=usb1,bus=pcie-root-port-3,addr=0x0 \
-device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1 \
-device pcie-root-port,id=pcie-root-port-4,port=0x4,addr=0x1.0x4,bus=pcie.0,chassis=5 \
-device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pcie-root-port-4,addr=0x0 \
-blockdev node-name=file_image1,driver=file,auto-read-only=on,discard=unmap,aio=threads,filename=/home/kvm_autotest_root/images/snA.qcow2,cache.direct=on,cache.no-flush=off \
-blockdev node-name=drive_image1,driver=qcow2,read-only=off,cache.direct=on,cache.no-flush=off,file=file_image1 \
-device scsi-hd,id=image1,drive=drive_image1,write-cache=on \
-device pcie-root-port,id=pcie-root-port-5,port=0x5,addr=0x1.0x5,bus=pcie.0,chassis=6 \
-device virtio-net-pci,mac=9a:30:88:cb:78:af,rombar=0,id=idrHaDwY,netdev=id3CviyN,bus=pcie-root-port-5,addr=0x0  \
-netdev tap,id=id3CviyN,vhost=on  \
-vnc :20  \
-rtc base=utc,clock=host \
-enable-kvm \
-device pcie-root-port,id=pcie-root-port-6,port=0x6,addr=0x1.0x6,bus=pcie.0,chassis=7 \
-device virtio-balloon-pci,id=balloon0,bus=pcie-root-port-6,addr=0x0 \
-device pcie-root-port,id=pcie_extra_root_port_0,multifunction=on,bus=pcie.0,addr=0x2,chassis=8 \
-device pcie-root-port,id=pcie_extra_root_port_1,addr=0x2.0x1,bus=pcie.0,chassis=9 \
-monitor stdio 

2. save file('/var/tmp/test.img') md5sum in guest, shutting down VM avocado-vt-vm1.
dd if=/dev/urandom of=/var/tmp/test.img bs=1M count=1024


3.create snapshot image and boot.
/usr/bin/qemu-img create -f qcow2 -b /home/kvm_autotest_root/images/rhel900-aarch64-virtio-scsi.qcow2 -F qcow2 /home/kvm_autotest_root/images/snA.qcow2 20G

/usr/libexec/qemu-kvm \
-name 'avocado-vt-vm1'  \
-sandbox on  \
-blockdev node-name=file_aavmf_code,driver=file,filename=/usr/share/edk2/aarch64/QEMU_EFI-silent-pflash.raw,auto-read-only=on,discard=unmap \
-blockdev node-name=drive_aavmf_code,driver=raw,read-only=on,file=file_aavmf_code \
-blockdev node-name=file_aavmf_vars,driver=file,filename=/home/kvm_autotest_root/images/avocado-vt-vm1_snA.qcow2_VARS.fd,auto-read-only=on,discard=unmap \
-blockdev node-name=drive_aavmf_vars,driver=raw,read-only=off,file=file_aavmf_vars \
-machine virt,gic-version=host,pflash0=drive_aavmf_code,pflash1=drive_aavmf_vars \
-device pcie-root-port,id=pcie-root-port-0,multifunction=on,bus=pcie.0,addr=0x1,chassis=1 \
-device pcie-pci-bridge,id=pcie-pci-bridge-0,addr=0x0,bus=pcie-root-port-0  \
-nodefaults \
-device pcie-root-port,id=pcie-root-port-1,port=0x1,addr=0x1.0x1,bus=pcie.0,chassis=2 \
-device virtio-gpu-pci,bus=pcie-root-port-1,addr=0x0 \
-m 51200  \
-smp 16,maxcpus=16,cores=8,threads=1,sockets=2  \
-cpu 'host' \
-chardev socket,wait=off,id=qmp_id_qmpmonitor1,server=on,path=/tmp/monitor-qmpmonitor1-20210602-064147-Kbl1KBgG  \
-mon chardev=qmp_id_qmpmonitor1,mode=control \
-chardev socket,wait=off,id=qmp_id_catch_monitor,server=on,path=/tmp/monitor-catch_monitor-20210602-064147-Kbl1KBgG  \
-mon chardev=qmp_id_catch_monitor,mode=control  \
-serial unix:'/tmp/serial-serial0-20210602-064147-Kbl1KBgG',server=on,wait=off \
-device pcie-root-port,id=pcie-root-port-2,port=0x2,addr=0x1.0x2,bus=pcie.0,chassis=3 \
-device qemu-xhci,id=usb1,bus=pcie-root-port-2,addr=0x0 \
-device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1 \
-device pcie-root-port,id=pcie-root-port-3,port=0x3,addr=0x1.0x3,bus=pcie.0,chassis=4 \
-device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pcie-root-port-3,addr=0x0 \
-blockdev node-name=file_snA,driver=file,auto-read-only=on,discard=unmap,aio=threads,filename=/home/kvm_autotest_root/images/snA.qcow2,cache.direct=on,cache.no-flush=off \
-blockdev node-name=drive_snA,driver=qcow2,read-only=off,cache.direct=on,cache.no-flush=off,file=file_snA \
-device scsi-hd,id=snA,drive=drive_snA,write-cache=on \
-device pcie-root-port,id=pcie-root-port-4,port=0x4,addr=0x1.0x4,bus=pcie.0,chassis=5 \
-device virtio-net-pci,mac=9a:ae:12:a2:82:9f,rombar=0,id=idBQdsqH,netdev=idUbQVZk,bus=pcie-root-port-4,addr=0x0  \
-netdev tap,id=idUbQVZk,vhost=on  \
-vnc :0  \
-rtc base=utc,clock=host,driftfix=slew \
-enable-kvm \
-device pcie-root-port,id=pcie_extra_root_port_0,multifunction=on,bus=pcie.0,addr=0x2,chassis=6 \
-device pcie-root-port,id=pcie_extra_root_port_1,addr=0x2.0x1,bus=pcie.0,chassis=7

4.hit core dumped

[qemu output] qemu-kvm: ../util/qemu-coroutine-lock.c:57: qemu_co_queue_wait_impl: Assertion `qemu_in_coroutine()' failed.
[qemu output] /tmp/aexpect_e6jcCtKP/aexpect-mo14hihs.sh: line 1: 136053 Aborted                 (core dumped)
[qemu output] (Process terminated with status 134)



Actual results:
With snapshot image boot guest hit core dumped

Expected results:
With snapshot image to boot the guest successfully

Additional info:

Comment 1 Zhenyu Zhang 2021-06-02 11:40:16 UTC
Hi Xueqiang,

Since I don't have an x86 rhel.9.0 machine, could you check if this issue can be reproduced on x86?

Comment 2 CongLi 2021-06-02 11:43:40 UTC

*** This bug has been marked as a duplicate of bug 1950192 ***

Comment 3 Yihuang Yu 2021-06-02 12:02:40 UTC
(In reply to CongLi from comment #2)
> 
> *** This bug has been marked as a duplicate of bug 1950192 ***

This problem is not ioeventfd related, I would make it as a duplicate of bug 1924014

*** This bug has been marked as a duplicate of bug 1924014 ***

Comment 4 Zhenyu Zhang 2021-06-02 12:05:46 UTC
(In reply to CongLi from comment #2)
> 
> *** This bug has been marked as a duplicate of bug 1950192 ***

I saw this bug was encountered on S390 using -device virtio-scsi-ccw,ioeventfd=off.
But on x86 and aarch64 we don't have this virtio-scsi-ccw device, and my bug didn't use 'ioeventfd', but encountered it when using snapshot.
So I am not sure if they are the same reason.

Comment 5 CongLi 2021-06-02 13:05:14 UTC
(In reply to Zhenyu Zhang from comment #4)
> (In reply to CongLi from comment #2)
> > 
> > *** This bug has been marked as a duplicate of bug 1950192 ***
> 
> I saw this bug was encountered on S390 using -device
> virtio-scsi-ccw,ioeventfd=off.
> But on x86 and aarch64 we don't have this virtio-scsi-ccw device, and my bug
> didn't use 'ioeventfd', but encountered it when using snapshot.
> So I am not sure if they are the same reason.

The device or steps may not same, but the call trace are same, so close it as a dup, 
I also think BZ1950192 is a dup to BZ1924914, we could confirm with the developer.

Thanks.