From cde4458bfa2706e6d0da4a905ea9700e923d4d27 Mon Sep 17 00:00:00 2001 From: karmab Date: Tue, 19 Nov 2024 15:55:36 +0100 Subject: [PATCH] kvm: skip interfaces in arm node --- kvirt/providers/kvm/__init__.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/kvirt/providers/kvm/__init__.py b/kvirt/providers/kvm/__init__.py index 7d1f7733a..8e0af6d44 100644 --- a/kvirt/providers/kvm/__init__.py +++ b/kvirt/providers/kvm/__init__.py @@ -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: @@ -3006,6 +3009,8 @@ def add_nic(self, name, network, model='virtio'): %s """ % (networktype, modelxml, source) if vm.isActive() == 1: + controllerxml = "" + 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) @@ -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: