[pve-devel] [PATCH qemu 01/19] weaken machine version deprecation warning

Fiona Ebner f.ebner at proxmox.com
Fri Jan 3 16:57:44 CET 2025


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.

PVE will warn about deprecated machine versions when it considers them
to be deprecated, so avoid a scary-sounding warning from QEMU proper
and turn it into an informational message about pre-deprecation.

Reported-by: Martin Maurer <martin at proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
 ...-machine-version-deprecation-warning.patch | 56 +++++++++++++++++++
 debian/patches/series                         |  1 +
 2 files changed, 57 insertions(+)
 create mode 100644 debian/patches/pve/0052-weaken-machine-version-deprecation-warning.patch

diff --git a/debian/patches/pve/0052-weaken-machine-version-deprecation-warning.patch b/debian/patches/pve/0052-weaken-machine-version-deprecation-warning.patch
new file mode 100644
index 0000000..b8cfc67
--- /dev/null
+++ b/debian/patches/pve/0052-weaken-machine-version-deprecation-warning.patch
@@ -0,0 +1,56 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Fiona Ebner <f.ebner at proxmox.com>
+Date: Fri, 3 Jan 2025 14:03:12 +0100
+Subject: [PATCH] weaken machine version deprecation warning
+
+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.
+
+PVE will warn about deprecated machine versions when it considers them
+to be deprecated, so avoid a scary-sounding warning from QEMU proper
+and turn it into an informational message about pre-deprecation.
+
+Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
+---
+ include/hw/boards.h | 4 +---
+ system/vl.c         | 2 +-
+ 2 files changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/include/hw/boards.h b/include/hw/boards.h
+index 5cddeb7fcb..4f30824b57 100644
+--- a/include/hw/boards.h
++++ b/include/hw/boards.h
+@@ -619,9 +619,7 @@ struct MachineState {
+  * 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"
++    "machine version is rather old"
+ 
+ #define _MACHINE_VER_IS_EXPIRED_IMPL(cutoff, major, minor) \
+     (((QEMU_VERSION_MAJOR - major) > cutoff) || \
+diff --git a/system/vl.c b/system/vl.c
+index 0dbdba6421..67822c6b6c 100644
+--- a/system/vl.c
++++ b/system/vl.c
+@@ -3769,7 +3769,7 @@ void qemu_init(int argc, char **argv)
+ 
+     machine_class = MACHINE_GET_CLASS(current_machine);
+     if (!qtest_enabled() && machine_class->deprecation_reason) {
+-        warn_report("Machine type '%s' is deprecated: %s",
++        info_report("Machine type '%s': %s",
+                      machine_class->name, machine_class->deprecation_reason);
+     }
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 0b48878..ffbfd29 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-weaken-machine-version-deprecation-warning.patch
-- 
2.39.5





More information about the pve-devel mailing list