[Engine-patches] Change in ovirt-engine[master]: core: Use import command to register a VM

ahadas at redhat.com ahadas at redhat.com
Wed May 21 11:50:39 UTC 2014


Arik Hadas has posted comments on this change.

Change subject: core: Use import command to register a VM
......................................................................


Patch Set 20:

(2 comments)

http://gerrit.ovirt.org/#/c/27247/20/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmCommand.java
File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmCommand.java:

Line 243:             return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_IMPORT_CLONE_NOT_COLLAPSED);
Line 244:         }
Line 245: 
Line 246:         if (isImagesAlreadyOnTarget() && getParameters().getCopyCollapse()) {
Line 247:             return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_IMPORT_UNREGISTERED_NOT_COLLAPSED);
Note that the combination of #242 and #246 means that we won't be able to import unregistered VM as new entity, and we do allow it for templates - why can't we import an unregistered VM as new entity (with copy-collapse) ?
Line 248:         }
Line 249: 
Line 250:         setSourceDomainId(getParameters().getSourceDomainId());
Line 251:         StorageDomainValidator validator = new StorageDomainValidator(getSourceDomain());


Line 610:         boolean verified = true;
Line 611:         if (!getParameters().isImportAsNewEntity() && !isImagesAlreadyOnTarget()) {
Line 612:             verified = checkIfDisksExist(imageList);
Line 613:         }
Line 614:         return verified;
ok, so if we keep this method, can you please remove the 'verified' variable? it is not really needed, and then people will add more logic into this method and we'll end-up with complicated methods like the old canDoAction methods..
Line 615:     }
Line 616: 
Line 617:     private boolean templateExists() {
Line 618:         if (getVmTemplate() == null && !getParameters().getCopyCollapse()) {


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I5ee64651eb614feb6ac9d7fde88a4ee6348aff06
Gerrit-PatchSet: 20
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Maor Lipchuk <mlipchuk at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Arik Hadas <ahadas at redhat.com>
Gerrit-Reviewer: Daniel Erez <derez at redhat.com>
Gerrit-Reviewer: Liron Ar <laravot at redhat.com>
Gerrit-Reviewer: Maor Lipchuk <mlipchuk at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes



More information about the Engine-patches mailing list