all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server 1/3] query cpu flags: fix detecting KVM support
Date: Tue, 27 Jan 2026 17:14:59 +0100	[thread overview]
Message-ID: <20260127161558.225510-2-f.ebner@proxmox.com> (raw)
In-Reply-To: <20260127161558.225510-1-f.ebner@proxmox.com>

KVM can only be used when the host arch matches the vCPU arch.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 src/PVE/QemuServer.pm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 7a0a2606..ebb6ae19 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -2939,7 +2939,8 @@ sub vga_conf_has_spice {
 sub query_supported_cpu_flags {
     my ($arch) = @_;
 
-    $arch //= get_host_arch();
+    my $host_arch = get_host_arch();
+    $arch //= $host_arch;
     my $default_machine = PVE::QemuServer::Machine::default_machine_for_arch($arch);
 
     my $flags = {};
@@ -2949,7 +2950,7 @@ sub query_supported_cpu_flags {
     die "QEMU/KVM cannot detect CPU flags on ARM (aarch64)\n"
         if $arch eq "aarch64";
 
-    my $kvm_supported = defined(kvm_version());
+    my $kvm_supported = defined(kvm_version()) && $arch eq $host_arch;
     my $qemu_cmd = PVE::QemuServer::Helpers::get_command_for_arch($arch);
     my $fakevmid = -1;
     my $pidfile = PVE::QemuServer::Helpers::vm_pidfile_name($fakevmid);
-- 
2.47.3



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  reply	other threads:[~2026-01-27 16:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-27 16:14 [pve-devel] [PATCH-SERIES qemu-server 0/3] query cpu flags: support aarch64 host Fiona Ebner
2026-01-27 16:14 ` Fiona Ebner [this message]
2026-01-27 16:15 ` [pve-devel] [PATCH qemu-server 2/3] query cpu flags: query correct model for TCG Fiona Ebner
2026-01-27 16:15 ` [pve-devel] [PATCH qemu-server 3/3] query cpu flags: support aarch64 host Fiona Ebner

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=20260127161558.225510-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