Michael Pasternak has posted comments on this change.

Change subject: core, restapi: Introducing support for attaching disk snapshot
......................................................................


Patch Set 31:

(4 comments)

....................................................
File 
backend/manager/modules/restapi/interface/common/jaxrs/src/main/java/org/ovirt/engine/api/common/util/LinkHelper.java
Line 693:     public static <R extends BaseResource> R addLinks(UriInfo 
uriInfo, R model, Class<? extends BaseResource> suggestedParentType, boolean 
addActions) {
Line 694:         setHref(uriInfo, model, suggestedParentType);
Line 695:         if (addActions) {
Line 696:             setActions(uriInfo, model, suggestedParentType);
Line 697:         }
something went wrong, we have back-links all over and never have to deal with 
actions at the objects that represented as links, e.g <object id=xxx 
href=/api/xxx>
Line 698: 
Line 699:         for (BaseResource inline : getInlineResources(model)) {
Line 700:             if (inline.getId() != null) {
Line 701:                 setHref(uriInfo, inline);


....................................................
File 
backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml
Line 534:           disk.size: xs:int #deprecated, replaced by 
'provisioned_size'
Line 535:           disk.sparse: xs:boolean
Line 536:           disk.bootable: xs:boolean
Line 537:           disk.shareable: xs:boolean
Line 538:           disk.snapshot.id: xs:string
this is not enough, this is all new/different functionality, it should be as 
stand along signature where snapshot details are mandatory
Line 539:           disk.propagate_errors: xs:boolean
Line 540:           disk.wipe_after_delete: xs:boolean
Line 541:           disk.storage_domains.storage_domain--COLLECTION: 
{storage_domain.id|name: 'xs:string'}
Line 542:         description: add a new disk to the virtual machine allocating 
space from the storage domain


....................................................
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendVmDisksResource.java
Line 124:                             new 
IdQueryParameters(Guid.createGuidFromString(snapshotInfo.getId())));
Line 125:             if (queryReturnValue.getSucceeded() && 
queryReturnValue.getReturnValue() != null) {
Line 126:                 
org.ovirt.engine.core.common.businessentities.Snapshot snapshot = 
queryReturnValue.getReturnValue();
Line 127:                 VM vm = new VM();
Line 128:                 vm.setId(snapshot.getVmId().toString());
allright, but iirc businessentities.Snapshot has getVmId() ..., so you can make 
sure it's mapped to public snapshot and then reused it here,

this way you save this query.
Line 129:                 snapshotInfo.setVm(vm);
Line 130:                 model.setSnapshot(snapshotInfo);
Line 131:             }
Line 132:             LinkHelper.addLinks(getUriInfo(), snapshotInfo, null, 
false);


....................................................
File 
backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/DiskMapper.java
Line 112:         if (disk.isSetStatus()) {
Line 113:             
diskImage.setImageStatus(map(DiskStatus.fromValue(disk.getStatus().getState())));
Line 114:         }
Line 115:         if (disk.isSetSnapshot() && disk.getSnapshot().isSetId()) {
Line 116:             
diskImage.setVmSnapshotId(GuidUtils.asGuid(disk.getSnapshot().getId()));
indeed, but you need to add postPopulate() and verify() entries there
Line 117:         }
Line 118:         if (disk.isSetSparse()) {
Line 119:             diskImage.setVolumeType(disk.isSparse() ? 
VolumeType.Sparse : VolumeType.Preallocated);
Line 120:         }


-- 
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: 31
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Liron Ar <lara...@redhat.com>
Gerrit-Reviewer: Alissa Bonas <abo...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Ayal Baron <aba...@redhat.com>
Gerrit-Reviewer: Daniel Erez <de...@redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimo...@redhat.com>
Gerrit-Reviewer: Liron Ar <lara...@redhat.com>
Gerrit-Reviewer: Maor Lipchuk <mlipc...@redhat.com>
Gerrit-Reviewer: Michael Pasternak <mpast...@redhat.com>
Gerrit-Reviewer: Sergey Gotliv <sgot...@redhat.com>
Gerrit-Reviewer: Tal Nisan <tni...@redhat.com>
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

Reply via email to