diff --git a/oz.spec b/oz.spec index 20e524d..80d41b4 100644 --- a/oz.spec +++ b/oz.spec @@ -1,11 +1,12 @@ Summary: Library and utilities for automated guest OS installs Name: oz Version: 0.12.0 -Release: 1%{?dist} +Release: 2%{?dist} License: LGPLv2 Group: Development/Libraries URL: http://github.com/clalancette/oz Source0: http://github.com/clalancette/%{name}/archive/%{name}-%{version}.tar.gz +Patch0: restore-logic-to-force-qcow2-image-type.patch BuildArch: noarch Requires: python >= 2.5 Requires: python-libguestfs >= 1.18 @@ -33,6 +34,7 @@ installations, with minimal input from the user. %prep %setup -q +%patch0 -p1 %build python setup.py build @@ -80,6 +82,9 @@ fi %{_mandir}/man1/* %changelog +* Mon Feb 10 2014 Chris Lalancette - 0.12.0-2 +- Add patch to first qcow2 image type + * Fri Jan 3 2014 Chris Lalancette - 0.12.0-1 - Update to release 0.12.0 diff --git a/restore-logic-to-force-qcow2-image-type.patch b/restore-logic-to-force-qcow2-image-type.patch new file mode 100644 index 0000000..865b7ea --- /dev/null +++ b/restore-logic-to-force-qcow2-image-type.patch @@ -0,0 +1,34 @@ +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/Guest.py | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/oz/Guest.py b/oz/Guest.py +index 292cf8f..c7e1a6b 100644 +--- a/oz/Guest.py ++++ b/oz/Guest.py +@@ -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") +-- +1.8.3.1 +