Fix for qemu 6.1.

This commit is contained in:
Richard W.M. Jones 2021-08-31 11:44:20 +01:00
parent 42e0d28d9a
commit bfdc3bda8b
2 changed files with 63 additions and 1 deletions

View File

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

View File

@ -51,7 +51,7 @@ ExclusiveArch: x86_64
Name: nbdkit Name: nbdkit
Version: 1.27.8 Version: 1.27.8
Release: 1%{?dist} Release: 2%{?dist}
Summary: NBD server Summary: NBD server
License: BSD License: BSD
@ -74,6 +74,8 @@ Source3: copy-patches.sh
# Fix issues in nbdkit-data-plugin on 32 bit platforms. # Fix issues in nbdkit-data-plugin on 32 bit platforms.
Patch1: 0001-data-Fix-issues-on-32-bit.patch Patch1: 0001-data-Fix-issues-on-32-bit.patch
# Fix for qemu 6.1.
Patch2: 0001-cow-Fix-for-qemu-6.1-which-requires-backing-format.patch
BuildRequires: make BuildRequires: make
%if 0%{patches_touch_autotools} %if 0%{patches_touch_autotools}
@ -1244,6 +1246,9 @@ export LIBGUESTFS_TRACE=1
%changelog %changelog
* Tue Aug 31 2021 Richard W.M. Jones <rjones@redhat.com> - 1.27.8-2
- Fix for qemu 6.1.
* Mon Aug 23 2021 Richard W.M. Jones <rjones@redhat.com> - 1.27.8-1 * Mon Aug 23 2021 Richard W.M. Jones <rjones@redhat.com> - 1.27.8-1
- New upstream development version 1.27.8. - New upstream development version 1.27.8.
- Remove patch which is included upstream. - Remove patch which is included upstream.