Maor Lipchuk has posted comments on this change. Change subject: core: save memory state on live snapshot with memory ......................................................................
Patch Set 17: (6 inline comments) .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CreateAllSnapshotsFromVmCommand.java Line 118: Line 119: MemoryImageBuilder memoryImageBuilder = createMemoryImageBuilder(); Line 120: addSnapshotToDB(createdSnapshotId, memoryImageBuilder); Line 121: createSnapshotsForDisks(newActiveSnapshotId); Line 122: memoryImageBuilder.build(); What will happen if you will get VDSM execption? If I'm not mistaking engine will get internal error. If that is the case we should use here try/catch and add an appropriate audit log Line 123: Line 124: if (getTaskIdList().isEmpty()) { Line 125: getParameters().setTaskGroupSuccess(true); Line 126: incrementVmGeneration(); Line 128: setSucceeded(true); Line 129: } Line 130: Line 131: @Override Line 132: public NGuid getStorageDomainId() { I would rename this method to something more meaningful such as getStorageDomainForVmMem. I don't like Using the method getStorageDomainId since the audit log implementation is using it also, Line 133: if (cachedStorageDomainId.equals(Guid.Empty) && getVm() != null) { Line 134: long sizeNeeded = getVm().getTotalMemorySizeInBytes() / BYTES_IN_GB; Line 135: StorageDomain storageDomain = VmHandler.findStorageDomainForMemory(getVm().getStoragePoolId(), sizeNeeded); Line 136: if (storageDomain != null) { Line 524: VDSReturnValue retVal = Line 525: Backend Line 526: .getInstance() Line 527: .getResourceManager() Line 528: .RunVdsCommand( Use runVdsCommand instead backend... Line 529: VDSCommandType.CreateImage, Line 530: new CreateImageVDSCommandParameters(getVm().getStoragePoolId(), Line 531: getStorageDomainId() Line 532: .getValue(), Line 540: .toString())); Line 541: Line 542: if (!retVal.getSucceeded()) { Line 543: throw new VdcBLLException(VdcBllErrors.VolumeCreationError, Line 544: "CreateAllSnapshotsFromVmCommand::executeVmCommand: Failed to create image for vm configuration!"); Remove the prefix CreateAllSnapshotsFromVmCommand::executeVmCommand: Line 545: } Line 546: Line 547: Guid guid = createTask(retVal.getCreationInfo(), VdcActionType.CreateAllSnapshotsFromVm); Line 548: getTaskIdList().add(guid); Line 552: VDSReturnValue retVal = Line 553: Backend Line 554: .getInstance() Line 555: .getResourceManager() Line 556: .RunVdsCommand( use runVdsCommand instead Backend.... Line 557: VDSCommandType.CreateImage, Line 558: new CreateImageVDSCommandParameters( Line 559: storagePoolId, Line 560: storageDomainId, Line 567: getStoragePool().getcompatibility_version().toString())); Line 568: Line 569: if (!retVal.getSucceeded()) { Line 570: throw new VdcBLLException(VdcBllErrors.VolumeCreationError, Line 571: "CreateAllSnapshotsFromVmCommand::executeVmCommand: Failed to create image for memory!"); No need to add "CreateAllSnapshotsFromVmCommand::executeVmCommand:" Line 572: } Line 573: Line 574: Guid guid = Line 575: createTask(retVal.getCreationInfo(), -- To view, visit http://gerrit.ovirt.org/14291 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifbb28efda1b63e506233a88399488a256e6ab1c8 Gerrit-PatchSet: 17 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 Ar <lara...@redhat.com> Gerrit-Reviewer: Maor Lipchuk <mlipc...@redhat.com> Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com> Gerrit-Reviewer: Roy Golan <rgo...@redhat.com> Gerrit-Reviewer: oVirt Jenkins CI Server _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches