Allon Mureinik has posted comments on this change.
Change subject: core: UpdateVmCommand: Shared disk boot status
......................................................................
Patch Set 1: (4 inline comments)
....................................................
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>>();
fair enough - can you suggest a better name.
I started out with disksNotUpdatedInVMs, but that looks disgusting.
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 147:
Line 148: protected List<Disk> getOtherVmDisks(Guid vmId) {
Line 149: List<Disk> disks = otherVmDisks.get(vmId);
Line 150: if (disks == null) {
Line 151: disks = getDiskDao().getAllForVm(vmId);
I can't see a decent way of doing this query without re-working a lot of DAO
code, and I don't think it's worth the fuss.
Making a shared disk bootable after it's a attached to several VMs is a pretty
rare scenario, so if its takes a couple of more seconds, it worth it to make
sure you'll actually be able to run your VMs later
Line 152: disks.removeAll(LinqUtils.filter(disks, new
Predicate<Disk>() {
Line 153: @Override
Line 154: public boolean eval(Disk o) {
Line 155: return o.getId().equals(oldDisk.getId());
Line 150: if (disks == null) {
Line 151: disks = getDiskDao().getAllForVm(vmId);
Line 152: disks.removeAll(LinqUtils.filter(disks, new
Predicate<Disk>() {
Line 153: @Override
Line 154: public boolean eval(Disk o) {
sorry, missed it in the last round - will do.
Line 155: return o.getId().equals(oldDisk.getId());
Line 156: }
Line 157: }));
Line 158: otherVmDisks.put(vmId, disks);
....................................................
Commit Message
Line 6:
Line 7: core: UpdateVmCommand: Shared disk boot status
Line 8:
Line 9: Check the boot status of a disk against all the VMs it's attached to,
Line 10: not only the one it's context is edited in.
Done
Line 11:
Line 12: Change-Id: I6a9d2e8800b9bf693fc55d8a627e0725277985ac
Line 13: Bug-Url: https://bugzilla.redhat.com/854964
--
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: 1
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