Federico Simoncelli has posted comments on this change.

Change subject: [wip] backend: add the import glance image support
......................................................................


Patch Set 2: (8 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportRepoImageCommand.java
Line 98:         setSucceeded(true);
Line 99:     }
Line 100: 
Line 101:     @Override
Line 102:     protected void setActionMessageParameters() {
I know this has to be checked/completed. Suggestions?
Line 103:         addCanDoActionMessage(VdcBllMessages.VAR__ACTION__MOVE);
Line 104:         addCanDoActionMessage(VdcBllMessages.VAR__TYPE__VM_DISK);
Line 105:     }
Line 106: 


Line 126:         return getParameters().getDiskImage();
Line 127:     }
Line 128: 
Line 129:     @Override
Line 130:     protected boolean canDoAction() {
The implementation here is obviously still missing. Suggestions about the 
checks?
Line 131:         getDiskImage();
Line 132:         return true;
Line 133:     }


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportRepoImageCopyTaskHandler.java
Line 113:         return AsyncTaskType.deleteImage;
Line 114:     }
Line 115: 
Line 116:     @Override
Line 117:     protected VDSParametersBase getRevertVDSParameters() {
Since this is not working (x-ref: derez) I probably have to remove it and just 
leave the ImageStatus.ILLEGAL stuff (revertTask).
Line 118:         DeleteImageGroupVDSCommandParameters parameters = new 
DeleteImageGroupVDSCommandParameters();
Line 119:         
parameters.setStoragePoolId(getEnclosingCommand().getParameters().getStoragePoolId());
Line 120:         
parameters.setStorageDomainId(getEnclosingCommand().getParameters().getStorageDomainId());
Line 121:         
parameters.setImageGroupId(getEnclosingCommand().getParameters().getImageGroupID());


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportRepoImageCreateTaskHandler.java
Line 67:             if (vdcReturnValue.getActionReturnValue() != null) {
Line 68:                 DiskImage newDiskImage = (DiskImage) 
vdcReturnValue.getActionReturnValue();
Line 69:                 
enclosingCommand.getParameters().setDestinationImageId(newDiskImage.getImageId());
Line 70: 
Line 71:                 /* NullPointer Exception
Not working, getCurrentUser() always null. Not sure if it's relevant.
Line 72:                 permissions perms = new 
permissions(getCurrentUser().getUserId(),
Line 73:                         PredefinedRoles.DISK_OPERATOR.getId(), 
diskImage.getId(), VdcObjectType.Disk);
Line 74:                 MultiLevelAdministrationHandler.addPermission(perms);
Line 75:                 */


Line 104:     public void endSuccessfully() {
Line 105:     }
Line 106: 
Line 107:     @Override
Line 108:     public void compensate() {
I have the feeling that this is not running / working. Can anyone quickly spot 
the issue?
Line 109:         RemoveImageParameters removeImageParams =
Line 110:                 new 
RemoveImageParameters(enclosingCommand.getParameters().getImageGroupID());
Line 111:         
removeImageParams.setStorageDomainId(enclosingCommand.getParameters().getStorageDomainId());
Line 112:         removeImageParams.setParentCommand(VdcActionType.RemoveImage);


Line 135:         return null;
Line 136:     }
Line 137: 
Line 138:     @Override
Line 139:     public void endWithFailure() {
Unsure. Comments?
Line 140:     }


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/provider/OpenstackImageProviderProxy.java
Line 218: 
Line 219:         return diskImage;
Line 220:     }
Line 221: 
Line 222:     private long getCowVirtualSize(String id) throws IOException {
Fun
Line 223:         // For the qcow2 format we need to download the image header 
and read the virtual size from there
Line 224:         byte[] imgContent = new byte[72];
Line 225:         ImageDownload downloadImage = 
getGlanceClient().images().download(id).execute();
Line 226: 


....................................................
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/ImportRepoImageParameters.java
Line 2: 
Line 3: import org.ovirt.engine.core.common.businessentities.DiskImage;
Line 4: import org.ovirt.engine.core.compat.Guid;
Line 5: 
Line 6: public class ImportRepoImageParameters extends 
ImagesActionsParametersBase {
I have the feeling that I can trim the parameters. Suggestions?
Line 7: 
Line 8:     private static final long serialVersionUID = 8168949491104775480L;
Line 9: 
Line 10:     private String sourceRepoImageId;


-- 
To view, visit http://gerrit.ovirt.org/16082
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I6b3e9497b633bd2ad32b896aea0aaab80634f2a7
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimo...@redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimo...@redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to