Maor Lipchuk has posted comments on this change. Change subject: core: fix removal of attached disks to stateless vm ......................................................................
Patch Set 3: (3 comments) Don't we want the user to unplug those disks instead doing that automatically, since he is the one which attach them at the first place? http://gerrit.ovirt.org/#/c/36035/3/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RestoreStatelessVmCommand.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RestoreStatelessVmCommand.java: Line 71: Line 72: Set<Guid> disksWithStatelessSnapshot = new HashSet<>(); Line 73: for (DiskImage statelessDiskSnapshot : statelessDiskSnapshots) { Line 74: disksWithStatelessSnapshot.add(statelessDiskSnapshot.getId()); Line 75: } Please use Entities.getIds(...) Line 76: Line 77: for (DiskImage activeDiskSnapshot : activeDiskSnapshots) { Line 78: if (!disksWithStatelessSnapshot.contains(activeDiskSnapshot.getId())) { Line 79: VdcReturnValueBase returnValue = runInternalAction ( Line 78: if (!disksWithStatelessSnapshot.contains(activeDiskSnapshot.getId())) { Line 79: VdcReturnValueBase returnValue = runInternalAction ( Line 80: VdcActionType.DetachDiskFromVm, Line 81: new AttachDetachVmDiskParameters( Line 82: getVmId(), activeDiskSnapshot.getId(), false, false)); I assume that we want that when a failure occurs the disks which were already detached will not be attached again (rollback)? Do we have any compensation here? Line 83: Line 84: if (!returnValue.getSucceeded()) { Line 85: return false; Line 86: } Line 81: new AttachDetachVmDiskParameters( Line 82: getVmId(), activeDiskSnapshot.getId(), false, false)); Line 83: Line 84: if (!returnValue.getSucceeded()) { Line 85: return false; I think we don't have an audit log indicating that we failed to detach a Disk from a VM? we should indicate this somehow, otherwise the user will not know which disk sabotage his attempts of stopping the VM. Please also add a log here indicating the disk id which failed the detach and stopped the process Line 86: } Line 87: } Line 88: } Line 89: -- To view, visit http://gerrit.ovirt.org/36035 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3a1d6eb8d2f4606622c7ed5c73370792406bb9b3 Gerrit-PatchSet: 3 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Arik Hadas <aha...@redhat.com> Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Arik Hadas <aha...@redhat.com> Gerrit-Reviewer: Liron Aravot <lara...@redhat.com> Gerrit-Reviewer: Maor Lipchuk <mlipc...@redhat.com> Gerrit-Reviewer: Michal Skrivanek <mskri...@redhat.com> Gerrit-Reviewer: Shahar Havivi <shav...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org 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