diff options
author | Manuel Bentele | 2021-04-12 11:43:29 +0200 |
---|---|---|
committer | Manuel Bentele | 2021-04-12 11:43:29 +0200 |
commit | f2b0667b55afbc51bc8de4652e7ce4403fbb9bed (patch) | |
tree | 427e66b5767f76f4b20ed2ba45d49b351a6e19d2 | |
parent | Fix issue in VmMetaData factory method wrt. QemuMetaData class (diff) | |
download | master-sync-shared-f2b0667b55afbc51bc8de4652e7ce4403fbb9bed.tar.gz master-sync-shared-f2b0667b55afbc51bc8de4652e7ce4403fbb9bed.tar.xz master-sync-shared-f2b0667b55afbc51bc8de4652e7ce4403fbb9bed.zip |
Adjusts network bridge names for Libvirt networking
-rw-r--r-- | src/main/java/org/openslx/vm/QemuMetaData.java | 32 | ||||
-rw-r--r-- | src/test/java/org/openslx/vm/QemuMetaDataTest.java | 10 |
2 files changed, 21 insertions, 21 deletions
diff --git a/src/main/java/org/openslx/vm/QemuMetaData.java b/src/main/java/org/openslx/vm/QemuMetaData.java index 3209925..e758d64 100644 --- a/src/main/java/org/openslx/vm/QemuMetaData.java +++ b/src/main/java/org/openslx/vm/QemuMetaData.java @@ -227,19 +227,19 @@ public class QemuMetaData extends VmMetaData<QemuSoundCardMeta, QemuDDAccelMeta, QemuHWVersionMeta, QemuEthernetDevTypeMeta, QemuUsbSpeedMeta> { /** - * Default bridge name of the network bridge connected to the LAN. + * Name of the network bridge for the LAN. */ - public static final String NETWORK_DEFAULT_BRIDGE = "brBwLehrpool"; + public static final String NETWORK_BRIDGE_LAN_DEFAULT = "br0"; /** - * Default network name of the isolated host network (host only). + * Name of the network bridge for the default NAT network. */ - public static final String NETWORK_DEFAULT_HOST_ONLY = "host"; + public static final String NETWORK_BRIDGE_NAT_DEFAULT = "nat1"; /** - * Default network name of the NAT network. + * Name of the network for the isolated host network (host only). */ - public static final String NETWORK_DEFAULT_NAT = "nat"; + public static final String NETWORK_BRIDGE_HOST_ONLY_DEFAULT = "vsw2"; /** * Default physical CDROM drive of the hypervisor host. @@ -799,19 +799,19 @@ public class QemuMetaData extends // add network bridge interface device interfaceDevice = this.vmConfig.addInterfaceBridgeDevice(); interfaceDevice.setModel( defaultNetworkDeviceModel ); - interfaceDevice.setSource( QemuMetaData.NETWORK_DEFAULT_BRIDGE ); + interfaceDevice.setSource( QemuMetaData.NETWORK_BRIDGE_LAN_DEFAULT ); break; case HOST_ONLY: // add network interface device with link to the isolated host network - interfaceDevice = this.vmConfig.addInterfaceNetworkDevice(); + interfaceDevice = this.vmConfig.addInterfaceBridgeDevice(); interfaceDevice.setModel( defaultNetworkDeviceModel ); - interfaceDevice.setSource( QemuMetaData.NETWORK_DEFAULT_HOST_ONLY ); + interfaceDevice.setSource( QemuMetaData.NETWORK_BRIDGE_HOST_ONLY_DEFAULT ); break; case NAT: // add network interface device with link to the NAT network - interfaceDevice = this.vmConfig.addInterfaceNetworkDevice(); + interfaceDevice = this.vmConfig.addInterfaceBridgeDevice(); interfaceDevice.setModel( defaultNetworkDeviceModel ); - interfaceDevice.setSource( QemuMetaData.NETWORK_DEFAULT_NAT ); + interfaceDevice.setSource( QemuMetaData.NETWORK_BRIDGE_NAT_DEFAULT ); break; } } else { @@ -819,15 +819,15 @@ public class QemuMetaData extends switch ( type ) { case BRIDGED: interfaceDevice.setType( Interface.Type.BRIDGE ); - interfaceDevice.setSource( QemuMetaData.NETWORK_DEFAULT_BRIDGE ); + interfaceDevice.setSource( QemuMetaData.NETWORK_BRIDGE_LAN_DEFAULT ); break; case HOST_ONLY: - interfaceDevice.setType( Interface.Type.NETWORK ); - interfaceDevice.setSource( QemuMetaData.NETWORK_DEFAULT_HOST_ONLY ); + interfaceDevice.setType( Interface.Type.BRIDGE ); + interfaceDevice.setSource( QemuMetaData.NETWORK_BRIDGE_HOST_ONLY_DEFAULT ); break; case NAT: - interfaceDevice.setType( Interface.Type.NETWORK ); - interfaceDevice.setSource( QemuMetaData.NETWORK_DEFAULT_NAT ); + interfaceDevice.setType( Interface.Type.BRIDGE ); + interfaceDevice.setSource( QemuMetaData.NETWORK_BRIDGE_NAT_DEFAULT ); break; } } diff --git a/src/test/java/org/openslx/vm/QemuMetaDataTest.java b/src/test/java/org/openslx/vm/QemuMetaDataTest.java index 869d0f5..30607db 100644 --- a/src/test/java/org/openslx/vm/QemuMetaDataTest.java +++ b/src/test/java/org/openslx/vm/QemuMetaDataTest.java @@ -512,17 +512,17 @@ public class QemuMetaDataTest case BRIDGED: assertEquals( Interface.Type.BRIDGE, addedEthernetDevice.getType() ); assertEquals( Interface.Model.VIRTIO, addedEthernetDevice.getModel() ); - assertEquals( QemuMetaData.NETWORK_DEFAULT_BRIDGE, addedEthernetDevice.getSource() ); + assertEquals( QemuMetaData.NETWORK_BRIDGE_LAN_DEFAULT, addedEthernetDevice.getSource() ); break; case HOST_ONLY: - assertEquals( Interface.Type.NETWORK, addedEthernetDevice.getType() ); + assertEquals( Interface.Type.BRIDGE, addedEthernetDevice.getType() ); assertEquals( Interface.Model.VIRTIO, addedEthernetDevice.getModel() ); - assertEquals( QemuMetaData.NETWORK_DEFAULT_HOST_ONLY, addedEthernetDevice.getSource() ); + assertEquals( QemuMetaData.NETWORK_BRIDGE_HOST_ONLY_DEFAULT, addedEthernetDevice.getSource() ); break; case NAT: - assertEquals( Interface.Type.NETWORK, addedEthernetDevice.getType() ); + assertEquals( Interface.Type.BRIDGE, addedEthernetDevice.getType() ); assertEquals( Interface.Model.VIRTIO, addedEthernetDevice.getModel() ); - assertEquals( QemuMetaData.NETWORK_DEFAULT_NAT, addedEthernetDevice.getSource() ); + assertEquals( QemuMetaData.NETWORK_BRIDGE_NAT_DEFAULT, addedEthernetDevice.getSource() ); break; } |