Skip to content

Commit fe18cd5

Browse files
Edison SuEdison Su
authored andcommitted
bug 13845: as you can't add physical devices name from UI when you create zone, use kvm.{guest|public|private}.devices in the global configuration.
status 13845: resolved fixed Reviewed-by: frank
1 parent 9ea2140 commit fe18cd5

1 file changed

Lines changed: 10 additions & 14 deletions

File tree

‎server/src/com/cloud/hypervisor/kvm/discoverer/KvmServerDiscoverer.java‎

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -183,25 +183,21 @@ public Map<? extends ServerResource, Map<String, String>> find(long dcId,
183183

184184
List<PhysicalNetworkSetupInfo> networks = _networkMgr.getPhysicalNetworkInfo(dcId, HypervisorType.KVM);
185185
if (networks.size() < 1) {
186-
_kvmPublicNic = "cloudbr0";
187-
_kvmPrivateNic = "cloudbr0";
188-
_kvmGuestNic = "cloudbr0";
189-
s_logger.debug("Can't find physical network devices on zone: " + dcId + ", use the default cloudbr0");
186+
s_logger.debug("Can't find physical network devices on zone: " + dcId + ", use the default from kvm.{private|public|guest}.devices");
190187
} else {
191188
PhysicalNetworkSetupInfo network = networks.get(0);
192-
_kvmPublicNic = network.getPublicNetworkName();
193-
if (_kvmPublicNic == null) {
194-
_kvmPublicNic = "cloudbr0";
189+
String pubNetName = network.getPublicNetworkName();
190+
if (pubNetName != null) {
191+
_kvmPublicNic = pubNetName;
195192
}
196-
_kvmPrivateNic = network.getPrivateNetworkName();
197-
if (_kvmPrivateNic == null) {
198-
_kvmPrivateNic = _kvmPublicNic;
193+
String prvNetName = network.getPrivateNetworkName();
194+
if (prvNetName != null) {
195+
_kvmPrivateNic = prvNetName;
199196
}
200-
_kvmGuestNic = network.getGuestNetworkName();
201-
if (_kvmGuestNic == null) {
202-
_kvmGuestNic = _kvmPrivateNic;
197+
String guestNetName = network.getGuestNetworkName();
198+
if (guestNetName != null) {
199+
_kvmGuestNic = guestNetName;
203200
}
204-
205201
}
206202

207203
String parameters = " -m " + _hostIp + " -z " + dcId + " -p " + podId + " -c " + clusterId + " -g " + guid + " -a";

0 commit comments

Comments
 (0)