Bug 1673402

Summary: Qemu core dump when start guest with two disks using same drive
Product: Red Hat Enterprise Linux 7 Reporter: Markus Armbruster <armbru>
Component: qemu-kvm-rhevAssignee: Markus Armbruster <armbru>
Status: CLOSED ERRATA QA Contact: Xueqiang Wei <xuwei>
Severity: high Docs Contact:
Priority: medium    
Version: 7.5CC: chayang, coli, juzhang, mrezanin, ngu, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-kvm-rhev-2.12.0-29.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1662508 Environment:
Last Closed: 2019-08-22 09:19:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1662508    
Bug Blocks: 1673401    

Comment 3 Miroslav Rezanina 2019-05-17 15:47:26 UTC
Fix included in qemu-kvm-rhev-2.12.0-29.el7

Comment 4 Xueqiang Wei 2019-05-20 05:21:41 UTC
Tested on qemu-kvm-rhev-2.12.0-29.el7, not hit this issue, qemu will prompt "conflicts..." or "in use..." as below. So set status to VERIFIED when it is ON_QA.

# sh bug_1673402_with_blockdev.sh 
QEMU 2.12.0 monitor - type 'help' for more information
(qemu) qemu-kvm: -device scsi-hd,id=data1,drive=drive_image1: Conflicts with use by image1 as 'root', which does not allow 'write' on drive_image1


# sh bug_1673402_with_drive.sh
QEMU 2.12.0 monitor - type 'help' for more information
(qemu) qemu-kvm: -device scsi-hd,id=data1,drive=drive_image1: Drive 'drive_image1' is already in use by another device


Versions:
kernel-3.10.0-1046.el7.x86_64
qemu-kvm-rhev-2.12.0-29.el7


# cat bug_1673402_with_blockdev.sh

/usr/libexec/qemu-kvm \
    -name 'avocado-vt-vm1' \
    -machine q35  \
    -nodefaults \
    -device VGA,bus=pcie.0,addr=0x1 \
    -device pcie-root-port,id=pcie_root_port_0,slot=2,chassis=2,addr=0x2,bus=pcie.0 \
    -device pcie-root-port,id=pcie_root_port_1,slot=3,chassis=3,addr=0x3,bus=pcie.0 \
    -device pcie-root-port,id=pcie_root_port_2,slot=4,chassis=4,addr=0x4,bus=pcie.0  \
    -chardev socket,id=qmp_id_qmpmonitor1,path=/var/tmp/monitor-qmpmonitor1-20181228-045409-0zhg5aer,server,nowait \
    -mon chardev=qmp_id_qmpmonitor1,mode=control  \
    -chardev socket,id=qmp_id_catch_monitor,path=/var/tmp/monitor-catch_monitor-20181228-045409-0zhg5aer,server,nowait \
    -mon chardev=qmp_id_catch_monitor,mode=control \
    -device pvpanic,ioport=0x505,id=idjsOqD4  \
    -chardev socket,id=serial_id_serial0,path=/var/tmp/serial-serial0-20181228-045409-0zhg5aer,server,nowait \
    -device isa-serial,chardev=serial_id_serial0  \
    -chardev socket,id=seabioslog_id_20181228-045409-0zhg5aer,path=/var/tmp/seabios-20181228-045409-0zhg5aer,server,nowait \
    -device isa-debugcon,chardev=seabioslog_id_20181228-045409-0zhg5aer,iobase=0x402 \
    -device pcie-root-port,id=pcie.0-root-port-5,slot=5,chassis=5,addr=0x5,bus=pcie.0 \
    -device qemu-xhci,id=usb1,bus=pcie.0-root-port-5,addr=0x0 \
    -device pcie-root-port,id=pcie.0-root-port-6,slot=6,chassis=6,addr=0x6,bus=pcie.0 \
    -object iothread,id=iothread0 \
    -device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pcie.0-root-port-6,addr=0x0,iothread=iothread0 \
    -blockdev driver=file,node-name=driveimage1,filename=/home/kvm_autotest_root/images/rhel77-64-virtio-scsi.qcow2 \
    -blockdev node-name=drive_image1,file=driveimage1,driver=qcow2 \
    -device scsi-hd,id=image1,drive=drive_image1 \
    -device pcie-root-port,id=pcie.0-root-port-7,slot=7,chassis=7,addr=0x7,bus=pcie.0 \
    -device virtio-net-pci,mac=9a:0f:10:11:12:13,id=idPrzVst,vectors=4,netdev=id5uShpn,bus=pcie.0-root-port-7,addr=0x0  \
    -netdev tap,id=id5uShpn,vhost=on \
    -m 14336  \
    -smp 10,maxcpus=10,cores=5,threads=1,sockets=2  \
    -cpu 'SandyBridge',+kvm_pv_unhalt \
    -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1  \
    -vnc :0  \
    -rtc base=utc,clock=host,driftfix=slew  \
    -boot order=cdn,once=c,menu=off,strict=off \
    -enable-kvm \
    -monitor stdio \
    -blockdev driver=file,node-name=drivedata1,filename=/home/kvm_autotest_root/images/data.raw \
    -blockdev node-name=drive_data1,file=drivedata1,driver=raw \
    -device scsi-hd,id=data1,drive=drive_image1 \



