From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 513101FF137 for ; Tue, 03 Feb 2026 16:04:21 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5C9E122509; Tue, 3 Feb 2026 16:04:50 +0100 (CET) Message-ID: <96b3810e-bb32-4045-bbeb-f5aa4c82d3f4@proxmox.com> Date: Tue, 3 Feb 2026 16:04:15 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: [PATCH qemu-server 1/2] tests: improve multiarch build support To: Thomas Lamprecht , pve-devel@lists.proxmox.com References: <20260203142209.3614946-1-d.csapak@proxmox.com> Content-Language: en-US From: Dominik Csapak In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1770130980845 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.032 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 Message-ID-Hash: JEZPL3OAFG5WPMAYH5H6KB44NI6FNYMD X-Message-ID-Hash: JEZPL3OAFG5WPMAYH5H6KB44NI6FNYMD X-MailFrom: d.csapak@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: On 2/3/26 3:59 PM, Thomas Lamprecht wrote: > Am 03.02.26 um 15:21 schrieb Dominik Csapak: >> The CPUConfig module sets the local 'host_arch' on loading, so instead >> to try to mock all subs that access this variable, provide a setter only >> intended for tests (and warn when using this). > > Would be nicer to get a local get_host_arch that just return's the PVE::Tools' > method result, as we then could override the getter without having to worry > about this method being misused in the future by accident. > > Moving the CPU model initialization into a sub, like suggested in my reply > to Fiona's patches, and redoing that on a simulated switch of the host > architecture would be also the slightly nicer interface IMO. > ok, makes sense, i'd do that in a v2 >> >> Also, we have to override the 'get_host_arch' in the Helpers module too. > > The helper module has no such method? There is only get_vm_arch there and > some usage of PVE::Tools' get_host_arch? Or is it because we import the one > from PVE::Tools there? > yes, exactly. The importing and using of a sub means that when mocking we have to mock it in the module we're using it. alternatively, we could write out 'PVE::Tools::get_host_arch' everywhere without importing, then we'd only have to mock once (but makes the code slightly less readable)