[libguestfs] Include upstream patches to fix virt-make-fs with qemu-img 0.14.

Richard W.M. Jones rjones at fedoraproject.org
Fri Mar 4 12:17:13 UTC 2011


commit 26e255e1fad9ccb1346cb02874f9a73a1d91c8b8
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Fri Mar 4 12:16:53 2011 +0000

    Include upstream patches to fix virt-make-fs with qemu-img 0.14.

 ...s-In-debug-mode-print-qemu-img-command-li.patch |   26 +++++++++++++++++
 ...s-Round-disk-size-to-integer-fix-for-qemu.patch |   29 ++++++++++++++++++++
 libguestfs.spec                                    |   10 +++++++
 3 files changed, 65 insertions(+), 0 deletions(-)
---
diff --git a/0001-virt-make-fs-In-debug-mode-print-qemu-img-command-li.patch b/0001-virt-make-fs-In-debug-mode-print-qemu-img-command-li.patch
new file mode 100644
index 0000000..6d11813
--- /dev/null
+++ b/0001-virt-make-fs-In-debug-mode-print-qemu-img-command-li.patch
@@ -0,0 +1,26 @@
+From 29b3ffdad5d6774f988fd0e25f9c8242e5dd577a Mon Sep 17 00:00:00 2001
+From: Richard W.M. Jones <rjones at redhat.com>
+Date: Fri, 4 Mar 2011 12:13:12 +0000
+Subject: [PATCH 1/2] virt-make-fs: In debug mode, print qemu-img command line.
+
+---
+ tools/virt-make-fs |    3 +++
+ 1 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/tools/virt-make-fs b/tools/virt-make-fs
+index 854cc08..3825f70 100755
+--- a/tools/virt-make-fs
++++ b/tools/virt-make-fs
+@@ -397,6 +397,9 @@ if (!defined $size) {
+ # Take the unusual step of invoking qemu-img here.
+ 
+ my @cmd = ("qemu-img", "create", "-f", $format, $output, $size);
++if ($debug) {
++    print STDERR ("running: ", join (" ", @cmd), "\n");
++}
+ system (@cmd) == 0 or
+     die __"qemu-img create: failed to create disk image, see earlier error messages\n";
+ 
+-- 
+1.7.4
+
diff --git a/0002-virt-make-fs-Round-disk-size-to-integer-fix-for-qemu.patch b/0002-virt-make-fs-Round-disk-size-to-integer-fix-for-qemu.patch
new file mode 100644
index 0000000..bc8cb19
--- /dev/null
+++ b/0002-virt-make-fs-Round-disk-size-to-integer-fix-for-qemu.patch
@@ -0,0 +1,29 @@
+From eda9826d25336bcf661700270c580d4d62128750 Mon Sep 17 00:00:00 2001
+From: Richard W.M. Jones <rjones at redhat.com>
+Date: Fri, 4 Mar 2011 12:13:32 +0000
+Subject: [PATCH 2/2] virt-make-fs: Round disk size to integer, fix for qemu-img 0.14.
+
+qemu-img used to allow you to specify a fractional image size in bytes
+(or at least, it used to ignore the part after the decimal place).  In
+qemu-img 0.14 it no longer does this so we round down the size to a
+whole number of bytes.
+---
+ tools/virt-make-fs |    2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/tools/virt-make-fs b/tools/virt-make-fs
+index 3825f70..833c8a5 100755
+--- a/tools/virt-make-fs
++++ b/tools/virt-make-fs
+@@ -393,6 +393,8 @@ if (!defined $size) {
+     }
+ }
+ 
++$size = int ($size);
++
+ # Create the output disk.
+ # Take the unusual step of invoking qemu-img here.
+ 
+-- 
+1.7.4
+
diff --git a/libguestfs.spec b/libguestfs.spec
index 711f4a4..7e7fe65 100644
--- a/libguestfs.spec
+++ b/libguestfs.spec
@@ -40,6 +40,11 @@ BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root
 # Disable FUSE tests, not supported in Koji at the moment.
 Patch0:        libguestfs-1.7.13-no-fuse-test.patch
 
+# Upstream patches to fix virt-make-fs with qemu-img 0.14.
+# These are included after 0.9.9.
+Patch1:        0001-virt-make-fs-In-debug-mode-print-qemu-img-command-li.patch
+Patch2:        0002-virt-make-fs-Round-disk-size-to-integer-fix-for-qemu.patch
+
 # Basic build requirements:
 BuildRequires: /usr/bin/pod2man
 BuildRequires: /usr/bin/pod2text
@@ -426,6 +431,8 @@ php-%{name} contains PHP bindings for %{name}.
 %setup -q
 
 %patch0 -p1
+%patch1 -p1
+%patch2 -p1
 
 mkdir -p daemon/m4
 
@@ -758,6 +765,9 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Fri Mar  4 2011 Richard W.M. Jones <rjones at redhat.com> - 1:1.9.9-2
+- Include upstream patches to fix virt-make-fs with qemu-img 0.14.
+
 * Fri Mar  4 2011 Richard W.M. Jones <rjones at redhat.com> - 1:1.9.9-1
 - New upstream version 1.9.9.
 


More information about the scm-commits mailing list