Package org.apache.cloudstack.utils.qemu

Examples of org.apache.cloudstack.utils.qemu.QemuImgException


        if (backingFile == null) {
            s.add(Long.toString(file.getSize()));
        }
        String result = s.execute();
        if (result != null) {
            throw new QemuImgException(result);
        }
    }
View Full Code Here


        s.add(srcFile.getFileName());
        s.add(destFile.getFileName());

        String result = s.execute();
        if (result != null) {
            throw new QemuImgException(result);
        }
    }
View Full Code Here

        s.add("info");
        s.add(file.getFileName());
        OutputInterpreter.AllLinesParser parser = new OutputInterpreter.AllLinesParser();
        String result = s.execute(parser);
        if (result != null) {
            throw new QemuImgException(result);
        }

        HashMap<String,String> info = new HashMap<String,String>();
        String[] outputBuffer = parser.getLines().trim().split("\n");
        for (int i = 0; i < outputBuffer.length; i++) {
View Full Code Here

     */
    public void resize(QemuImgFile file, long size, boolean delta) throws QemuImgException {
        String newSize = null;

        if (size == 0) {
            throw new QemuImgException("size should never be exactly zero");
        }

        if (delta) {
            if (size > 0) {
                newSize = "+" + Long.toString(size);
            } else {
                newSize = Long.toString(size);
            }
        } else {
            if (size <= 0) {
                throw new QemuImgException("size should not be negative if 'delta' is false!");
            }
            newSize = Long.toString(size);
        }

        Script s = new Script(_qemuImgPath);
View Full Code Here

        if (backingFile == null) {
            s.add(Long.toString(file.getSize()));
        }
        String result = s.execute();
        if (result != null) {
            throw new QemuImgException(result);
        }
    }
View Full Code Here

        s.add(srcFile.getFileName());
        s.add(destFile.getFileName());

        String result = s.execute();
        if (result != null) {
            throw new QemuImgException(result);
        }
    }
View Full Code Here

        s.add("info");
        s.add(file.getFileName());
        OutputInterpreter.AllLinesParser parser = new OutputInterpreter.AllLinesParser();
        String result = s.execute(parser);
        if (result != null) {
            throw new QemuImgException(result);
        }

        HashMap<String,String> info = new HashMap<String,String>();
        String[] outputBuffer = parser.getLines().trim().split("\n");
        for (int i = 0; i < outputBuffer.length; i++) {
View Full Code Here

     */
    public void resize(QemuImgFile file, long size, boolean delta) throws QemuImgException {
        String newSize = null;

        if (size == 0) {
            throw new QemuImgException("size should never be exactly zero");
        }

        if (delta) {
            if (size > 0) {
                newSize = "+" + Long.toString(size);
            } else {
                newSize = Long.toString(size);
            }
        } else {
            if (size <= 0) {
                throw new QemuImgException("size should not be negative if 'delta' is false!");
            }
            newSize = Long.toString(size);
        }

        Script s = new Script(_qemuImgPath);
View Full Code Here

TOP

Related Classes of org.apache.cloudstack.utils.qemu.QemuImgException

Copyright © 2018 www.massapicom. 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.