From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu v2 01/18] adapt machine version deprecation for Proxmox VE
Date: Thu, 16 Jan 2025 12:50:37 +0100 [thread overview]
Message-ID: <20250116115054.124447-2-f.ebner@proxmox.com> (raw)
In-Reply-To: <20250116115054.124447-1-f.ebner@proxmox.com>
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 <martin@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
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 <f.ebner@proxmox.com>
+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 <f.ebner@proxmox.com>
+---
+ 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
next prev parent reply other threads:[~2025-01-16 11:52 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-16 11:50 [pve-devel] [PATCH qemu/qemu-server/docs v2 00/18] adapt to changes in QEMU machine version deprecation/removal Fiona Ebner
2025-01-16 11:50 ` Fiona Ebner [this message]
2025-01-16 11:50 ` [pve-devel] [PATCH qemu-server v2 02/18] machine: drop unused parameter from assert_valid_machine_property() helper Fiona Ebner
2025-01-16 11:50 ` [pve-devel] [PATCH qemu-server v2 03/18] move get_command_for_arch() helper to helpers module Fiona Ebner
2025-01-17 12:20 ` Thomas Lamprecht
2025-01-16 11:50 ` [pve-devel] [PATCH qemu-server v2 04/18] helpers: improve name for variable for mapping arch to binary Fiona Ebner
2025-01-17 12:19 ` Thomas Lamprecht
2025-01-16 11:50 ` [pve-devel] [PATCH qemu-server v2 05/18] move kvm_user_version() function to helpers module Fiona Ebner
2025-01-16 11:50 ` [pve-devel] [PATCH qemu-server v2 06/18] move get_vm_arch() helper " Fiona Ebner
2025-01-16 11:50 ` [pve-devel] [PATCH qemu-server v2 07/18] machine: add default_machine_for_arch() helper Fiona Ebner
2025-01-16 11:50 ` [pve-devel] [PATCH qemu-server v2 08/18] move get_installed_machine_version() helper to machine module Fiona Ebner
2025-01-16 11:50 ` [pve-devel] [PATCH qemu-server v2 09/18] move windows_get_pinned_machine_version() function " Fiona Ebner
2025-01-16 11:50 ` [pve-devel] [PATCH qemu-server v2 10/18] move get_vm_machine() " Fiona Ebner
2025-01-16 11:50 ` [pve-devel] [PATCH qemu-server v2 11/18] move meta information handling to its own module Fiona Ebner
2025-01-16 11:50 ` [pve-devel] [PATCH qemu-server v2 12/18] machine: get vm machine: fallback to creation QEMU version for windows starting with 9.1 Fiona Ebner
2025-01-17 9:19 ` Thomas Lamprecht
2025-01-17 9:27 ` Fiona Ebner
2025-01-17 9:58 ` Thomas Lamprecht
2025-01-16 11:50 ` [pve-devel] [PATCH qemu-server v2 13/18] machine: add check_and_pin_machine_string() helper Fiona Ebner
2025-01-16 11:50 ` [pve-devel] [PATCH qemu-server v2 14/18] api: update vm config: pin machine version when switching to windows os type Fiona Ebner
2025-01-16 11:50 ` [pve-devel] [PATCH qemu-server v2 15/18] machine: log informational line when pinning machine version for Windows guest Fiona Ebner
2025-01-16 11:50 ` [pve-devel] [PATCH qemu-server v2 16/18] machine: rename machine_version() function to machine_version_at_least() Fiona Ebner
2025-01-17 12:39 ` Thomas Lamprecht
2025-01-17 13:33 ` Fiona Ebner
2025-01-17 13:43 ` Thomas Lamprecht
2025-01-16 11:50 ` [pve-devel] [PATCH qemu-server v2 17/18] machine: code cleanup: avoid superfluous augmented assignment operator Fiona Ebner
2025-01-16 11:50 ` [pve-devel] [PATCH docs v2 18/18] qm: machine version: document support in PVE Fiona Ebner
2025-01-17 13:07 ` Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250116115054.124447-2-f.ebner@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal