Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-3922

qemu crash with qemu_mutex_unlock_impl: Operation not permitted after executing blockdev-change-medium

    • qemu-kvm-8.2.0-1.el9
    • Yes
    • Critical
    • Regression, CustomerScenariosInitiative
    • rhel-sst-virtualization-storage
    • ssg_virtualization
    • 3
    • QE ack
    • False
    • Hide

      None

      Show
      None
    • None
    • Red Hat Enterprise Linux
    • None
    • x86_64
    • Linux
    • None

      What were you trying to do that didn't work?
      Boot VM with CDROM device and iothread enabled

      It crashes after executing blockdev-change-medium

      Please provide the package NVR for which bug is seen:
      Red Hat Enterprise Linux release 9.4 Beta (Plow)
      5.14.0-363.el9.x86_64
      qemu-kvm-8.1.0-1.el9.x86_64
      seabios-bin-1.16.1-1.el9.noarch
      edk2-ovmf-20230524-3.el9.noarch
      libvirt-9.5.0-6.el9.x86_64
      virtio-win-prewhql-0.1-240.iso

      How reproducible:
      100%

      Steps to reproduce
      1. Create iso file

      dd if=/dev/urandom of=/tmp/orig.dat bs=1M count=100
      mkisofs -o /var/tmp/orig.iso /tmp/orig.dat
      

      2. Boot VM with cdrom and iothread enabled

      .usr/libexec/qemu-kvm \
           -name 'avocado-vt-vm1'  \
           -sandbox on  \
           -machine q35,memory-backend=mem-machine_mem \
           -device '{"id": "pcie-root-port-0", "driver": "pcie-root-port", "multifunction": true, "bus": "pcie.0", "addr": "0x1", "chassis": 1}' \
           -device '{"id": "pcie-pci-bridge-0", "driver": "pcie-pci-bridge", "addr": "0x0", "bus": "pcie-root-port-0"}'  \
           -nodefaults \
           -device '{"driver": "VGA", "bus": "pcie.0", "addr": "0x2"}' \
           -m 30720 \
           -object '{"size": 32212254720, "id": "mem-machine_mem", "qom-type": "memory-backend-ram"}'  \
           -smp 10,maxcpus=10,cores=5,threads=1,dies=1,sockets=2  \
           -cpu 'Cascadelake-Server',ss=on,vmx=on,pdcm=on,hypervisor=on,tsc-adjust=on,umip=on,pku=on,md-clear=on,stibp=on,flush-l1d=on,arch-capabilities=on,xsaves=on,ibpb=on,ibrs=on,amd-stibp=on,amd-ssbd=on,rdctl-no=on,ibrs-all=on,skip-l1dfl-vmentry=on,mds-no=on,pschange-mc-no=on,tsx-ctrl=on,fb-clear=on,hle=off,rtm=off,kvm_pv_unhalt=on \
           -device '{"id": "pcie-root-port-1", "port": 1, "driver": "pcie-root-port", "addr": "0x1.0x1", "bus": "pcie.0", "chassis": 2}' \
           -device '{"driver": "qemu-xhci", "id": "usb1", "bus": "pcie-root-port-1", "addr": "0x0"}' \
           -device '{"driver": "usb-tablet", "id": "usb-tablet1", "bus": "usb1.0", "port": "1"}' \
           -object '{"qom-type": "iothread", "id": "iothread0"}' \
           -object '{"qom-type": "iothread", "id": "iothread1"}' \
           -device '{"id": "pcie-root-port-2", "port": 2, "driver": "pcie-root-port", "addr": "0x1.0x2", "bus": "pcie.0", "chassis": 3}' \
           -device '{"id": "virtio_scsi_pci0", "driver": "virtio-scsi-pci", "bus": "pcie-root-port-2", "addr": "0x0", "iothread": "iothread0"}' \
           -blockdev '{"node-name": "file_image1", "driver": "file", "auto-read-only": true, "discard": "unmap", "aio": "threads", "filename": "/home/kvm_autotest_root/images/rhel930-64-virtio-scsi.qcow2", "cache": {"direct": true, "no-flush": false}}' \
           -blockdev '{"node-name": "drive_image1", "driver": "qcow2", "read-only": false, "cache": {"direct": true, "no-flush": false}, "file": "file_image1"}' \
           -device '{"driver": "scsi-hd", "id": "image1", "drive": "drive_image1", "write-cache": "on"}' \
           -device '{"id": "pcie-root-port-3", "port": 3, "driver": "pcie-root-port", "addr": "0x1.0x3", "bus": "pcie.0", "chassis": 4}' \
           -device '{"driver": "virtio-net-pci", "mac": "9a:9a:08:7d:53:53", "id": "idUp3AlM", "netdev": "idCs2BU9", "bus": "pcie-root-port-3", "addr": "0x0"}'  \
           -netdev tap,id=idCs2BU9,vhost=on \
           -blockdev '{"node-name": "file_cd1", "driver": "file", "auto-read-only": true, "discard": "unmap", "aio": "threads", "filename": "/var/tmp/orig.iso", "cache": {"direct": true, "no-flush": false}}' \
           -blockdev '{"node-name": "drive_cd1", "driver": "raw", "read-only": true, "cache": {"direct": true, "no-flush": false}, "file": "file_cd1"}' \
           -device '{"driver": "scsi-cd", "id": "cd1", "drive": "drive_cd1", "write-cache": "on"}'  \
           -vnc :5 \
           -monitor stdio \
           -qmp tcp:0:5955,server=on,wait=off \
           -rtc base=utc,clock=host,driftfix=slew  \
           -boot menu=off,order=cdn,once=c,strict=off \
           -enable-kvm \
           -device '{"id": "pcie_extra_root_port_0", "driver": "pcie-root-port", "multifunction": true, "bus": "pcie.0", "addr": "0x3", "chassis": 5}'
      

      3. run qmp comand

      {"execute":"qmp_capabilities"}
      {"execute": "blockdev-open-tray", "arguments": {"id": "cd1", "force": true}, "id": "WaXiKe9Q"}
      {"execute": "blockdev-change-medium", "arguments": {"id": "cd1", "filename": "/var/tmp/orig.iso"}, "id": "f2UhMxy8"}
      

      Expected results
      change media succeed

      Actual results
      qemu crash

      It does not hit this issue on
      qemu-kvm-8.0.0-13.el9.x86_64

              kwolf@redhat.com Kevin Wolf
              qingwangrh qing wang
              virt-maint virt-maint
              qing wang qing wang
              Votes:
              0 Vote for this issue
              Watchers:
              14 Start watching this issue

                Created:
                Updated:
                Resolved: