Ignore hostdev interfaces in VM net stat gathering

Prevents errors if a SR-IOV hostdev interface is configured until this
is more defined.
This commit is contained in:
Joshua Boniface 2021-06-17 01:33:11 -04:00
parent e7b6a3eac1
commit 8f1af2a642
1 changed files with 3 additions and 0 deletions

View File

@ -1655,6 +1655,9 @@ def collect_vm_stats(queue):
logger.out("Getting network statistics for VM {}".format(domain_name), state='d', prefix='vm-thread')
domain_network_stats = []
for interface in tree.findall('devices/interface'):
interface_type = interface.get('type')
if interface_type in ['hostdev']:
continue
interface_name = interface.find('target').get('dev')
interface_bridge = interface.find('source').get('bridge')
interface_stats = domain.interfaceStats(interface_name)