Bug 1979998

Summary: Can not list any mdev device if libvirtd quit after timeout when the existing mdev devices having different parent address
Product: Red Hat Enterprise Linux Advanced Virtualization Reporter: yafu <yafu>
Component: libvirtAssignee: Jonathon Jongsma <jjongsma>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.5CC: virt-maint, zhguo
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.5   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-07-09 13:57:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description yafu 2021-07-07 14:56:51 UTC
Description of problem:
Can not list any mdev device if libvirtd quit after timeout when the existing mdev devices having different parent address

Version-Release number of selected component (if applicable):
libvirt-daemon-7.5.0-1.module+el8.5.0+11664+59f87560.x86_64
qemu-kvm-6.0.0-21.module+el8.5.0+11555+e0ab0d09.x86_64
mdevctl-0.78-1.el8.noarch


How reproducible:
100%

Steps to Reproduce:
1.Prepare 2 mdev devices xml with different parent address:
#cat mdev-1.xml 
<device>
  <name>mdev_111fa1ca_18f6_4793_aa58_dcbfbb2e52db</name>
  <parent>pci_0000_9b_00_0</parent>
  <capability type='mdev'>
    <type id='nvidia-262'/>
    <uuid>25069f48-ceee-4c6a-a6f8-156fd7cf3e11</uuid>
    <iommuGroup number='0'/>
  </capability>
</device>

# cat mdev-2.xml 
<device>
  <name>mdev_83a54ae7_09b1_4046_b0e2_b31de31505a0</name>
  <parent>pci_0000_5b_00_0</parent>
  <capability type='mdev'>
    <type id='nvidia-260'/>
    <uuid>83a54ae7-09b1-4046-b0e2-b31de31505a0</uuid>
    <iommuGroup number='0'/>
  </capability>
</device>

2.Define the mdev devices:
# virsh nodedev-define mdev-1.xml 
Node device 'mdev_25069f48_ceee_4c6a_a6f8_156fd7cf3e11' defined from 'mdev-1.xml'

# virsh nodedev-define mdev-2.xml 
Node device 'mdev_83a54ae7_09b1_4046_b0e2_b31de31505a0' defined from 'mdev-2.xml'

3.List the mdev devices,can show both of the mdev devices:
# virsh nodedev-list --cap mdev --all
mdev_25069f48_ceee_4c6a_a6f8_156fd7cf3e11
mdev_83a54ae7_09b1_4046_b0e2_b31de31505a0

4.Sleep 120 to wait for libvirtd quit:
#sleep 120

5.List the mdev devices again:
# virsh nodedev-list --cap mdev --all
no output

Actual results:
Can not list any mdev device if libvirtd quit after timeout when the existing mdev devices having different parent address

Expected results:
Should always list the mdev devices successfully

Additional info:

Comment 1 Jonathon Jongsma 2021-07-09 13:57:55 UTC

*** This bug has been marked as a duplicate of bug 1979440 ***