Package org.apache.cloudstack.utils.qemu

Examples of org.apache.cloudstack.utils.qemu.QemuImg.convert()


                            throw new CloudRuntimeException("Failed to create disk: " + result);
                        }
                    } 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;
                        }
View Full Code Here


            try {
                if (sourceFormat != destFormat) {
                    srcFile = new QemuImgFile(sourcePath, sourceFormat);
                    destFile = new QemuImgFile("/tmp/" + name);
                    s_logger.debug("Converting " + srcFile.getFileName() " to " + destFile.getFileName() " as a temporary file for RBD conversion");
                    qemu.convert(srcFile, destFile);
                    sourceFile = destFile.getFileName();
                    useTmpFile = true;
                } else {
                    // Source file is RAW, we can write directly to RBD
                    sourceFile = sourcePath;
View Full Code Here

            srcFile.setFormat(sourceFormat);
            destFile = new QemuImgFile(destPath);
            destFile.setFormat(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;
            }
View Full Code Here

                QemuImgFile destFile = new QemuImgFile(tmpltPath + "/" + cmd.getUniqueName() + ".qcow2");
                destFile.setFormat(PhysicalDiskFormat.QCOW2);

                QemuImg q = new QemuImg(0);
                try {
                    q.convert(srcFile, destFile);
                } catch (QemuImgException e) {
                    s_logger.error("Failed to create new template while converting "
                                    + srcFile.getFileName() + " to " + destFile.getFileName() + " the error was: " + e.getMessage());
                }
View Full Code Here

                QemuImgFile destFile = new QemuImgFile(tmpltPath + "/" + templateName + ".qcow2");
                destFile.setFormat(PhysicalDiskFormat.QCOW2);

                QemuImg q = new QemuImg(cmd.getWaitInMillSeconds());
                try {
                    q.convert(srcFile, destFile);
                } catch (QemuImgException e) {
                    s_logger.error("Failed to create new template while converting " + srcFile.getFileName() + " to "
                            + destFile.getFileName() + " the error was: " + e.getMessage());
                }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.