Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions virttest/utils_libvirt/libvirt_pcicontr.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,13 @@ def reset_pci_num(vm_name, num=15):

# synchronize XML
vmxml.sync()


def get_pcie_root_index(vm_xml):
vm_controllers = vm_xml.devices.by_device_tag("controller")
for index in range(len(vm_controllers)):
if vm_controllers[index].model == "pcie-root":
return index
LOG.warning("The pcie-root controller is not found")

return -1
Loading