Blame SOURCES/0004-cow-Fix-for-qemu-6.1-which-requires-backing-format.patch

fcc3c9
From 3c2879a38c299b725091cea45329879e3f46fc99 Mon Sep 17 00:00:00 2001
fcc3c9
From: "Richard W.M. Jones" <rjones@redhat.com>
fcc3c9
Date: Tue, 31 Aug 2021 11:23:27 +0100
fcc3c9
Subject: [PATCH] cow: Fix for qemu 6.1 which requires backing format
fcc3c9
fcc3c9
The diffing example in the manual created a qcow2 file with a backing
fcc3c9
file but did not specify the backing format.  However qemu 6.1 now
fcc3c9
requires this and fails with:
fcc3c9
fcc3c9
  qemu-img: cow-diff.qcow2: Backing file specified without backing format
fcc3c9
fcc3c9
or:
fcc3c9
fcc3c9
  qemu-img: Could not change the backing file to 'cow-base.img': backing format must be specified
fcc3c9
fcc3c9
Fix the example by adding the -F option to the command line.
fcc3c9
fcc3c9
Also there was a test of this rebasing sequence which failed, so this
fcc3c9
commit updates the test too.
fcc3c9
fcc3c9
(cherry picked from commit 618290ef33ce13b75c1a79fea1f1ffb327b5ba07)
fcc3c9
---
fcc3c9
 filters/cow/nbdkit-cow-filter.pod | 4 ++--
fcc3c9
 tests/test-cow.sh                 | 4 ++--
fcc3c9
 2 files changed, 4 insertions(+), 4 deletions(-)
fcc3c9
fcc3c9
diff --git a/filters/cow/nbdkit-cow-filter.pod b/filters/cow/nbdkit-cow-filter.pod
fcc3c9
index 4d5ae856..510bdd40 100644
fcc3c9
--- a/filters/cow/nbdkit-cow-filter.pod
fcc3c9
+++ b/filters/cow/nbdkit-cow-filter.pod
fcc3c9
@@ -101,8 +101,8 @@ At the end, disconnect the client.
fcc3c9
 Run these C<qemu-img> commands to construct a qcow2 file containing
fcc3c9
 the differences:
fcc3c9
 
fcc3c9
- qemu-img create -f qcow2 -b nbd:localhost diff.qcow2
fcc3c9
- qemu-img rebase -b disk.img diff.qcow2
fcc3c9
+ qemu-img create -F raw -b nbd:localhost -f qcow2 diff.qcow2
fcc3c9
+ qemu-img rebase -F raw -b disk.img -f qcow2 diff.qcow2
fcc3c9
 
fcc3c9
 F<diff.qcow2> now contains the differences between the base
fcc3c9
 (F<disk.img>) and the changes stored in nbdkit-cow-filter.  C<nbdkit>
fcc3c9
diff --git a/tests/test-cow.sh b/tests/test-cow.sh
fcc3c9
index 8772afd7..edc4c223 100755
fcc3c9
--- a/tests/test-cow.sh
fcc3c9
+++ b/tests/test-cow.sh
fcc3c9
@@ -72,8 +72,8 @@ fi
fcc3c9
 # If we have qemu-img, try the hairy rebase operation documented
fcc3c9
 # in the nbdkit-cow-filter manual.
fcc3c9
 if qemu-img --version >/dev/null 2>&1; then
fcc3c9
-    qemu-img create -f qcow2 -b nbd:unix:$sock cow-diff.qcow2
fcc3c9
-    time qemu-img rebase -b cow-base.img cow-diff.qcow2
fcc3c9
+    qemu-img create -F raw -b nbd:unix:$sock -f qcow2 cow-diff.qcow2
fcc3c9
+    time qemu-img rebase -F raw -b cow-base.img -f qcow2 cow-diff.qcow2
fcc3c9
     qemu-img info cow-diff.qcow2
fcc3c9
 
fcc3c9
     # This checks the file we created exists.
fcc3c9
-- 
fcc3c9
2.31.1
fcc3c9