Source:
protected void executeQueryCommand() { Guid storagePoolId = getParameters().getStoragePoolId(); Guid storageDomainId = getParameters().getStorageDomainId(); Guid diskId = getParameters().getDiskId(); if (getDbFacade().getStorageDomainDao().getForStoragePool(storageDomainId, storagePoolId) == null) { getQueryReturnValue().setExceptionString("Storage Domain does not exist in the Data Center"); getQueryReturnValue().setSucceeded(false); return; } StoragePoolDomainAndGroupIdBaseVDSCommandParameters getVolumesParameters = new StoragePoolDomainAndGroupIdBaseVDSCommandParameters( storagePoolId, storageDomainId, diskId); VDSReturnValue volumesListReturn = getBackend().getResourceManager().RunVdsCommand(VDSCommandType.GetVolumesList, getVolumesParameters); if (!volumesListReturn.getSucceeded()) { getQueryReturnValue().setExceptionString(volumesListReturn.getExceptionString()); getQueryReturnValue().setSucceeded(false); return; } @SuppressWarnings("unchecked") List<Guid> volumesList = (List<Guid>) volumesListReturn.getReturnValue(); if (volumesList.size() != 1) { getQueryReturnValue().setSucceeded(false); return; } Guid volumeId = volumesList.get(0); GetImageInfoVDSCommandParameters imageInfoParameters = new GetImageInfoVDSCommandParameters( storagePoolId, storageDomainId, diskId, volumeId); VDSReturnValue imageInfoReturn = getBackend().getResourceManager().RunVdsCommand( VDSCommandType.GetImageInfo, imageInfoParameters); if (!imageInfoReturn.getSucceeded()) { getQueryReturnValue().setExceptionString(imageInfoReturn.getExceptionString()); getQueryReturnValue().setSucceeded(false); return; } DiskImage newDiskImage = (DiskImage) imageInfoReturn.getReturnValue(); newDiskImage.setDiskInterface(DiskInterface.IDE); newDiskImage.setStoragePoolId(storagePoolId); getQueryReturnValue().setReturnValue(newDiskImage); getQueryReturnValue().setSucceeded(true); }

Target:
protected void executeQueryCommand() { Guid storagePoolId = getParameters().getStoragePoolId(); Guid storageDomainId = getParameters().getStorageDomainId(); Guid diskId = getParameters().getDiskId(); if (getDbFacade().getStorageDomainDao().getForStoragePool(storageDomainId, storagePoolId) == null) { getQueryReturnValue().setExceptionString(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST_IN_DATA_CENTER.toString()); getQueryReturnValue().setSucceeded(false); return; } StoragePoolDomainAndGroupIdBaseVDSCommandParameters getVolumesParameters = new StoragePoolDomainAndGroupIdBaseVDSCommandParameters( storagePoolId, storageDomainId, diskId); VDSReturnValue volumesListReturn = getBackend().getResourceManager().RunVdsCommand(VDSCommandType.GetVolumesList, getVolumesParameters); if (!volumesListReturn.getSucceeded()) { getQueryReturnValue().setExceptionString(volumesListReturn.getExceptionString()); getQueryReturnValue().setSucceeded(false); return; } @SuppressWarnings("unchecked") List<Guid> volumesList = (List<Guid>) volumesListReturn.getReturnValue(); if (volumesList.size() != 1) { getQueryReturnValue().setSucceeded(false); return; } Guid volumeId = volumesList.get(0); GetImageInfoVDSCommandParameters imageInfoParameters = new GetImageInfoVDSCommandParameters( storagePoolId, storageDomainId, diskId, volumeId); VDSReturnValue imageInfoReturn = getBackend().getResourceManager().RunVdsCommand( VDSCommandType.GetImageInfo, imageInfoParameters); if (!imageInfoReturn.getSucceeded()) { getQueryReturnValue().setExceptionString(imageInfoReturn.getExceptionString()); getQueryReturnValue().setSucceeded(false); return; } DiskImage newDiskImage = (DiskImage) imageInfoReturn.getReturnValue(); newDiskImage.setDiskInterface(DiskInterface.IDE); newDiskImage.setStoragePoolId(storagePoolId); getQueryReturnValue().setReturnValue(newDiskImage); getQueryReturnValue().setSucceeded(true); }