Mike Kolesnik has posted comments on this change.
Change subject: engine: Extending migrate verb with an additional parameter-
"dstqemu"
......................................................................
Patch Set 4: (5 inline comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java
Line 151: }
Line 152: ExecutionHandler.setAsyncJob(getExecutionContext(), true);
Line 153: }
Line 154:
Line 155: private String getMigrationNetworkIp() {
No need to do this when feature is not supported
Line 156: // Find migrationNetworkCluster
Line 157: List<NetworkCluster> allNetworksInCluster =
DbFacade.getInstance()
Line 158:
.getNetworkClusterDao().getAllForCluster(getVm().getVdsGroupId());
Line 159: NetworkCluster migrationNetworkCluster = null;
Line 153: }
Line 154:
Line 155: private String getMigrationNetworkIp() {
Line 156: // Find migrationNetworkCluster
Line 157: List<NetworkCluster> allNetworksInCluster =
DbFacade.getInstance()
You can use the getAllForCluster method from NetworkDao which already gives you
the network as well
Line 158:
.getNetworkClusterDao().getAllForCluster(getVm().getVdsGroupId());
Line 159: NetworkCluster migrationNetworkCluster = null;
Line 160:
Line 161: for (NetworkCluster tempNetworkCluster :
allNetworksInCluster) {
Line 180: final List<VdsNetworkInterface> allInterfacesForDstVds =
Line 181:
DbFacade.getInstance().getInterfaceDao().getAllInterfacesForVds(getDestinationVds().getId());
Line 182:
Line 183: for (VdsNetworkInterface nic : allInterfacesForDstVds) {
Line 184: if (nic.getNetworkName() != null &&
nic.getNetworkName().equals(migrationNetworkName)) {
You could more simply write:
migrationNetworkName.equals(nic.getNetworkName())
Line 185: migrationIp = nic.getAddress();
Line 186: break;
Line 187: }
Line 188: }
....................................................
File
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/MigrateBrokerVDSCommand.java
Line 21: if (parameters.getTunnelMigration() != null) {
Line 22: migrationInfo.put(VdsProperties.TUNNELED,
parameters.getTunnelMigration().toString());
Line 23: }
Line 24:
Line 25: if (parameters.getDstQemu() != null &&
!parameters.getDstQemu().trim().equals("")) {
You could use StringUtils.isNotBlank(parameters.getDstQemu())
Line 26: migrationInfo.put(VdsProperties.dstQemu,
parameters.getDstQemu());
Line 27: }
Line 28: }
Line 29:
....................................................
File
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsProperties.java
Line 253: public static final String online = "online";
Line 254: public static final String domains = "storageDomains";
Line 255: public static final String hooks = "hooks";
Line 256: public static final String TUNNELED = "tunneled";
Line 257: public static final String dstQemu = "dstqemu";
Constant names should be all CAPS
Line 258:
Line 259: // storage domains
Line 260: public static final String code = "code";
Line 261: public static final String lastCheck = "lastCheck";
--
To view, visit http://gerrit.ovirt.org/13064
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic460c2b8ebfb870a610f5816643d9855495dc7b1
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alona Kaplan <[email protected]>
Gerrit-Reviewer: Alona Kaplan <[email protected]>
Gerrit-Reviewer: Mike Kolesnik <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches