Allon Mureinik has posted comments on this change.

Change subject: core: prevent disabling VirtIO-SCSI on edit VM
......................................................................


Patch Set 1:

(2 comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmCommand.java
Line 370:                 
!FeatureSupported.virtIoScsi(getVdsGroup().getcompatibility_version())) {
Line 371:             return 
failCanDoAction(VdcBllMessages.VIRTIO_SCSI_INTERFACE_IS_NOT_AVAILABLE_FOR_CLUSTER_LEVEL);
Line 372:         }
Line 373: 
Line 374:         if 
(Boolean.FALSE.equals(getParameters().isVirtioScsiEnabled())) {
is null here assumed to be true?
IIRC, null is assumed to be false, so you should use 
if (!Boolean.TRUE.equals(getParameters().isVirtioScsiEnabled()))
Line 375:             List<Disk> allDisks = getDiskDao().getAllForVm(getVmId(), 
true);
Line 376:             for (Disk disk : allDisks) {
Line 377:                 if (disk.getDiskInterface() == 
DiskInterface.VirtIO_SCSI) {
Line 378:                     return 
failCanDoAction(VdcBllMessages.CANNOT_DISABLE_VIRTIO_SCSI_PLUGGED_DISKS);


Line 371:             return 
failCanDoAction(VdcBllMessages.VIRTIO_SCSI_INTERFACE_IS_NOT_AVAILABLE_FOR_CLUSTER_LEVEL);
Line 372:         }
Line 373: 
Line 374:         if 
(Boolean.FALSE.equals(getParameters().isVirtioScsiEnabled())) {
Line 375:             List<Disk> allDisks = getDiskDao().getAllForVm(getVmId(), 
true);
perhaps we should have a getAllForVMAndInterface method ?
Line 376:             for (Disk disk : allDisks) {
Line 377:                 if (disk.getDiskInterface() == 
DiskInterface.VirtIO_SCSI) {
Line 378:                     return 
failCanDoAction(VdcBllMessages.CANNOT_DISABLE_VIRTIO_SCSI_PLUGGED_DISKS);
Line 379:                 }


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic2e6c85a2df434de3180f19a32079f276458d372
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Daniel Erez <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to