[oz/el6] Include upstream patch to force qcow2 image type.

Chris Lalancette clalance at fedoraproject.org
Tue Feb 11 01:48:26 UTC 2014


commit 88ed91d1c00d8be8adf133c9978f03798830b16b
Author: Chris Lalancette <clalancette at gmail.com>
Date:   Mon Feb 10 20:06:58 2014 -0500

    Include upstream patch to force qcow2 image type.
    
    Signed-off-by: Chris Lalancette <clalancette at gmail.com>

 oz.spec                                       |    7 ++++-
 restore-logic-to-force-qcow2-image-type.patch |   34 +++++++++++++++++++++++++
 2 files changed, 40 insertions(+), 1 deletions(-)
---
diff --git a/oz.spec b/oz.spec
index 8eb49d3..e09e296 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
@@ -31,6 +32,7 @@ installations, with minimal input from the user.
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 python setup.py build
@@ -78,6 +80,9 @@ fi
 %{_mandir}/man1/*
 
 %changelog
+* Mon Feb 10 2014 Chris Lalancette <clalancette at gmail.com> - 0.12.0-2
+- Add patch to first qcow2 image type
+
 * Fri Jan  3 2014 Chris Lalancette <clalancette at gmail.com> - 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 <imcleod at redhat.com>
+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
+


More information about the scm-commits mailing list