Skip to content

Commit 24c28ad

Browse files
committed
Merge branch '4.18' into 4.19
2 parents dfe4a67 + 6ef2eac commit 24c28ad

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2446,6 +2446,22 @@ public Answer handleDownloadTemplateToPrimaryStorage(DirectDownloadCommand cmd)
24462446

24472447
template = storagePoolMgr.createPhysicalDiskFromDirectDownloadTemplate(tempFilePath, destTemplatePath, destPool, cmd.getFormat(), cmd.getWaitInMillSeconds());
24482448

2449+
String templatePath = template.getPath();
2450+
if (templatePath != null) {
2451+
try {
2452+
Qcow2Inspector.validateQcow2File(templatePath);
2453+
} catch (RuntimeException e) {
2454+
try {
2455+
Files.deleteIfExists(Path.of(templatePath));
2456+
} catch (IOException ioException) {
2457+
s_logger.warn(String.format("Unable to remove file [%s]; consider removing it manually.", templatePath), ioException);
2458+
}
2459+
2460+
s_logger.error(String.format("The downloaded file [%s] is not a valid QCOW2.", templatePath), e);
2461+
return new DirectDownloadAnswer(false, "The downloaded file is not a valid QCOW2. Ask the administrator to check the logs for more details.", true);
2462+
}
2463+
}
2464+
24492465
if (!storagePoolMgr.disconnectPhysicalDisk(pool.getPoolType(), pool.getUuid(), destTemplatePath)) {
24502466
s_logger.warn("Unable to disconnect physical disk at path: " + destTemplatePath + ", in storage pool id: " + pool.getUuid());
24512467
}

tools/build/build_asf.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ echo "Using version: $version"
6464
echo "Using source directory: $sourcedir"
6565
echo "Using output directory: $outputdir"
6666
echo "Using branch: $branch"
67-
if [ "$tag" == "yes" ]; then
68-
if [ "$certid" == "X" ]; then
67+
if [ "$tag" = "yes" ]; then
68+
if [ "$certid" = "X" ]; then
6969
echo "Tagging the branch with the version number, and signing the branch with your default certificate."
7070
else
7171
echo "Tagging the branch with the version number, and signing the branch with certificate ID $certid."
@@ -143,7 +143,7 @@ bzip2 $outputdir/apache-cloudstack-$version-src.tar
143143

144144
cd $outputdir
145145
echo 'armor'
146-
if [ "$certid" == "X" ]; then
146+
if [ "$certid" = "X" ]; then
147147
gpg -v --armor --output apache-cloudstack-$version-src.tar.bz2.asc --detach-sig apache-cloudstack-$version-src.tar.bz2
148148
else
149149
gpg -v --default-key $certid --armor --output apache-cloudstack-$version-src.tar.bz2.asc --detach-sig apache-cloudstack-$version-src.tar.bz2
@@ -155,7 +155,7 @@ sha512sum apache-cloudstack-$version-src.tar.bz2 > apache-cloudstack-$version-sr
155155
echo 'verify'
156156
gpg -v --verify apache-cloudstack-$version-src.tar.bz2.asc apache-cloudstack-$version-src.tar.bz2
157157

158-
if [ "$tag" == "yes" ]; then
158+
if [ "$tag" = "yes" ]; then
159159
echo 'tag'
160160
cd $sourcedir
161161
if [ "$certid" == "X" ]; then
@@ -165,7 +165,7 @@ if [ "$tag" == "yes" ]; then
165165
fi
166166
fi
167167

168-
if [ "$committosvn" == "yes" ]; then
168+
if [ "$committosvn" = "yes" ]; then
169169
echo 'committing artifacts to svn'
170170
rm -Rf /tmp/cloudstack-dev-dist
171171
cd /tmp

0 commit comments

Comments
 (0)