Maor Lipchuk has posted comments on this change. Change subject: core: Add a validation when deactivate ISO domain. ......................................................................
Patch Set 4: (5 comments) .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/DeactivateStorageDomainCommand.java Line 126: .isEmpty()) { Line 127: addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_DETECTED_ACTIVE_VMS); Line 128: return false; Line 129: } Line 130: if (getStorageDomain().getStorageDomainType() == StorageDomainType.ISO) { done. Line 131: addWarningForVmsWithAttachedDisk(); Line 132: } Line 133: if (getStoragePool().getspm_vds_id() != null) { Line 134: // In case there are running tasks in the pool, it is impossible to deactivate the master storage domain Line 154: vmNames.add(vmStatic.getName()); Line 155: } Line 156: } Line 157: if (!vmNames.isEmpty()) { Line 158: getReturnValue().getCanDoActionMessages().add(String.format("$VmNames %s", StringUtils.join(vmNames, ","))); 1. done 2. It doesn't matter, but I don't mind changing it just that it will be more clear Line 159: addCanDoActionMessage(VdcBllMessages.ERROR_CANNOT_DEACTIVATE_DOMAIN_WITH_TASKS); Line 160: } Line 161: } Line 162: Line 155: } Line 156: } Line 157: if (!vmNames.isEmpty()) { Line 158: getReturnValue().getCanDoActionMessages().add(String.format("$VmNames %s", StringUtils.join(vmNames, ","))); Line 159: addCanDoActionMessage(VdcBllMessages.ERROR_CANNOT_DEACTIVATE_DOMAIN_WITH_TASKS); fixed Line 160: } Line 161: } Line 162: Line 163: /** Line 394: .getVmDeviceDao() Line 395: .getVmDeviceByVmIdTypeAndDevice(vmId, Line 396: VmDeviceGeneralType.DISK, Line 397: VmDeviceType.FLOPPY.getName()); Line 398: for (VmDevice cdDevice : floppyList) { I will just do one loop as Allon suggested earlier Line 399: String path = (String) cdDevice.getSpecParams().get("path"); Line 400: if (path != null && path != "") { Line 401: return false; Line 402: } Line 396: VmDeviceGeneralType.DISK, Line 397: VmDeviceType.FLOPPY.getName()); Line 398: for (VmDevice cdDevice : floppyList) { Line 399: String path = (String) cdDevice.getSpecParams().get("path"); Line 400: if (path != null && path != "") { IIRC If the VM has no attached CD then the path will be empty, not sure about null, but I will get back to you on that one. Line 401: return false; Line 402: } Line 403: } Line 404: return true; -- To view, visit http://gerrit.ovirt.org/20331 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I47c1a8155762ecd0b04bb17676151946982bb919 Gerrit-PatchSet: 4 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Maor Lipchuk <mlipc...@redhat.com> Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Daniel Erez <de...@redhat.com> Gerrit-Reviewer: Liron Ar <lara...@redhat.com> Gerrit-Reviewer: Maor Lipchuk <mlipc...@redhat.com> Gerrit-Reviewer: Sergey Gotliv <sgot...@redhat.com> Gerrit-Reviewer: Tal Nisan <tni...@redhat.com> Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches