From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id B08D01FF0BC for ; Wed, 02 Dec 2026 18:46:08 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 335E2217EA; Wed, 02 Dec 2026 18:45:49 +0100 (CET) From: Jonas Theisen To: pve-devel@lists.proxmox.com Subject: [PATCH qemu-server v4 2/7] migrate: allow CPU checks that only need information of the target Date: Wed, 2 Dec 2026 18:45:19 +0100 Message-ID: <20261202174530.565487-3-j.theisen@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261202174530.565487-1-j.theisen@proxmox.com> References: <20261202174530.565487-1-j.theisen@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1796233544520 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.053 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: C2YMTTGJOWA7XYUFKNPEC2YRGLI32XSK X-Message-ID-Hash: C2YMTTGJOWA7XYUFKNPEC2YRGLI32XSK X-MailFrom: j.theisen@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The CPU checks for live migration compare the CPU information of the source and the target node, so they require it from both. Checks that only depend on the target, for example whether it can run the VM with the TSC frequency it was started with, do not need it from the source. Allow marking such checks, so that they are not skipped with a warning if only the source lacks the information, and a target lacking it is reported regardless of the source. Signed-off-by: Jonas Theisen --- src/PVE/QemuMigrate/Helpers.pm | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/PVE/QemuMigrate/Helpers.pm b/src/PVE/QemuMigrate/Helpers.pm index 22ed96d7..685ce9e7 100644 --- a/src/PVE/QemuMigrate/Helpers.pm +++ b/src/PVE/QemuMigrate/Helpers.pm @@ -341,6 +341,7 @@ my sub get_missing_vm_cpu_flags { # - 'override', optionally, the migration option that allows ignoring an error # - 'needs', listing the CPU information the check requires of the target node and, to compare # them, of this node, nodes lacking any of it are skipped +# - 'target-only', set if the check does not need the CPU information of this node # - 'applies', returning true if the check is relevant for the VM's CPU # - 'check', returning why the target node is incompatible, if it is, and optionally the details # of the incompatibility, see $cpu_issue_details @@ -514,19 +515,23 @@ my $target_cpu_checks = [ # Returns the issues of the target node. If it lacks CPU information needed by a check that can # prevent the migration, that is an issue as well, but only a warning, as the node is not refused. # Information this node lacks as well, for example the vendor of an unknown ARM CPU, is not -# reported. Lost CPU flags of this node are reported, as it cannot determine them itself. +# reported, unless the check only needs the information of the target node. Lost CPU flags of this +# node are reported, as it cannot determine them itself. my sub get_target_cpu_issues { my ($cpu, $checks, $source_info, $target_info) = @_; my ($issues, $target_complete, $source_complete) = ([], 1, 1); for my $check ($checks->@*) { - my $blocking = $check->{severity} eq 'error'; + my ($blocking, $target_only) = ($check->{severity} eq 'error', $check->{'target-only'}); my @missing = grep { !defined($target_info->{$_}) } $check->{needs}->@*; if (scalar(@missing)) { - $target_complete = 0 if $blocking && grep { defined($source_info->{$_}) } @missing; + $target_complete = 0 + if $blocking && ($target_only || grep { defined($source_info->{$_}) } @missing); next; } - if (my @source_missing = grep { !defined($source_info->{$_}) } $check->{needs}->@*) { + my @source_missing = + $target_only ? () : grep { !defined($source_info->{$_}) } $check->{needs}->@*; + if (scalar(@source_missing)) { # This node determines its other information itself if it does not broadcast it, but # its CPU flags can get lost, for example as pmxcfs was restarted. $source_complete = 0 if $blocking && grep { $_ eq 'kvm-flags' } @source_missing; @@ -599,9 +604,9 @@ or C if it might not, a human-readable C, and optionally C with severity C, unless this node lacks that -information as well. If this node lacks its broadcast CPU flags, all nodes have such an issue, as -the checks needing them are skipped. If a migration option allows ignoring an error, C -names it. +information as well and the check compares it. If this node lacks its broadcast CPU flags, all +nodes have such an issue, as the checks needing them are skipped. If a migration option allows +ignoring an error, C names it. =cut -- 2.47.3