public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Jonas Theisen <j.theisen@proxmox.com>
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	[thread overview]
Message-ID: <20261202174530.565487-3-j.theisen@proxmox.com> (raw)
In-Reply-To: <20261202174530.565487-1-j.theisen@proxmox.com>

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 <j.theisen@proxmox.com>
---
 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<warning> if it might not, a human-readable C<message>, and optionally C<det
 values the message contains, see cpu_issue_details_schema(). Nodes that lack CPU information
 needed by a check that can prevent the migration, for example as they run an older version, have
 an issue of type C<missing-cpu-info> with severity C<warning>, 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<override>
-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<override> names it.
 
 =cut
 
-- 
2.47.3





  parent reply	other threads:[~2026-12-02 17:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02 17:45 [PATCH docs/qemu-server v4 0/7] live migrate VMs with an invariant TSC or re-enlightenment Jonas Theisen
2026-12-02 17:45 ` [PATCH qemu-server v4 1/7] helpers: add helper to query the host's TSC frequency and scaling support Jonas Theisen
2026-12-02 17:45 ` Jonas Theisen [this message]
2026-12-02 17:45 ` [PATCH qemu-server v4 3/7] cpu config: add hv-reenlightenment flag and set TSC frequency for it Jonas Theisen
2026-12-02 17:45 ` [PATCH qemu-server v4 4/7] migrate: block migration to nodes that cannot provide the TSC frequency Jonas Theisen
2026-12-02 17:45 ` [PATCH qemu-server v4 5/7] cpu flags: report invtsc support of nodes Jonas Theisen
2026-12-02 17:45 ` [PATCH qemu-server v4 6/7] cpu config: set TSC frequency for invtsc to allow live migration Jonas Theisen
2026-12-02 17:45 ` [PATCH docs v4 7/7] qm: document hv-reenlightenment and invtsc Jonas Theisen

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=20261202174530.565487-3-j.theisen@proxmox.com \
    --to=j.theisen@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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal