You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by wi...@apache.org on 2013/02/14 21:48:38 UTC

[2/2] git commit: refs/heads/qemu-img - Use the new create method with backing file

Updated Branches:
  refs/heads/qemu-img 500bba834 -> 2dd8181c9


Use the new create method with backing file


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/2dd8181c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/2dd8181c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/2dd8181c

Branch: refs/heads/qemu-img
Commit: 2dd8181c9f6133e935e958a24be21204f7772e44
Parents: 7c14caf
Author: Wido den Hollander <wi...@42on.com>
Authored: Thu Feb 14 21:33:45 2013 +0100
Committer: Wido den Hollander <wi...@42on.com>
Committed: Thu Feb 14 21:48:24 2013 +0100

----------------------------------------------------------------------
 .../kvm/storage/LibvirtStorageAdaptor.java         |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2dd8181c/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
index 6cb6441..63027fd 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
@@ -592,9 +592,10 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
             disk = destPool.createPhysicalDisk(newUuid, format, template.getVirtualSize());
 
             if (format == PhysicalDiskFormat.QCOW2) {
-                Script.runSimpleBashScript("qemu-img create -f "
-                        + template.getFormat() + " -b  " + template.getPath() + " "
-                        + disk.getPath());
+                QemuImgFile backingFile = new QemuImgFile(template.getPath(), template.getFormat());
+                QemuImgFile destFile = new QemuImgFile(disk.getPath());
+                QemuImg qemu = new QemuImg();
+                qemu.create(destFile, backingFile);
             } else if (format == PhysicalDiskFormat.RAW) {
                 QemuImgFile sourceFile = new QemuImgFile(template.getPath(), template.getFormat());
                 QemuImgFile destFile = new QemuImgFile(disk.getPath(), PhysicalDiskFormat.RAW);