From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 3CE29B8797 for ; Fri, 8 Mar 2024 14:53:33 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0B8FFE4BE for ; Fri, 8 Mar 2024 14:53:03 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Fri, 8 Mar 2024 14:53:02 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 2B066488AD for ; Fri, 8 Mar 2024 14:53:02 +0100 (CET) Message-ID: Date: Fri, 8 Mar 2024 14:53:00 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Proxmox VE development discussion , Thomas Lamprecht , Filip Schauer References: <20240221143317.134090-1-f.schauer@proxmox.com> <20240221143317.134090-7-f.schauer@proxmox.com> <3b011cca-126a-46ec-9ecd-fcb421dcb675@proxmox.com> From: Fiona Ebner In-Reply-To: <3b011cca-126a-46ec-9ecd-fcb421dcb675@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.071 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: Re: [pve-devel] [PATCH qemu-server 5/5] cpu config: die on hotplug of non x86_64 CPUs X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2024 13:53:33 -0000 Am 08.03.24 um 14:34 schrieb Thomas Lamprecht: > Am 21/02/2024 um 15:33 schrieb Filip Schauer: >> When attempting a CPU hotplug on an architecture other than x86_64, die >> with a clean error instead of attempting a hotplug with a known >> non-working device command line. Also move the corresponding FIXME up to >> the error. >> >> Signed-off-by: Filip Schauer >> --- >> PVE/QemuServer/CPUConfig.pm | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/PVE/QemuServer/CPUConfig.pm b/PVE/QemuServer/CPUConfig.pm >> index 7d471f4..01e4515 100644 >> --- a/PVE/QemuServer/CPUConfig.pm >> +++ b/PVE/QemuServer/CPUConfig.pm >> @@ -417,6 +417,9 @@ sub get_custom_model { >> sub print_cpu_device { >> my ($conf, $arch, $id) = @_; >> >> + # FIXME: hot plugging other architectures like our unofficial arch64 support? >> + die "Hotplug of non x86_64 CPU not yet supported" if $arch != 'x86_64'; > > arbitrary strings need to be compared using `eq` and `ne`, as `==` and `!=` can > only be used for numerics or strings that can be interpreted to one, so this never > could work. > > Interestingly the if never triggers in the `!=` case but always triggers in the > `==` case. > Because strings that cannot be parsed as a number are interpreted as 0, so both (invalid) sides will be 0. Description of parsing rules (from [0], wasn't able to find in official docs): > It follows these basic rules: > > Ignore leading whitespace. This is handy when you extract a field out of columnar data and the number doesn't take up the entire column. > Allow for a single leading sign (+ or -) > Skip leading zeros (so, no octal) > Capture decimal ASCII digits (0,1,2,3,4,5,6,7,8,9), allowing for a single decimal point (so, no semantic versioning numbers) > Stop at the first non-decimal-digit character > Whatever you have so far is the number. If you have nothing, the number is 0. [0]: https://stackoverflow.com/questions/70482447/why-is-00-equal-to-0-in-perl/70496787#70496787