# cat bug_1673402_with_drive.sh

/usr/libexec/qemu-kvm \
    -name 'avocado-vt-vm1' \
    -machine q35  \
    -nodefaults \
    -device VGA,bus=pcie.0,addr=0x1 \
    -device pcie-root-port,id=pcie_root_port_0,slot=2,chassis=2,addr=0x2,bus=pcie.0 \
    -device pcie-root-port,id=pcie_root_port_1,slot=3,chassis=3,addr=0x3,bus=pcie.0 \
    -device pcie-root-port,id=pcie_root_port_2,slot=4,chassis=4,addr=0x4,bus=pcie.0  \
    -chardev socket,id=qmp_id_qmpmonitor1,path=/var/tmp/monitor-qmpmonitor1-20181228-045409-0zhg5aer,server,nowait \
    -mon chardev=qmp_id_qmpmonitor1,mode=control  \
    -chardev socket,id=qmp_id_catch_monitor,path=/var/tmp/monitor-catch_monitor-20181228-045409-0zhg5aer,server,nowait \
    -mon chardev=qmp_id_catch_monitor,mode=control \
    -device pvpanic,ioport=0x505,id=idjsOqD4  \
    -chardev socket,id=serial_id_serial0,path=/var/tmp/serial-serial0-20181228-045409-0zhg5aer,server,nowait \
    -device isa-serial,chardev=serial_id_serial0  \
    -chardev socket,id=seabioslog_id_20181228-045409-0zhg5aer,path=/var/tmp/seabios-20181228-045409-0zhg5aer,server,nowait \
    -device isa-debugcon,chardev=seabioslog_id_20181228-045409-0zhg5aer,iobase=0x402 \
    -device pcie-root-port,id=pcie.0-root-port-5,slot=5,chassis=5,addr=0x5,bus=pcie.0 \
    -device qemu-xhci,id=usb1,bus=pcie.0-root-port-5,addr=0x0 \
    -device pcie-root-port,id=pcie.0-root-port-6,slot=6,chassis=6,addr=0x6,bus=pcie.0 \
    -object iothread,id=iothread0 \
    -device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pcie.0-root-port-6,addr=0x0,iothread=iothread0 \
    -drive id=drive_image1,if=none,snapshot=off,aio=threads,cache=none,format=qcow2,file=/home/kvm_autotest_root/images/rhel77-64-virtio-scsi.qcow2 \
    -device scsi-hd,id=image1,drive=drive_image1 \
    -device pcie-root-port,id=pcie.0-root-port-7,slot=7,chassis=7,addr=0x7,bus=pcie.0 \
    -device virtio-net-pci,mac=9a:0f:10:11:12:13,id=idPrzVst,vectors=4,netdev=id5uShpn,bus=pcie.0-root-port-7,addr=0x0  \
    -netdev tap,id=id5uShpn,vhost=on \
    -m 14336  \
    -smp 10,maxcpus=10,cores=5,threads=1,sockets=2  \
    -cpu 'SandyBridge',+kvm_pv_unhalt \
    -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1  \
    -vnc :0  \
    -rtc base=utc,clock=host,driftfix=slew  \
    -boot order=cdn,once=c,menu=off,strict=off \
    -enable-kvm \
    -monitor stdio \
    -drive id=drive_data1,if=none,snapshot=off,aio=threads,cache=none,format=raw,file=/home/kvm_autotest_root/images/data.raw \
    -device scsi-hd,id=data1,drive=drive_image1 \

Comment 6 Xueqiang Wei 2019-05-20 06:26:21 UTC
According to Comment 4, set status to VERIFIED.

Comment 8 errata-xmlrpc 2019-08-22 09:19:59 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, 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-2019:2553