summaryrefslogtreecommitdiffstats
path: root/meta/classes/image-vm.bbclass
diff options
context:
space:
mode:
authorChristian Ziethén <christian.ziethen@linaro.org>2015-07-23 16:32:28 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-24 23:29:42 +0100
commitc1f9ed400e4b5fe5be4fac86021dea11a7546035 (patch)
tree8449c8eac8d5612e7c7af989a1e402c9a03243de /meta/classes/image-vm.bbclass
parentc43ab92e1cec22127bd9aab6c319673fc70fe906 (diff)
downloadopenembedded-core-contrib-c1f9ed400e4b5fe5be4fac86021dea11a7546035.tar.gz
image: Support for qcow2
Add support for qcow2 image format. Implemented in the same way as the previously existing vmdk and vdi solutions. Signed-off-by: Christian Ziethén <christian.ziethen@linaro.org> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/classes/image-vm.bbclass')
-rw-r--r--meta/classes/image-vm.bbclass12
1 files changed, 10 insertions, 2 deletions
diff --git a/meta/classes/image-vm.bbclass b/meta/classes/image-vm.bbclass
index fdfd14f7801..28519c8af19 100644
--- a/meta/classes/image-vm.bbclass
+++ b/meta/classes/image-vm.bbclass
@@ -14,7 +14,8 @@ inherit boot-directdisk
IMAGE_TYPEDEP_vmdk = "ext3"
IMAGE_TYPEDEP_vdi = "ext3"
-IMAGE_TYPES_MASKED += "vmdk vdi"
+IMAGE_TYPEDEP_qcow2 = "ext3"
+IMAGE_TYPES_MASKED += "vmdk vdi qcow2"
create_vmdk_image () {
qemu-img convert -O vmdk ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hdddirect ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmdk
@@ -26,11 +27,18 @@ create_vdi_image () {
ln -sf ${IMAGE_NAME}.vdi ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.vdi
}
+create_qcow2_image () {
+ qemu-img convert -O qcow2 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hdddirect ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.qcow2
+ ln -sf ${IMAGE_NAME}.qcow2 ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.qcow2
+}
+
python do_vmimg() {
if 'vmdk' in d.getVar('IMAGE_FSTYPES', True):
bb.build.exec_func('create_vmdk_image', d)
if 'vdi' in d.getVar('IMAGE_FSTYPES', True):
- bb.build.exec_func('create_vdi_image', d)
+ bb.build.exec_func('create_vdi_image', d)
+ if 'qcow2' in d.getVar('IMAGE_FSTYPES', True):
+ bb.build.exec_func('create_qcow2_image', d)
}
addtask vmimg after do_bootdirectdisk before do_build