Source:
private Map<String, Object> generateNetworks() { Map<String, Object> networks = new HashMap<String, Object>(); NetworkQoSDao qosDao = getDbFacade().getQosDao(); for (Network network : getParameters().getNetworks()) { Map<String, Object> opts = new HashMap<String, Object>(); VdsNetworkInterface iface = findNetworkInterface(network.getName(), getParameters().getInterfaces(), getParameters().getBonds()); String ifaceNameWithoutVlan = NetworkUtils.stripVlan(iface.getName()); Boolean bonded = findInterfaceByName(ifaceNameWithoutVlan).getBonded(); String type = (bonded != null && bonded) ? "bonding" : "nic"; opts.put(type, ifaceNameWithoutVlan); if (NetworkUtils.isVlan(network)) { opts.put("vlan", network.getVlanId().toString()); } if (iface.getBootProtocol() != null) { addBootProtocol(opts, iface); } if (network.getMtu() != 0) { opts.put("mtu", String.valueOf(network.getMtu())); } opts.put("bridged", Boolean.toString(network.isVmNetwork())); if (network.isVmNetwork()) { opts.put(VdsProperties.STP, network.getStp() ? "yes" : "no"); } if ((iface.isQosOverridden() ? iface.getQos() != null : network.getQosId() != null) && FeatureSupported.hostNetworkQos(getDbFacade().getVdsDao() .get(getParameters().getVdsId()) .getVdsGroupCompatibilityVersion())) { NetworkQosMapper qosMapper = new NetworkQosMapper(opts, VdsProperties.HOST_QOS_INBOUND, VdsProperties.HOST_QOS_OUTBOUND); qosMapper.serialize(iface.isQosOverridden() ? iface.getQos() : qosDao.get(network.getQosId())); } networks.put(network.getName(), opts); } for (String net : getParameters().getRemovedNetworks()) { networks.put(net, REMOVE_OBJ); } return networks; }

Target:
private Map<String, Object> generateNetworks() { Map<String, Object> networks = new HashMap<String, Object>(); NetworkQoSDao qosDao = getDbFacade().getQosDao(); for (Network network : getParameters().getNetworks()) { Map<String, Object> opts = new HashMap<String, Object>(); VdsNetworkInterface iface = findNetworkInterface(network.getName(), getParameters().getInterfaces(), getParameters().getBonds()); String ifaceNameWithoutVlan = NetworkUtils.stripVlan(iface.getName()); Boolean bonded = findInterfaceByName(ifaceNameWithoutVlan).getBonded(); String type = (bonded != null && bonded) ? "bonding" : "nic"; opts.put(type, ifaceNameWithoutVlan); if (NetworkUtils.isVlan(network)) { opts.put("vlan", network.getVlanId().toString()); } if (iface.getBootProtocol() != null) { addBootProtocol(opts, iface); } if (network.getMtu() != 0) { opts.put("mtu", String.valueOf(network.getMtu())); } opts.put("bridged", Boolean.toString(network.isVmNetwork())); if (network.isVmNetwork()) { opts.put(VdsProperties.STP, network.getStp() ? "yes" : "no"); } if (qosConfiguredOnInterface(iface, network) && FeatureSupported.hostNetworkQos(getDbFacade().getVdsDao() .get(getParameters().getVdsId()) .getVdsGroupCompatibilityVersion())) { NetworkQosMapper qosMapper = new NetworkQosMapper(opts, VdsProperties.HOST_QOS_INBOUND, VdsProperties.HOST_QOS_OUTBOUND); qosMapper.serialize(iface.isQosOverridden() ? iface.getQos() : qosDao.get(network.getQosId())); } networks.put(network.getName(), opts); } for (String net : getParameters().getRemovedNetworks()) { networks.put(net, REMOVE_OBJ); } return networks; }