Skip to content

Commit

Permalink
Merge pull request avocado-framework#3111 from Yingshun/fix_pcie_brg
Browse files Browse the repository at this point in the history
libvirt_pcicontr: Fix reset_pci_num
  • Loading branch information
dzhengfy authored Jul 2, 2021
2 parents 535572c + bd94bc4 commit 2ef963c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion virttest/utils_libvirt/libvirt_pcicontr.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ def reset_pci_num(vm_name, num=15):
# Default pcie setting
pcie_root_port = {'controller_model': 'pcie-root-port', 'controller_type': 'pci'}
ret_indexes = get_max_contr_indexes(vmxml, 'pci', 'pcie-root-port')
cur_pci_num = int(ret_indexes[0])
pcie_to_pci_brg_indexes = get_max_contr_indexes(
vmxml, 'pci', 'pcie-to-pci-bridge')
cur_pci_num = ret_indexes[0] if not pcie_to_pci_brg_indexes else \
max(ret_indexes[0], pcie_to_pci_brg_indexes[0])
logging.debug("The current maximum PCI controller index is %d", cur_pci_num)
if cur_pci_num < num:
for i in list(range(cur_pci_num + 1, num)):
Expand Down

0 comments on commit 2ef963c

Please sign in to comment.