@Test public void testCreateSparseVolume() throws QemuImgException { final String filename = "/tmp/" + UUID.randomUUID() + ".qcow2"; final long size = 10995116277760l; final QemuImgFile file = new QemuImgFile(filename, size, PhysicalDiskFormat.QCOW2); final String preallocation = "metadata"; final Map<String, String> options = new HashMap<>(); options.put("preallocation", preallocation); final QemuImg qemu = new QemuImg(0); qemu.create(file, options); final String allocatedSize = Script.runSimpleBashScript(String.format("ls -alhs %s | awk '{print $1}'", file)); final String declaredSize = Script.runSimpleBashScript(String.format("ls -alhs %s | awk '{print $6}'", file)); assertFalse(allocatedSize.equals(declaredSize)); final File f = new File(filename); f.delete(); }
public void create(final QemuImgFile file) throws QemuImgException { this.create(file, null, null); }
QemuImg { public void create(final QemuImgFile file) throws QemuImgException { this.create(file, null, null); } }
QemuImg { public void create(final QemuImgFile file) throws QemuImgException { this.create(file, null, null); } QemuImg(final int timeout);  QemuImg(final String qemuImgPath); }
QemuImg { public void create(final QemuImgFile file) throws QemuImgException { this.create(file, null, null); } QemuImg(final int timeout);  QemuImg(final String qemuImgPath); void setTimeout(final int timeout); void check(final QemuImgFile file); void create(final QemuImgFile file); void create(final QemuImgFile file, final QemuImgFile backingFile, final Map<String, String> options); void create(final QemuImgFile file, final QemuImgFile backingFile); void create(final QemuImgFile file, final Map<String, String> options); void convert(final QemuImgFile srcFile, final QemuImgFile destFile); void convert(final QemuImgFile srcFile, final QemuImgFile destFile, final Map<String, String> options); void resize(final QemuImgFile file, final long size); void resize(final QemuImgFile file, final long size, final boolean delta); void commit(final QemuImgFile file); Map<String, String> info(final QemuImgFile file); void snapshot(); void rebase(); }
QemuImg { public void create(final QemuImgFile file) throws QemuImgException { this.create(file, null, null); } QemuImg(final int timeout);  QemuImg(final String qemuImgPath); void setTimeout(final int timeout); void check(final QemuImgFile file); void create(final QemuImgFile file); void create(final QemuImgFile file, final QemuImgFile backingFile, final Map<String, String> options); void create(final QemuImgFile file, final QemuImgFile backingFile); void create(final QemuImgFile file, final Map<String, String> options); void convert(final QemuImgFile srcFile, final QemuImgFile destFile); void convert(final QemuImgFile srcFile, final QemuImgFile destFile, final Map<String, String> options); void resize(final QemuImgFile file, final long size); void resize(final QemuImgFile file, final long size, final boolean delta); void commit(final QemuImgFile file); Map<String, String> info(final QemuImgFile file); void snapshot(); void rebase();  }