Maor Lipchuk has posted comments on this change.
Change subject: core: add the image block alignment scan
......................................................................
Patch Set 4: (7 inline comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ScanDiskAlignmentCommand.java
Line 33:
Line 34:
Line 35: @LockIdNameAttribute
Line 36: @NonTransactiveCommandAttribute(forceCompensation = true)
Line 37: public class ScanDiskAlignmentCommand<T extends
ScanDiskAlignmentParameters> extends CommandBase<T> {
Can u please add a Test for that command?
Line 38: private static final long serialVersionUID = -7266894047095142486L;
Line 39:
Line 40: private Disk diskToScan;
Line 41: private List<VM> vmList;
Line 55:
Line 56: @Override
Line 57: protected boolean canDoAction() {
Line 58: if (getDisk() == null) {
Line 59: return
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_EXIST);
Where do you add the type and the operation.
probably setActionMessageParameters method should be added.
Line 60: }
Line 61:
Line 62: if (getVms() == null || getVms().isEmpty()) {
Line 63: return
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_IS_NOT_VM_DISK);
Line 59: return
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_EXIST);
Line 60: }
Line 61:
Line 62: if (getVms() == null || getVms().isEmpty()) {
Line 63: return
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_IS_NOT_VM_DISK);
I don't think that this message appears in the text messages
Line 64: }
Line 65:
Line 66: if (getDiskType() == DiskStorageType.IMAGE) {
Line 67: DiskImage diskImage = (DiskImage) getDisk();
Line 116:
Line 117: lunParameters.setLunGuid(lunDisk.getLun().getLUN_id());
Line 118:
Line 119: parameters = lunParameters;
Line 120: } else {
else here is redundant, there are no more values in the enum
Line 121: throw new RuntimeException("Unknown DiskStorageType " +
getDiskType().toString());
Line 122: }
Line 123:
Line 124: Boolean isDiskAligned = (Boolean)
getBackend().getResourceManager()
Line 121: throw new RuntimeException("Unknown DiskStorageType " +
getDiskType().toString());
Line 122: }
Line 123:
Line 124: Boolean isDiskAligned = (Boolean)
getBackend().getResourceManager()
Line 125: .RunVdsCommand(VDSCommandType.ScanDiskAlignment,
parameters).getReturnValue();
What about template disk which was copied to more then one domain.
Line 126:
Line 127: getDisk().setAlignment(isDiskAligned ? DiskAlignment.Aligned
: DiskAlignment.Misaligned);
Line 128: getDisk().setLastAlignmentScan(new Date());
Line 129:
Line 154: public Void runInTransaction() {
Line 155:
getCompensationContext().snapshotEntityStatus(diskImage.getImage(), imgStatus);
Line 156: getCompensationContext().stateChanged();
Line 157: diskImage.setImageStatus(ImageStatus.LOCKED);
Line 158:
ImagesHandler.updateImageStatus(diskImage.getImage().getId(),
ImageStatus.LOCKED);
/s/diskImage.getImage().getId()/diskImage.getImageId()
Line 159: return null;
Line 160: }});
Line 161: }
Line 162: }
....................................................
Commit Message
Line 3: AuthorDate: 2013-02-25 11:02:51 -0500
Line 4: Commit: Federico Simoncelli <[email protected]>
Line 5: CommitDate: 2013-02-25 12:04:33 -0500
Line 6:
Line 7: core: add the image block alignment scan
Can u please elaborate what it is used for
Line 8:
Line 9: Change-Id: I4858b7bbfa453230fcafecfbc5358c715d5d825b
--
To view, visit http://gerrit.ovirt.org/11946
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I4858b7bbfa453230fcafecfbc5358c715d5d825b
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches