Fix the size of a template downloaded from secondary storage (#10662)

Fixing the size of a template that is downloaded from secondary storage
to StorPool
This commit is contained in:
slavkap 2025-04-23 13:37:47 +03:00 committed by GitHub
parent 255a45c4a6
commit f6f33c6add
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -776,7 +776,8 @@ public class StorPoolPrimaryDataStoreDriver implements PrimaryDataStoreDriver {
if (answer != null && answer.getResult()) {
// successfully downloaded template to primary storage
answer = createVolumeSnapshot(cmd, size, conn, volName, dstTO);
TemplateObjectTO templ = (TemplateObjectTO) ((CopyCmdAnswer) answer).getNewData();
answer = createVolumeSnapshot(cmd, size, conn, volName, templ);
} else {
err = answer != null ? answer.getDetails() : "Unknown error while downloading template. Null answer returned.";
}
@ -983,7 +984,6 @@ public class StorPoolPrimaryDataStoreDriver implements PrimaryDataStoreDriver {
} else {
dstTO.setPath(StorPoolUtil.devPath(
StorPoolUtil.getSnapshotNameFromResponse(resp, false, StorPoolUtil.GLOBAL_ID)));
dstTO.setSize(size);
answer = new CopyCmdAnswer(dstTO);
}
return answer;