remove a call path that cause NullPointerException

QemuImg.convert expects the arguments not null.
This commit is contained in:
Hiroaki KAWAI 2013-05-28 20:54:01 +09:00
parent 4a563b64ee
commit cfd8056c14
1 changed files with 8 additions and 8 deletions

View File

@ -911,20 +911,20 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
Script.runSimpleBashScript("cp -f " + sourcePath + " " + destPath);
} else {
destFile = new QemuImgFile(destPath, destFormat);
try {
qemu.convert(srcFile, destFile);
} catch (QemuImgException e) {
s_logger.error("Failed to convert " + srcFile.getFileName() + " to "
+ destFile.getFileName() + " the error was: " + e.getMessage());
newDisk = null;
}
}
} catch (QemuImgException e) {
s_logger.error("Failed to fetch the information of file "
+ srcFile.getFileName() + " the error was: " + e.getMessage());
newDisk = null;
}
}
try {
qemu.convert(srcFile, destFile);
} catch (QemuImgException e) {
s_logger.error("Failed to convert " + srcFile.getFileName() + " to "
+ destFile.getFileName() + " the error was: " + e.getMessage());
}
} else if ((srcPool.getType() != StoragePoolType.RBD) && (destPool.getType() == StoragePoolType.RBD)) {
/**
* Qemu doesn't support writing to RBD format 2 directly, so we have to write to a temporary RAW file first