Blob Blame Raw
From e68f660a6e5a6b1190641a1540def63da7e89703 Mon Sep 17 00:00:00 2001
From: Ian McLeod <>
Date: Fri, 24 Jan 2014 10:49:01 -0600
Subject: [PATCH oz] restore logic to force qcow2 image type when creating disk
 image with a backing store

This was in the original version of the backing_store feature but seems to
have gotten lost in one of the refactors during the 0.12 cycle.  This simply
restores the old behavior.  Interestingly, without this libvirt will still
create the new disk image but it seems to contain invalid data.
 oz/ | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/oz/ b/oz/
index 292cf8f..c7e1a6b 100644
--- a/oz/
+++ b/oz/
@@ -517,7 +517,11 @@ class Guest(object):
         self.lxml_subelement(vol, "name", filename)
         self.lxml_subelement(vol, "allocation", "0")
         target = self.lxml_subelement(vol, "target")
-        self.lxml_subelement(target, "format", None, {"type":self.image_type})
+        if backing_filename:
+            # Only qcow2 supports image creation using a backing file
+            self.lxml_subelement(target, "format", None, {"type":"qcow2"})
+        else:
+            self.lxml_subelement(target, "format", None, {"type":self.image_type})
         # FIXME: this makes the permissions insecure, but is needed since
         # libvirt launches guests as qemu:qemu
         permissions = self.lxml_subelement(target, "permissions")