From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 322E71FF16F for ; Thu, 16 Jan 2025 12:52:36 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 418671F14C; Thu, 16 Jan 2025 12:51:36 +0100 (CET) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Thu, 16 Jan 2025 12:50:37 +0100 Message-Id: <20250116115054.124447-2-f.ebner@proxmox.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250116115054.124447-1-f.ebner@proxmox.com> References: <20250116115054.124447-1-f.ebner@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.050 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH qemu v2 01/18] adapt machine version deprecation for Proxmox VE X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" In commit a35f8577a0 ("include/hw: add macros for deprecation & removal of versioned machines"), a new machine version deprecation and removal policy was introduced. After only 3 years a machine version will be deprecated while being removed after 6 years. The deprecation is a bit early considering major PVE releases are approximately every 2 years. This means that a deprecation warning can already happen for a machine version that was introduced during the previous major release. This would scare users for no good reason, so avoid deprecating machine versions in PVE too early and define a baseline of machine versions that will be supported throughout a single major PVE release. Reported-by: Martin Maurer Signed-off-by: Fiona Ebner --- Changes in v2: * Rather than just weakening the warning from the QEMU side, adapt the deprecation logic for PVE already here. ...e-version-deprecation-for-Proxmox-VE.patch | 137 ++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 138 insertions(+) create mode 100644 debian/patches/pve/0052-adapt-machine-version-deprecation-for-Proxmox-VE.patch diff --git a/debian/patches/pve/0052-adapt-machine-version-deprecation-for-Proxmox-VE.patch b/debian/patches/pve/0052-adapt-machine-version-deprecation-for-Proxmox-VE.patch new file mode 100644 index 0000000..6c1a73a --- /dev/null +++ b/debian/patches/pve/0052-adapt-machine-version-deprecation-for-Proxmox-VE.patch @@ -0,0 +1,137 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Fiona Ebner +Date: Fri, 3 Jan 2025 14:03:12 +0100 +Subject: [PATCH] adapt machine version deprecation for Proxmox VE + +In commit a35f8577a0 ("include/hw: add macros for deprecation & +removal of versioned machines"), a new machine version deprecation and +removal policy was introduced. After only 3 years a machine version +will be deprecated while being removed after 6 years. + +The deprecation is a bit early considering major PVE releases are +approximately every 2 years. This means that a deprecation warning can +already happen for a machine version that was introduced during the +previous major release. This would scare users for no good reason, so +avoid deprecating machine versions in PVE too early and define a +baseline of machine versions that will be supported throughout a +single major PVE release. + +Signed-off-by: Fiona Ebner +--- + include/hw/boards.h | 78 +++++++++++++++++++++++++++++---------------- + 1 file changed, 51 insertions(+), 27 deletions(-) + +diff --git a/include/hw/boards.h b/include/hw/boards.h +index 5cddeb7fcb..b1e7787499 100644 +--- a/include/hw/boards.h ++++ b/include/hw/boards.h +@@ -607,42 +607,66 @@ struct MachineState { + + + /* +- * How many years/major releases for each phase +- * of the life cycle. Assumes use of versioning +- * scheme where major is bumped each year ++ * Baseline of machine versions that are still considered supported throughout ++ * current major Proxmox VE release. Machine versions older than this are ++ * considered to be deprecated in Proxmox VE. ++ * ++ * Machine versions older than 6 years are removed just like in upstream QEMU. ++ * (policy takes effect with QEMU 10.1). Assumes yearly major QEMU release. ++ * ++ * QEMU release cylce N.0 in ~April, N.1 in ~August, N.2 in ~December ++ * Debian/PVE release cylce ~every two years in summer ++ * ++ * PVE - last QEMU - machine versions dropped - baseline ++ * 8 9.2 2.3 and older 2.4 ++ * 9 11.2 5.2 and older 6.0 ++ * 10 13.2 7.2 and older 8.0 ++ */ ++#define MACHINE_VER_BASELINE_PVE_MAJOR 2 ++#define MACHINE_VER_BASELINE_PVE_MINOR 4 ++#define MACHINE_VER_DELETION_MAJOR (QEMU_VERSION_MAJOR - 6) ++#define MACHINE_VER_DELETION_MINOR QEMU_VERSION_MINOR ++ ++/* ++ * Proxmox VE needs to support the baseline throughout a major PVE release. So ++ * a QEMU release where the baseline is already deleted cannot be used. ++ * Removal policy after 6 years takes effect with QEMU 10.1. + */ +-#define MACHINE_VER_DELETION_MAJOR 6 +-#define MACHINE_VER_DEPRECATION_MAJOR 3 ++#if ((QEMU_VERSION_MAJOR > 10) || ((QEMU_VERSION_MAJOR == 10) && (QEMU_VERSION_MINOR >= 1))) ++#if ((MACHINE_VER_BASELINE_PVE_MAJOR < MACHINE_VER_DELETION_MAJOR) || \ ++ ((MACHINE_VER_BASELINE_PVE_MAJOR == MACHINE_VER_DELETION_MAJOR) && \ ++ (MACHINE_VER_BASELINE_PVE_MINOR < MACHINE_VER_DELETION_MINOR))) ++#error "Baseline machine version needed by Proxmox VE not supported anymore by this QEMU release" ++#endif ++#endif + + /* + * Expands to a static string containing a deprecation + * message for a versioned machine type + */ + #define MACHINE_VER_DEPRECATION_MSG \ +- "machines more than " stringify(MACHINE_VER_DEPRECATION_MAJOR) \ +- " years old are subject to deletion after " \ +- stringify(MACHINE_VER_DELETION_MAJOR) " years" +- +-#define _MACHINE_VER_IS_EXPIRED_IMPL(cutoff, major, minor) \ +- (((QEMU_VERSION_MAJOR - major) > cutoff) || \ +- (((QEMU_VERSION_MAJOR - major) == cutoff) && \ +- (QEMU_VERSION_MINOR - minor) >= 0)) +- +-#define _MACHINE_VER_IS_EXPIRED2(cutoff, major, minor) \ +- _MACHINE_VER_IS_EXPIRED_IMPL(cutoff, major, minor) +-#define _MACHINE_VER_IS_EXPIRED3(cutoff, major, minor, micro) \ +- _MACHINE_VER_IS_EXPIRED_IMPL(cutoff, major, minor) +-#define _MACHINE_VER_IS_EXPIRED4(cutoff, major, minor, _unused, tag) \ +- _MACHINE_VER_IS_EXPIRED_IMPL(cutoff, major, minor) +-#define _MACHINE_VER_IS_EXPIRED5(cutoff, major, minor, micro, _unused, tag) \ +- _MACHINE_VER_IS_EXPIRED_IMPL(cutoff, major, minor) +- +-#define _MACHINE_IS_EXPIRED(cutoff, ...) \ ++ "old machine version is subject to deletion during current major Proxmox VE release" ++ ++#define _MACHINE_VER_IS_EXPIRED_IMPL(baseline_major, baseline_minor, major, minor) \ ++ ((major < baseline_major) || \ ++ ((major == baseline_major) && \ ++ (minor < baseline_minor))) ++ ++#define _MACHINE_VER_IS_EXPIRED2(baseline_major, baseline_minor, major, minor) \ ++ _MACHINE_VER_IS_EXPIRED_IMPL(baseline_major, baseline_minor, major, minor) ++#define _MACHINE_VER_IS_EXPIRED3(baseline_major, baseline_minor, major, minor, micro) \ ++ _MACHINE_VER_IS_EXPIRED_IMPL(baseline_major, baseline_minor, major, minor) ++#define _MACHINE_VER_IS_EXPIRED4(baseline_major, baseline_minor, major, minor, _unused, tag) \ ++ _MACHINE_VER_IS_EXPIRED_IMPL(baseline_major, baseline_minor, major, minor) ++#define _MACHINE_VER_IS_EXPIRED5(baseline_major, baseline_minor, major, minor, micro, _unused, tag) \ ++ _MACHINE_VER_IS_EXPIRED_IMPL(baseline_major, baseline_minor, major, minor) ++ ++#define _MACHINE_IS_EXPIRED(baseline_major, baseline_minor, ...) \ + _MACHINE_VER_PICK(__VA_ARGS__, \ + _MACHINE_VER_IS_EXPIRED5, \ + _MACHINE_VER_IS_EXPIRED4, \ + _MACHINE_VER_IS_EXPIRED3, \ +- _MACHINE_VER_IS_EXPIRED2) (cutoff, __VA_ARGS__) ++ _MACHINE_VER_IS_EXPIRED2) (baseline_major, baseline_minor, __VA_ARGS__) + + /* + * Evaluates true when a machine type with (major, minor) +@@ -651,7 +675,7 @@ struct MachineState { + * lifecycle rules + */ + #define MACHINE_VER_IS_DEPRECATED(...) \ +- _MACHINE_IS_EXPIRED(MACHINE_VER_DEPRECATION_MAJOR, __VA_ARGS__) ++ _MACHINE_IS_EXPIRED(MACHINE_VER_BASELINE_PVE_MAJOR, MACHINE_VER_BASELINE_PVE_MINOR, __VA_ARGS__) + + /* + * Evaluates true when a machine type with (major, minor) +@@ -660,7 +684,7 @@ struct MachineState { + * lifecycle rules + */ + #define MACHINE_VER_SHOULD_DELETE(...) \ +- _MACHINE_IS_EXPIRED(MACHINE_VER_DELETION_MAJOR, __VA_ARGS__) ++ _MACHINE_IS_EXPIRED(MACHINE_VER_DELETION_MAJOR, MACHINE_VER_DELETION_MINOR, __VA_ARGS__) + + /* + * Sets the deprecation reason for a versioned machine based diff --git a/debian/patches/series b/debian/patches/series index 0b48878..9ebf335 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -61,3 +61,4 @@ pve/0048-PVE-backup-fixup-error-handling-for-fleecing.patch pve/0049-PVE-backup-factor-out-setting-up-snapshot-access-for.patch pve/0050-PVE-backup-save-device-name-in-device-info-structure.patch pve/0051-PVE-backup-include-device-name-in-error-when-setting.patch +pve/0052-adapt-machine-version-deprecation-for-Proxmox-VE.patch -- 2.39.5 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel