Skip to content

Commit 6a91d18

Browse files
fix(drivers): boot port must always use network-type interface
LibvirtPoolDriver.create_machine() applied the hypervisor's own network_type (bridge/network) to the initial boot-network port. The boot network is always a plain libvirt virtual network regardless of the hypervisor's main network type, so on a bridge-type hypervisor libvirt tried to treat the boot network's name as a literal host bridge device name and rejected it as too long for IFNAMSIZ. attach_port(), used for the real port attached later, is unaffected and continues to honor network_type.
1 parent ef31e66 commit 6a91d18

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

exordos_core/compute/pool/drivers/libvirt.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,9 +1269,13 @@ def create_machine(
12691269
mac=port.mac,
12701270
rom=self._spec.iface_rom_file,
12711271
mtu=self._spec.iface_mtu,
1272-
# TODO(akremenetsky): This parameter should be taken from
1273-
# the network
1274-
iface_type=self._spec.network_type,
1272+
# The port a machine is created with is always the transient
1273+
# boot network (see pool.py's MetaMachine.dump_to_dp), which
1274+
# is always a plain libvirt virtual network - never the
1275+
# hypervisor's own (possibly bridge-type) main network. The
1276+
# real port replaces it later via attach_port(), which does
1277+
# use self._spec.network_type.
1278+
iface_type="network",
12751279
source=port.source,
12761280
)
12771281

0 commit comments

Comments
 (0)