Liron Ar has posted comments on this change.

Change subject: core: UpdateVmCommand: Shared disk boot status
......................................................................


Patch Set 4: Looks good to me, but someone else must approve

(4 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddDiskCommand.java
Line 270:     protected SnapshotDao getSnapshotDao() {
Line 271:         return DbFacade.getInstance().getSnapshotDao();
Line 272:     }
Line 273: 
Line 274:     @Override
do we even need this method?
Line 275:     protected BaseDiskDao getBaseDiskDao() {
Line 276:         return DbFacade.getInstance().getBaseDiskDao();
Line 277:     }
Line 278: 


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmDiskCommand.java
Line 40:     private static final long serialVersionUID = 5915267156998835363L;
Line 41:     private List<PermissionSubject> listPermissionSubjects;
Line 42:     protected final Disk oldDisk;
Line 43:     protected final Disk newDisk;
Line 44:     private Map<Guid, List<Disk>> otherVmDisks = new HashMap<Guid, 
List<Disk>>();
Perhaps it'll be better to not have this map as a member
Line 45:     private Map<String, Pair<String, String>> sharedLockMap;
Line 46:     private Map<String, Pair<String, String>> exclusiveLockMap;
Line 47: 
Line 48:     public UpdateVmDiskCommand(T parameters) {


Line 142: 
Line 143:     protected List<Disk> getOtherVmDisks(Guid vmId) {
Line 144:         List<Disk> disks = otherVmDisks.get(vmId);
Line 145:         if (disks == null) {
Line 146:             disks = getDiskDao().getAllForVm(vmId);
perhaps we could add a stored procedure to perform it within the db and save 
this - but that's up to you, i understand if you prefer to leave it like that
Line 147:             disks.removeAll(LinqUtils.filter(disks, new 
Predicate<Disk>() {
Line 148:                 @Override
Line 149:                 public boolean eval(Disk evalDisk) {
Line 150:                     return evalDisk.getId().equals(oldDisk.getId());


Line 143:     protected List<Disk> getOtherVmDisks(Guid vmId) {
Line 144:         List<Disk> disks = otherVmDisks.get(vmId);
Line 145:         if (disks == null) {
Line 146:             disks = getDiskDao().getAllForVm(vmId);
Line 147:             disks.removeAll(LinqUtils.filter(disks, new 
Predicate<Disk>() {
perhaps instead of the remove, just add to a list if the id is different then 
the edited disk id..should be much better.
Line 148:                 @Override
Line 149:                 public boolean eval(Disk evalDisk) {
Line 150:                     return evalDisk.getId().equals(oldDisk.getId());
Line 151:                 }


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I6a9d2e8800b9bf693fc55d8a627e0725277985ac
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Alissa Bonas <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Liron Ar <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Tal Nisan <[email protected]>
Gerrit-Reviewer: Vered Volansky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to