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

Virtqemud crashed when attach usb bus type cdrom device

    • No
    • None
    • sst_virtualization_storage
    • ssg_virtualization
    • 3
    • Dev ack
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • 10.7.0
    • None

      Please provide the package NVR for which bug is seen:
      libvirt-10.5.0-5.el9.x86_64

      How reproducible:
      100%

      Steps to reproduce:
      1. Prepare a guest

       virsh list --all
       Id   Name                  State
      --------------------------------------
       2    avocado-vt-vm1        running
      
      # virsh domblklist avocado-vt-vm1
       Target   Source
      -------------------------------------------------------------
       vda      /mnt/nfs/images/RHEL-9.4-x86_64-latest-ovmf.qcow2
      

      2. Prepare a cdrom device xml

      # cat usb.xml
      <disk type='block' device='cdrom'>
       <driver name='qemu' type='raw'/>
       <target dev='hdc' bus='usb'/>
      </disk>
      

      3. Attach the disk to guest

      # virsh attach-device avocado-vt-vm1 usb.xml
      error: Disconnected from qemu:///system due to end of file
      error: Failed to attach device from usb.xml
      error: End of file while reading data: Input/output error
      

      4. Check the log

      # grep -i device_add /var/log/libvirt/virtqemud.log
      2024-08-16 03:19:44.335+0000: 69016: info : qemuMonitorSend:838 : QEMU_MONITOR_SEND_MSG: mon=0x7f08f0003010 msg={"execute":"device_add","arguments":{"driver":"usb-storage","bus":"usb.0","port":"2","id":"usb-disk2","removable":false},"id":"libvirt-14"}
      2024-08-16 03:19:44.335+0000: 69037: info : qemuMonitorIOWrite:339 : QEMU_MONITOR_IO_WRITE: mon=0x7f08f0003010 buf={"execute":"device_add","arguments":{"driver":"usb-storage","bus":"usb.0","port":"2","id":"usb-disk2","removable":false},"id":"libvirt-14"}
      2024-08-16 03:19:44.392+0000: 69016: debug : qemuMonitorJSONCheckErrorFull:354 : unable to execute QEMU command {"execute":"device_add","arguments":{"driver":"usb-storage","bus":"usb.0","port":"2","id":"usb-disk2","removable":false},"id":"libvirt-14"}: {"id":"libvirt-14","error":{"class":"GenericError","desc":"drive property not set"}}
      2024-08-16 03:19:44.392+0000: 69016: error : qemuMonitorJSONCheckErrorFull:366 : internal error: unable to execute QEMU command 'device_add': drive property not set
      

      Actual result:
      Virtqemud crashed

      Expected result:
      Libvirt reports some error, and virtqemud does not crash.

            pkrempa@redhat.com Peter Krempa
            rhn-support-lizhu Lili Zhu
            Peter Krempa Peter Krempa
            Fangge Jin Fangge Jin
            Votes:
            0 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated: