From 87c86e22017faf052ceae083d01f4f8b08dc8dd5 Mon Sep 17 00:00:00 2001
From: Nikolai Kostrigin <nickel@altlinux.org>
Date: Thu, 17 Nov 2022 13:30:50 +0300
Subject: [PATCH] vm-run: Define MAXCPU=255 for x86_64

This fixes autodetection issue for machine with more than 255 logical cores:

"qemu-system-x86_64: Invalid SMP CPUs 256. The max CPUs supported by machine
'pc-i440fx-6.2' is 255"

Link: https://bugzilla.altlinux.org/44337
Signed-off-by: Nikolai Kostrigin <nickel@altlinux.org>
---
 vm-run | 1 +
 1 file changed, 1 insertion(+)

diff --git a/vm-run b/vm-run
index 028f691..54b8345 100755
--- a/vm-run
+++ b/vm-run
@@ -274,6 +274,7 @@ case "$HOSTTYPE" in
 		PACKAGE=qemu-system-x86-core
 		CONSOLE=ttyS0
 		QEMU=qemu-system-x86_64
+		MAXCPU=255
 		EDK2=/usr/share/OVMF
 		EFI_CODE=OVMF_CODE.fd
 		SB_PFLASH="OVMF_CODE.secboot.fd OVMF_VARS.secboot.fd"
-- 
2.33.5