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

[libvirt] Start guest with two virtiofs devices of the same socket for the first time will hang there indefinitely

    • None
    • Moderate
    • rhel-sst-virtualization-storage
    • ssg_virtualization
    • 5
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None

      Version-Release number of selected component (if applicable):
      libvirt-daemon-9.5.0-7.el9_3.x86_64
      qemu-kvm-8.0.0-16.el9_3.x86_64
      virtiofsd-1.7.2-1.el9.x86_64

      How reproducible:
      100%

      Steps to Reproduce:
      1. Prepare a guest with the following xml snippet

      <filesystem type="mount">
        <driver type="virtiofs"/>
        <source socket="/vm001-vhost-fs.sock"/>
        <target dir="mount_tag1"/>
        <alias name="fs0"/>
        <address type="pci" domain="0x0000" bus="0x08" slot="0x00" function="0x0"/>
      </filesystem>
      <filesystem type="mount">
        <driver type="virtiofs"/>
        <source socket="/vm001-vhost-fs.sock"/>
        <target dir="mount_tag2"/>
        <alias name="fs1"/>
        <address type="pci" domain="0x0000" bus="0x09" slot="0x00" function="0x0"/>
      </filesystem>
      

      3. Try to start the guest

      # virsh start avocado-vt-vm1 
      

      (Attach job hangs indefinitely)

      4. check the guest status, guest will be paused

      # virsh list --all
       Id   Name                 State
      -------------------------------------
       5    avocado-vt-vm1       paused
      

      Actual result:
      Attach job hangs indefinitely

      Expected results:
      Should report some error like "socket has been occupied"

      Additional info:
      If I try to attach virtiofs device with the occupied socket to the guest:
      1. Start a guest with the following xml snippet

      <filesystem type="mount">
        <driver type="virtiofs"/>
        <source socket="/vm001-vhost-fs.sock"/>
        <target dir="mount_tag1"/>
        <alias name="fs0"/>
        <address type="pci" domain="0x0000" bus="0x08" slot="0x00" function="0x0"/>
      </filesystem>
      

      2. Prepare the following virtiofs device

      # cat virtiofs.xml
      <filesystem type="mount">
        <driver type="virtiofs"/>
        <source socket="/vm001-vhost-fs.sock"/>
        <target dir="mount_tag2"/>
        <alias name="fs0"/>
      </filesystem>
      

      3. Try to attach the device to the guest

      # virsh attach-device avocado-vt-vm1 virtiofs.xml
      (Will hang there indefinitely)
      

      4. Cancel the above job by client:

      # virsh attach-device avocado-vt-vm1 virtiofs.xml
      ^C
      

      5. Then try to attach it again.

      # date; virsh attach-device avocado-vt-vm1 filesystem1.xml; date
      Wed Dec 20 07:56:05 AM EST 2023
      error: Failed to attach device from virtiofs.xml
      error: Timed out during operation: cannot acquire state change lock (held by monitor=remoteDispatchDomainAttachDevice)
      
      Wed Dec 20 07:56:35 AM EST 2023
      

      (Reported error after 30s)

              gmaglion German Maglione
              rhn-support-lizhu Lili Zhu
              virt-maint virt-maint
              Lili Zhu Lili Zhu
              Votes:
              0 Vote for this issue
              Watchers:
              13 Start watching this issue

                Created:
                Updated: