From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server 17/19] machine: adapt to changes in QEMU machine version deprecation/removal
Date: Fri, 3 Jan 2025 16:58:00 +0100 [thread overview]
Message-ID: <20250103155802.143669-18-f.ebner@proxmox.com> (raw)
In-Reply-To: <20250103155802.143669-1-f.ebner@proxmox.com>
In QEMU 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.
The new policy takes effect only in QEMU 10.1, see QEMU commit
c9fd2d9a48 ("include/hw: temporarily disable deletion of versioned
machine types"). Machine versions <=2.3 were already deprecated for a
while, with PVE also warning about it since commit dec371d9 ("vm
start: add warning about deprecated machine version") in qemu-server
8.0.8. These have been dropped in QEMU 9.1, so the baseline for PVE 8
is 2.4.
Reported-by: Martin Maurer <martin@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
PVE/QemuServer.pm | 19 +++++++++++++------
PVE/QemuServer/Machine.pm | 31 +++++++++++++++++++++++++++++--
2 files changed, 42 insertions(+), 8 deletions(-)
diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 5e577431..5abd7bc8 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -6018,13 +6018,20 @@ sub vm_start_nolock {
PVE::GuestHelpers::exec_hookscript($conf, $vmid, 'post-start');
- my ($current_machine, $is_deprecated) =
+ my ($current_machine, $removal_during_pve_release) =
PVE::QemuServer::Machine::get_current_qemu_machine($vmid);
- if ($is_deprecated) {
- log_warn(
- "current machine version '$current_machine' is deprecated - see the documentation and ".
- "change to a newer one",
- );
+ if ($removal_during_pve_release) {
+ if ($removal_during_pve_release eq 'current') {
+ log_warn(
+ "current machine version '$current_machine' is deprecated - see the documentation"
+ ." and change to a newer one",
+ );
+ } elsif ($removal_during_pve_release eq 'next') {
+ print "INFO: current machine version '$current_machine' is rather old - see the"
+ ." documentation for more information\n";
+ } else {
+ log_warn("unexpected machine version deprecation status '$removal_during_pve_release'");
+ }
}
return $res;
diff --git a/PVE/QemuServer/Machine.pm b/PVE/QemuServer/Machine.pm
index 6398e756..79be4a0e 100644
--- a/PVE/QemuServer/Machine.pm
+++ b/PVE/QemuServer/Machine.pm
@@ -83,7 +83,10 @@ sub machine_type_is_q35 {
return $machine_conf->{type} && ($machine_conf->{type} =~ m/q35/) ? 1 : 0;
}
-# In list context, also returns whether the current machine is deprecated or not.
+# In list context, also returns the deprecation status of the current machine:
+# undef - machine version is not deprecated
+# 'current' - machine version will be removed during the 'current' major PVE release
+# 'next' - machine version will be removed during the 'next' major PVE release
sub current_from_query_machines {
my ($machines) = @_;
@@ -95,7 +98,31 @@ sub current_from_query_machines {
$current = $machine->{name};
# pve-version only exists for the current machine
$current .= "+$machine->{'pve-version'}" if $machine->{'pve-version'};
- return wantarray ? ($current, $machine->{deprecated} ? 1 : 0) : $current;
+
+ return $current if !wantarray;
+
+ # Machine versions older than this are considered to be deprecated in Proxmox VE.
+ #
+ # See include/hw/boards.h in QEMU: QEMU will delete machine versions after 6 major
+ # releases. This policy takes effect with QEMU 10.1.
+ #
+ # 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
+ #
+ # TODO PVE 9 - check the above comment still applies and update baseline accordingly
+ my $removal_during_pve_release;
+ # NOTE the order of the checks matters
+ $removal_during_pve_release = 'next'
+ if !machine_version_at_least($machine->{name}, 6, 0);
+ $removal_during_pve_release = 'current'
+ if !machine_version_at_least($machine->{name}, 2, 4);
+
+ return ($current, $removal_during_pve_release);
}
}
--
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-03 16:05 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-03 15:57 [pve-devel] [PATCH qemu/qemu-server/docs 00/19] " Fiona Ebner
2025-01-03 15:57 ` [pve-devel] [PATCH qemu 01/19] weaken machine version deprecation warning Fiona Ebner
2025-01-03 15:57 ` [pve-devel] [PATCH qemu-server 02/19] machine: drop unused parameter from assert_valid_machine_property() helper Fiona Ebner
2025-01-03 15:57 ` [pve-devel] [PATCH qemu-server 03/19] move get_command_for_arch() helper to helpers module Fiona Ebner
2025-01-03 15:57 ` [pve-devel] [PATCH qemu-server 04/19] helpers: improve name for variable for mapping arch to binary Fiona Ebner
2025-01-03 15:57 ` [pve-devel] [PATCH qemu-server 05/19] move kvm_user_version() function to helpers module Fiona Ebner
2025-01-03 15:57 ` [pve-devel] [PATCH qemu-server 06/19] move get_vm_arch() helper " Fiona Ebner
2025-01-03 15:57 ` [pve-devel] [PATCH qemu-server 07/19] machine: add default_machine_for_arch() helper Fiona Ebner
2025-01-03 15:57 ` [pve-devel] [PATCH qemu-server 08/19] move get_installed_machine_version() helper to machine module Fiona Ebner
2025-01-03 15:57 ` [pve-devel] [PATCH qemu-server 09/19] move windows_get_pinned_machine_version() function " Fiona Ebner
2025-01-03 15:57 ` [pve-devel] [PATCH qemu-server 10/19] move get_vm_machine() " Fiona Ebner
2025-01-03 15:57 ` [pve-devel] [PATCH qemu-server 11/19] move meta information handling to its own module Fiona Ebner
2025-01-03 15:57 ` [pve-devel] [PATCH qemu-server 12/19] machine: get vm machine: fallback to creation QEMU version for windows starting with 9.1 Fiona Ebner
2025-01-03 15:57 ` [pve-devel] [PATCH qemu-server 13/19] machine: add check_and_pin_machine_string() helper Fiona Ebner
2025-01-03 15:57 ` [pve-devel] [RFC qemu-server 14/19] api: update vm config: pin machine version when switching to windows os type Fiona Ebner
2025-01-03 15:57 ` [pve-devel] [PATCH qemu-server 15/19] machine: log informational line when pinning machine version for Windows guest Fiona Ebner
2025-01-03 15:57 ` [pve-devel] [PATCH qemu-server 16/19] machine: rename machine_version() function to machine_version_at_least() Fiona Ebner
2025-01-03 15:58 ` Fiona Ebner [this message]
2025-01-03 15:58 ` [pve-devel] [PATCH qemu-server 18/19] machine: code cleanup: avoid superfluous augmented assignment operator Fiona Ebner
2025-01-03 15:58 ` [pve-devel] [PATCH docs 19/19] qm: machine version: document support in PVE Fiona Ebner
2025-01-04 7:58 ` [pve-devel] [PATCH qemu/qemu-server/docs 00/19] adapt to changes in QEMU machine version deprecation/removal Dietmar Maurer
2025-01-04 8:00 ` Dietmar Maurer
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=20250103155802.143669-18-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox