private void onChangeQuota() { ChangeQuotaModel model = (ChangeQuotaModel) getWindow(); ArrayList<VdcActionParametersBase> paramerterList = new ArrayList<VdcActionParametersBase>(); for (Object item : model.getItems()) { ChangeQuotaItemModel itemModel = (ChangeQuotaItemModel) item; DiskImage disk = itemModel.getEntity(); VdcActionParametersBase parameters = new ChangeQuotaParameters( itemModel.getQuota().getSelectedItem().getId(), disk.getId(), itemModel.getStorageDomainId(), disk.getStoragePoolId()); paramerterList.add(parameters); } model.startProgress(); Frontend.getInstance() .runMultipleAction( VdcActionType.ChangeQuotaForDisk, paramerterList, new IFrontendMultipleActionAsyncCallback() { @Override public void executed(FrontendMultipleActionAsyncResult result) { cancel(); } }, this); }
private boolean imageStorageValidation() { // If the VM is not an image then it does not use the storage domain. // If the VM is not in UP or PAUSED status, then we know that there is no running qemu process, // so we don't need to check the storage domain activity. if (getDisk().getDiskStorageType() != DiskStorageType.IMAGE || !getVm().getStatus().isRunningOrPaused()) { return true; } DiskImage diskImage = (DiskImage) getDisk(); StorageDomain storageDomain = getStorageDomainDao() .getForStoragePool(diskImage.getStorageIds().get(0), diskImage.getStoragePoolId()); StorageDomainValidator storageDomainValidator = getStorageDomainValidator(storageDomain); return validate(storageDomainValidator.isDomainExistAndActive()); }