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

Multiple identical evdev devices cannot be hotplugged even when starting it that way works

    • No
    • Low
    • sst_virtualization
    • ssg_virtualization
    • 1
    • Dev ack
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • 10.9.0
    • None

      Please provide the package NVR for which bug is seen:
      libvirt-10.8.0-1.el10.x86_64
      selinux-policy-40.13.9-1.el10.noarch

      How reproducible:
      100%

      Steps to reproduce:
      1. Prepare a inactive guest

      # virsh list --all
      Id   Name    State
      ------------------------
       -     test   shut off
      

      2. Prepare the evdev device xml

      # cat input.xml 
       <input type='evdev' >
            <source dev='/dev/input/event3' />
       </input>
      

      3. Coldplug the input device repeatly

      # virsh attach-device test input.xml --config 
      Device attached successfully
      
      # virsh attach-device test input.xml --config 
      Device attached successfully
      
      # virsh attach-device test input.xml --config 
      Device attached successfully
      
      # virsh attach-device test input.xml --config 
      Device attached successfully
      

      4. Start the guest

      # virsh start test
      Domain 'test' started
      

      5. Check the guest xml

      # virsh dumpxml test --xpath //input
      ....
      <input type="evdev">
        <source dev="/dev/input/event1"/>
        <alias name="input3"/>
      </input>
      <input type="evdev">
        <source dev="/dev/input/event1"/>
        <alias name="input4"/>
      </input>
      <input type="evdev">
        <source dev="/dev/input/event1"/>
        <alias name="input5"/>
      </input>
      <input type="evdev">
        <source dev="/dev/input/event1"/>
        <alias name="input6"/>
      </input>
      

      Expected result:
      Can not start the guest with multiple identical evdev devices.

      Adittional info:
      For hotplug case:

      # virsh attach-device test input.xml 
      Device attached successfully
      
      # virsh attach-device test input.xml 
      error: Failed to attach device from input.xml
      error: Requested operation is not valid: Setting different SELinux label on /dev/input/event1 which is already in use
      

      When try to hotplug the same source evdev device, libvirt will report error.

            mkletzan@redhat.com Martin Kletzander
            rhn-support-lizhu Lili Zhu
            Martin Kletzander Martin Kletzander
            Lili Zhu Lili Zhu
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated: