Skip to content

Commit aa5d505

Browse files
committed
libvirt_pcicontr: add func for pcie-root
Signed-off-by: Dan Zheng <dzheng@redhat.com>
1 parent a3cfa5a commit aa5d505

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

virttest/utils_libvirt/libvirt_pcicontr.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,13 @@ def reset_pci_num(vm_name, num=15):
126126

127127
# synchronize XML
128128
vmxml.sync()
129+
130+
131+
def get_pcie_root(vm_xml):
132+
vm_controllers = vm_xml.devices.by_device_tag("controller")
133+
for index in range(len(vm_controllers)):
134+
if vm_controllers[index].model == "pcie-root":
135+
return index
136+
LOG.warning("The pcie-root controller is not found")
137+
138+
return -1

0 commit comments

Comments
 (0)