2024-09-26 07:25:53 +00:00
|
|
|
From 3fbdf1e92fe0dbabb59b611dfb3ad906edf80979 Mon Sep 17 00:00:00 2001
|
2021-08-27 06:31:07 +00:00
|
|
|
From: Kevin Wolf <kwolf@redhat.com>
|
|
|
|
Date: Fri, 20 Aug 2021 18:25:12 +0200
|
2021-09-02 06:44:51 +00:00
|
|
|
Subject: qcow2: Deprecation warning when opening v2 images rw
|
2021-08-27 06:31:07 +00:00
|
|
|
MIME-Version: 1.0
|
|
|
|
Content-Type: text/plain; charset=UTF-8
|
|
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
|
|
|
|
RH-Author: Kevin Wolf <kwolf@redhat.com>
|
|
|
|
RH-MergeRequest: 37: qcow2: Deprecation warning when opening v2 images rw
|
|
|
|
RH-Commit: [1/1] f450d0ae32d35063b28c72c4f2d2ebb9e6d8db3e (kmwolf/centos-qemu-kvm)
|
|
|
|
RH-Bugzilla: 1951814
|
|
|
|
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
|
RH-Acked-by: Hanna Reitz <hreitz@redhat.com>
|
|
|
|
RH-Acked-by: Thomas Huth <thuth@redhat.com>
|
|
|
|
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
|
|
|
|
|
|
|
|
qcow2 v3 has been around for a long time (since QEMU 1.1/RHEL 7), so
|
|
|
|
there is no real reason any more to use it. People still using it might
|
|
|
|
do so unintentionally. Warn about it and suggest upgrading during the
|
|
|
|
RHEL 9 timeframe so that the code can possibly be disabled in RHEL 10.
|
|
|
|
|
|
|
|
The warning is restricted to read-write mode and the system emulator.
|
|
|
|
The primary motivation for not having it in qemu-img is that 'qemu-img
|
|
|
|
amend' for upgrades would warn otherwise. It also avoids having to make
|
|
|
|
too many changes to the test suite.
|
|
|
|
|
|
|
|
bdrv_uses_whitelist() is used as a proxy for deciding whether we are
|
|
|
|
running in a tool or the system emulator. This is not entirely clean,
|
|
|
|
but it's what is available and the same function qcow2_do_open() already
|
|
|
|
uses it this way for another warning.
|
|
|
|
|
|
|
|
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
2021-09-02 06:44:51 +00:00
|
|
|
|
|
|
|
patch_name: kvm-qcow2-Deprecation-warning-when-opening-v2-images-rw.patch
|
|
|
|
present_in_specfile: true
|
|
|
|
location_in_specfile: 116
|
|
|
|
---
|
|
|
|
Rebase notes (6.1.0):
|
|
|
|
- Replace bs->read_only with bdrv_is_read_only
|
2021-08-27 06:31:07 +00:00
|
|
|
---
|
|
|
|
block/qcow2.c | 6 ++++++
|
|
|
|
tests/qemu-iotests/common.filter | 1 +
|
|
|
|
2 files changed, 7 insertions(+)
|
|
|
|
|
|
|
|
diff --git a/block/qcow2.c b/block/qcow2.c
|
2024-09-26 07:25:53 +00:00
|
|
|
index 70b19730a3..a4cffb628c 100644
|
2021-08-27 06:31:07 +00:00
|
|
|
--- a/block/qcow2.c
|
|
|
|
+++ b/block/qcow2.c
|
2024-01-02 09:26:49 +00:00
|
|
|
@@ -1358,6 +1358,12 @@ qcow2_do_open(BlockDriverState *bs, QDict *options, int flags,
|
2021-08-27 06:31:07 +00:00
|
|
|
ret = -ENOTSUP;
|
|
|
|
goto fail;
|
|
|
|
}
|
2021-09-02 06:44:51 +00:00
|
|
|
+ if (header.version < 3 && !bdrv_is_read_only(bs) && bdrv_uses_whitelist()) {
|
2021-08-27 06:31:07 +00:00
|
|
|
+ warn_report_once("qcow2 v2 images are deprecated and may not be "
|
|
|
|
+ "supported in future versions. Please consider "
|
|
|
|
+ "upgrading the image with 'qemu-img amend "
|
|
|
|
+ "-o compat=v3'.");
|
|
|
|
+ }
|
|
|
|
|
|
|
|
s->qcow_version = header.version;
|
|
|
|
|
|
|
|
diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter
|
2024-09-26 07:25:53 +00:00
|
|
|
index fc3c64bcb8..4b238954d5 100644
|
2021-08-27 06:31:07 +00:00
|
|
|
--- a/tests/qemu-iotests/common.filter
|
|
|
|
+++ b/tests/qemu-iotests/common.filter
|
2022-04-20 07:49:16 +00:00
|
|
|
@@ -83,6 +83,7 @@ _filter_qemu()
|
2021-08-27 06:31:07 +00:00
|
|
|
{
|
2022-04-20 07:49:16 +00:00
|
|
|
gsed -e "s#\\(^\\|(qemu) \\)$(basename $QEMU_PROG):#\1QEMU_PROG:#" \
|
2021-08-27 06:31:07 +00:00
|
|
|
-e 's#^QEMU [0-9]\+\.[0-9]\+\.[0-9]\+ monitor#QEMU X.Y.Z monitor#' \
|
|
|
|
+ -e "/qcow2 v2 images are deprecated/d" \
|
|
|
|
-e $'s#\r##' # QEMU monitor uses \r\n line endings
|
|
|
|
}
|
|
|
|
|
|
|
|
--
|
2023-09-04 08:00:24 +00:00
|
|
|
2.39.3
|
2021-08-27 06:31:07 +00:00
|
|
|
|