Daniel Erez has posted comments on this change.

Change subject: Core: Prevent VM migration when SCSI reservation is used
......................................................................


Patch Set 2:

(12 comments)

https://gerrit.ovirt.org/#/c/37664/2/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java:

Line 373:         if (vm.getMigrationSupport() == 
MigrationSupport.PINNED_TO_HOST) {
Line 374:             return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_PINNED_TO_HOST);
Line 375:         }
Line 376: 
Line 377:         if (vmUsesScsiReservation()) {
should be added to tests
Line 378:             return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_USES_SCSI_RESERVATION);
Line 379:         }
Line 380: 
Line 381:         if (vm.getMigrationSupport() == 
MigrationSupport.IMPLICITLY_NON_MIGRATABLE


Line 526:     public void onPowerringUp() {
Line 527:         // nothing to do
Line 528:     }
Line 529: 
Line 530:     private  boolean vmUsesScsiReservation() {
formatting
Line 531:         List<VmDevice> devices = 
DbFacade.getInstance().getVmDeviceDao().getVmDeviceByVmId(getVmId());
Line 532:         if (devices != null) {
Line 533:             for (VmDevice device : devices) {
Line 534:                 if (device.isScsiReservationUsed()) {


Line 527:         // nothing to do
Line 528:     }
Line 529: 
Line 530:     private  boolean vmUsesScsiReservation() {
Line 531:         List<VmDevice> devices = 
DbFacade.getInstance().getVmDeviceDao().getVmDeviceByVmId(getVmId());
use getDbFacade()
Line 532:         if (devices != null) {
Line 533:             for (VmDevice device : devices) {
Line 534:                 if (device.isScsiReservationUsed()) {
Line 535:                     return true;


https://gerrit.ovirt.org/#/c/37664/2/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmDiskCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmDiskCommand.java:

Line 385:                     updateQuota(diskImage);
Line 386:                     updateDiskProfile();
Line 387:                 }
Line 388: 
Line 389:                 if (disk.getDiskStorageType() == DiskStorageType.LUN) 
{
> else if?
indeed :)
Line 390:                     updateLunProperties((LunDisk)getNewDisk());
Line 391:                 }
Line 392: 
Line 393:                 reloadDisks();


Line 386:                     updateDiskProfile();
Line 387:                 }
Line 388: 
Line 389:                 if (disk.getDiskStorageType() == DiskStorageType.LUN) 
{
Line 390:                     updateLunProperties((LunDisk)getNewDisk());
format
Line 391:                 }
Line 392: 
Line 393:                 reloadDisks();
Line 394:                 updateBootOrder();


Line 387:                 }
Line 388: 
Line 389:                 if (disk.getDiskStorageType() == DiskStorageType.LUN) 
{
Line 390:                     updateLunProperties((LunDisk)getNewDisk());
Line 391:                 }
> else?
yeah, but shouldn't happen, maybe consider logging in another patch..
Line 392: 
Line 393:                 reloadDisks();
Line 394:                 updateBootOrder();
Line 395: 


https://gerrit.ovirt.org/#/c/37664/2/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/LunDisk.java
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/LunDisk.java:

Line 13:      * The LUN details.
Line 14:      */
Line 15:     private LUNs lun;
Line 16: 
Line 17:     private boolean isUsingScsiReservation;
s/isUsingScsiReservation/usingScsiReservation
Line 18: 
Line 19:     @Override
Line 20:     public DiskStorageType getDiskStorageType() {
Line 21:         return DiskStorageType.LUN;


Line 42:     public boolean isUsingScsiReservation() {
Line 43:         return isUsingScsiReservation;
Line 44:     }
Line 45: 
Line 46:     public void setUsingScsiReservation(boolean flag) {
s/flag/usingScsiReservation
Line 47:         this.isUsingScsiReservation = flag;
Line 48:     }
Line 49: 
Line 50:     @Override


https://gerrit.ovirt.org/#/c/37664/2/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
File 
frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java:

Line 513: 
Line 514:     @DefaultStringValue("Cannot ${action} ${type}. VM is pinned to 
Host.")
Line 515:     String ACTION_TYPE_FAILED_VM_IS_PINNED_TO_HOST();
Line 516: 
Line 517:     @DefaultStringValue("Cannot ${action} ${type}. VM uses Scsi 
reservation.")
s/Scsi/SCSI
Line 518:     String ACTION_TYPE_FAILED_VM_USES_SCSI_RESERVATION();
Line 519: 
Line 520:     @DefaultStringValue("Cannot ${action} ${type}. Scsi reservation 
can be set only when SCSI passthrough is set.")
Line 521:     String ACTION_TYPE_FAILED_ILLEGAL_SCSI_RESERVATION_USE();


Line 516: 
Line 517:     @DefaultStringValue("Cannot ${action} ${type}. VM uses Scsi 
reservation.")
Line 518:     String ACTION_TYPE_FAILED_VM_USES_SCSI_RESERVATION();
Line 519: 
Line 520:     @DefaultStringValue("Cannot ${action} ${type}. Scsi reservation 
can be set only when SCSI passthrough is set.")
same
Line 521:     String ACTION_TYPE_FAILED_ILLEGAL_SCSI_RESERVATION_USE();
Line 522: 
Line 523:     @DefaultStringValue("Note: The VM is pinned to Host '${VdsName}' 
but cannot run on it.")
Line 524:     String VM_PINNED_TO_HOST_CANNOT_RUN_ON_THE_DEFAULT_VDS();


https://gerrit.ovirt.org/#/c/37664/2/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/AbstractDiskModel.java
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/AbstractDiskModel.java:

Line 258: 
Line 259:         setIsUsingScsiReservation(new EntityModel<Boolean>());
Line 260:         getIsUsingScsiReservation().setEntity(false);
Line 261: 
Line 262: 
redundant empty line
Line 263:         setIsScsiPassthrough(new EntityModel<Boolean>());
Line 264:         getIsScsiPassthrough().setIsAvailable(false);
Line 265:         getIsScsiPassthrough().setEntity(true);
Line 266:         
getIsScsiPassthrough().getEntityChangedEvent().addListener(this);


Line 342:                 DiskModel diskModel = (DiskModel) target;
Line 343:                 ArrayList<StorageDomain> storageDomains = 
(ArrayList<StorageDomain>) returnValue;
Line 344: 
Line 345:                 ArrayList<StorageDomain> filteredStorageDomains = new 
ArrayList<StorageDomain>();
Line 346:                 for (StorageDomain a : storageDomains) {
irrelevant to the patch
Line 347:                     if 
(!a.getStorageDomainType().isIsoOrImportExportDomain() && a.getStatus() == 
StorageDomainStatus.Active) {
Line 348:                         filteredStorageDomains.add(a);
Line 349:                     }
Line 350:                 }


-- 
To view, visit https://gerrit.ovirt.org/37664
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia38c03dae04c9dbb30c882941391b1909f5af416
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Ala Hino <[email protected]>
Gerrit-Reviewer: Adam Litke <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Amit Aviram <[email protected]>
Gerrit-Reviewer: Candace Sheremeta <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Freddy Rolland <[email protected]>
Gerrit-Reviewer: Greg Padgett <[email protected]>
Gerrit-Reviewer: Idan Shaby <[email protected]>
Gerrit-Reviewer: Liron Aravot <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Nir Soffer <[email protected]>
Gerrit-Reviewer: Tal Nisan <[email protected]>
Gerrit-Reviewer: Vered Volansky <[email protected]>
Gerrit-Reviewer: [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