Skip to content

Commit

Permalink
kvm: skip interfaces in arm node
Browse files Browse the repository at this point in the history
  • Loading branch information
karmab committed Nov 19, 2024
1 parent d8095ed commit cde4458
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions kvirt/providers/kvm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2985,8 +2985,11 @@ def list_disks(self):
def add_nic(self, name, network, model='virtio'):
conn = self.conn
networks = {}
for interface in conn.listInterfaces():
networks[interface] = 'bridge'
try:
for interface in conn.listInterfaces():
networks[interface] = 'bridge'
except:
pass
for net in conn.listAllNetworks():
networks[net.name()] = 'network'
try:
Expand All @@ -3006,6 +3009,8 @@ def add_nic(self, name, network, model='virtio'):
%s
</interface>""" % (networktype, modelxml, source)
if vm.isActive() == 1:
controllerxml = "<controller type='pci' model='pcie-to-pci-bridge'/>"
vm.attachDeviceFlags(controllerxml, VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG)
vm.attachDeviceFlags(nicxml, VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG)
else:
vm.attachDeviceFlags(nicxml, VIR_DOMAIN_AFFECT_CONFIG)
Expand Down Expand Up @@ -3536,7 +3541,6 @@ def list_networks(self):
try:
interfaces = conn.listInterfaces()
except:
warning("Issue parsing your interfaces. Check for weird characters in your ifcfg files")
return networks
for interface in interfaces:
if interface == 'lo' or interface in networks:
Expand Down

0 comments on commit cde4458

Please sign in to comment.