Liron Ar has posted comments on this change. Change subject: core, restapi: Introducing support for attaching disk snapshot ......................................................................
Patch Set 36: (6 comments) .................................................... Commit Message Line 30: Line 31: 2. POST the copied disk XML to: Line 32: http://SERVER:PORT/api/vms/GUID/disks/ Line 33: Line 34: Patch with lock handling is dependent on this one to ease the review. no difference imo, we can squash them when merging Line 35: Line 36: OPEN ISSUES: Line 37: UI - would be handled in a following patch (the Line 38: information is accessible through REST) .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AbstractDiskVmCommand.java Line 117: } Line 118: Line 119: protected boolean isDiskCanBeAddedToVm(Disk diskInfo, VM vm) { Line 120: if (!diskInfo.isDiskSnapshot()) { Line 121: if (diskInfo.isBoot()) { Done Line 122: for (Disk disk : vm.getDiskMap().values()) { Line 123: if (disk.isBoot() && !disk.isDiskSnapshot()) { Line 124: addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_DISK_BOOT_IN_USE); Line 125: getReturnValue().getCanDoActionMessages().add( .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/VmDeviceUtils.java Line 280: boolean hasAlreadyConsoleDevice = false; Line 281: boolean hasVirtioScsiController = false; Line 282: Line 283: for (VmDevice device : devicesDataToUse) { Line 284: if (device.getSnapshotId() != null && !copySnapshotDevices) { I think that it might add confusion to the log and analyzing, as we don't log for other devices that aren't copied (like lun disks). Line 285: continue; Line 286: } Line 287: Line 288: id = Guid.newGuid(); .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/VmValidator.java Line 74: Line 75: return ValidationResult.VALID; Line 76: } Line 77: Line 78: public ValidationResult vmNotHavingDeviceSnapshotsAttachedToOtherVms() { Done Line 79: List<Disk> vmDisks = getDbFacade().getDiskDao().getAllForVm(vm.getId()); Line 80: VM tempVm = new VM(); Line 81: VmHandler.updateDisksForVm(tempVm, vmDisks); Line 82: VmHandler.filterDisksForVM(tempVm, false, false, true); .................................................... File backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilderBase.java Line 43: public int compare(Disk o1, Disk o2) { Line 44: Boolean boot1 = o1.isBoot(); Line 45: Boolean boot2 = o2.isBoot(); Line 46: int bootResult = boot1.compareTo(boot2); Line 47: if (bootResult == 0 && o1.isBoot() && o2.isBoot()) { 1. Without referring to the comment content- this is suggestion for refoctor which isn't related to this change, i prefer to not change unrelated code as part of this patch. 2. I prefer to keep the implementation to Allon's suggestion. Line 48: return Boolean.compare(o2.isDiskSnapshot(), o1.isDiskSnapshot()); Line 49: } Line 50: return bootResult; Line 51: } Line 43: public int compare(Disk o1, Disk o2) { Line 44: Boolean boot1 = o1.isBoot(); Line 45: Boolean boot2 = o2.isBoot(); Line 46: int bootResult = boot1.compareTo(boot2); Line 47: if (bootResult == 0 && o1.isBoot() && o2.isBoot()) { Done Line 48: return Boolean.compare(o2.isDiskSnapshot(), o1.isDiskSnapshot()); Line 49: } Line 50: return bootResult; Line 51: } -- To view, visit http://gerrit.ovirt.org/17679 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I02579bf1a91cd294a5040acf432f1fdb87eb18c1 Gerrit-PatchSet: 36 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Liron Ar <[email protected]> Gerrit-Reviewer: Alissa Bonas <[email protected]> Gerrit-Reviewer: Allon Mureinik <[email protected]> Gerrit-Reviewer: Arik Hadas <[email protected]> Gerrit-Reviewer: Ayal Baron <[email protected]> Gerrit-Reviewer: Daniel Erez <[email protected]> Gerrit-Reviewer: Federico Simoncelli <[email protected]> Gerrit-Reviewer: Liron Ar <[email protected]> Gerrit-Reviewer: Maor Lipchuk <[email protected]> Gerrit-Reviewer: Michael Pasternak <[email protected]> Gerrit-Reviewer: Michal Skrivanek <[email protected]> Gerrit-Reviewer: Omer Frenkel <[email protected]> Gerrit-Reviewer: Roy Golan <[email protected]> Gerrit-Reviewer: Sergey Gotliv <[email protected]> Gerrit-Reviewer: Tal Nisan <[email protected]> Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
