Source:
protected List<OvfEntityData> getEntitiesFromStorageOvfDisk() { List<OvfEntityData> ovfEntitiesFromTar = Collections.emptyList(); List<Disk> unregisteredDisks = getBackend().runInternalQuery(VdcQueryType.GetUnregisteredDisks, new GetUnregisteredDisksQueryParameters(getParameters().getStorageDomainId(), getVds().getStoragePoolId())).getReturnValue(); if (!unregisteredDisks.isEmpty()) { Pair<DiskImage, Long> ovfDiskAndSize = getLatestOVFDisk(unregisteredDisks); DiskImage ovfDisk = ovfDiskAndSize.getFirst(); if (ovfDisk != null) { try { VDSReturnValue retrievedByteData = runVdsCommand(VDSCommandType.RetrieveImageData, new ImageHttpAccessVDSCommandParameters(getVdsId(), getParameters().getStoragePoolId(), getParameters().getStorageDomainId(), ovfDisk.getId(), ovfDisk.getImage().getId(), ovfDiskAndSize.getSecond())); if (retrievedByteData.getSucceeded()) { ovfEntitiesFromTar = OvfUtils.getOvfEntities((byte[]) retrievedByteData.getReturnValue(), getParameters().getStorageDomainId()); } else { log.errorFormat("Image data could not be retrieved for disk id {0} in storage domain id {1}", ovfDisk.getId()); AuditLogDirector.log(this, AuditLogType.RETRIEVE_OVF_STORE_FAILED); } } catch (RuntimeException e) { log.errorFormat("Image data could not be retrieved for disk id {0} in storage domain id {1}. Error: {2}", ovfDisk.getId(), getParameters().getStorageDomainId(), e); AuditLogDirector.log(this, AuditLogType.RETRIEVE_OVF_STORE_FAILED); } } } else { log.warnFormat("There are no OVF_STORE disks on storage domain id {0}", getParameters().getStorageDomainId()); } return ovfEntitiesFromTar; }

Target:
protected List<OvfEntityData> getEntitiesFromStorageOvfDisk() { List<OvfEntityData> ovfEntitiesFromTar = Collections.emptyList(); List<Disk> unregisteredDisks = getBackend().runInternalQuery(VdcQueryType.GetUnregisteredDisks, new GetUnregisteredDisksQueryParameters(getParameters().getStorageDomainId(), getVds().getStoragePoolId())).getReturnValue(); if (!unregisteredDisks.isEmpty()) { Pair<DiskImage, Long> ovfDiskAndSize = getLatestOVFDisk(unregisteredDisks); DiskImage ovfDisk = ovfDiskAndSize.getFirst(); if (ovfDisk != null) { try { VDSReturnValue retrievedByteData = runVdsCommand(VDSCommandType.RetrieveImageData, new ImageHttpAccessVDSCommandParameters(getVdsId(), getParameters().getStoragePoolId(), getParameters().getStorageDomainId(), ovfDisk.getId(), ovfDisk.getImage().getId(), ovfDiskAndSize.getSecond())); if (retrievedByteData.getSucceeded()) { ovfEntitiesFromTar = OvfUtils.getOvfEntities((byte[]) retrievedByteData.getReturnValue(), getParameters().getStorageDomainId()); } else { log.errorFormat("Image data could not be retrieved for disk id {0} in storage domain id {1}", ovfDisk.getId(), getParameters().getStorageDomainId()); AuditLogDirector.log(this, AuditLogType.RETRIEVE_OVF_STORE_FAILED); } } catch (RuntimeException e) { log.errorFormat("Image data could not be retrieved for disk id {0} in storage domain id {1}. Error: {2}", ovfDisk.getId(), getParameters().getStorageDomainId(), e); AuditLogDirector.log(this, AuditLogType.RETRIEVE_OVF_STORE_FAILED); } } } else { log.warnFormat("There are no OVF_STORE disks on storage domain id {0}", getParameters().getStorageDomainId()); } return ovfEntitiesFromTar; }