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 5537C748E1 for ; Fri, 9 Jul 2021 15:31:18 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 48419272CA for ; Fri, 9 Jul 2021 15:31:18 +0200 (CEST) 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 id B3455272BE for ; Fri, 9 Jul 2021 15:31:17 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 75E5640F91 for ; Fri, 9 Jul 2021 15:31:17 +0200 (CEST) Message-ID: <86d40e42-4ce1-be95-ea5a-78f8c2483536@proxmox.com> Date: Fri, 9 Jul 2021 15:30:57 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:90.0) Gecko/20100101 Thunderbird/90.0 Content-Language: en-US To: Proxmox VE development discussion , Fabian Ebner References: <20210708112535.147775-3-s.reiter@proxmox.com> <20210708114602.346989-1-s.reiter@proxmox.com> From: Thomas Lamprecht In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL 0.478 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -0.001 Looks like a legit reply (A) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [qemuserver.pm] Subject: Re: [pve-devel] [PATCH v2 qemu-server 3/3] restore: remove efidisk from config if not backed up 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, 09 Jul 2021 13:31:18 -0000 On 09.07.21 09:11, Fabian Ebner wrote: > Am 08.07.21 um 13:46 schrieb Stefan Reiter: >> If it doesn't exist, there's no need to keep it around at all. Such a >> backup might easily be created if an efidisk is configured with BIOS >> set to anything but 'OVMF'. >> >> Unbreaks live-restore for such cases too. >> >> Signed-off-by: Stefan Reiter >> --- >> >> v1->v2: >> * Actually remove efidisk from config, not just from launched version = for >> =C2=A0=C2=A0 live-restore - first, this allows one to restart the VM a= fter the live-restore >> =C2=A0=C2=A0 is done without errors, and second this way it also appli= es for normal >> =C2=A0=C2=A0 restores (no reason to keep an efidisk configured that do= esn't exist). >> =C2=A0=C2=A0 After testing both I think I like this approach better, b= ut feel free to keep >> =C2=A0=C2=A0 the v1 version too... >> >> =C2=A0 PVE/QemuServer.pm | 8 +++++++- >> =C2=A0 1 file changed, 7 insertions(+), 1 deletion(-) >> >> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm >> index 4082e69..9af0ad3 100644 >> --- a/PVE/QemuServer.pm >> +++ b/PVE/QemuServer.pm >> @@ -6044,7 +6044,7 @@ my $restore_allocate_devices =3D sub { >> =C2=A0 }; >> =C2=A0 =C2=A0 sub restore_update_config_line { >> -=C2=A0=C2=A0=C2=A0 my ($cookie, $map, $line, $unique) =3D @_; >> +=C2=A0=C2=A0=C2=A0 my ($cookie, $map, $line, $unique, $rpcenv) =3D @_= ; >> >=20 > General question, because this will pop up often with the new task warn= ings: should using RPCEnvironment::get() within each function that needs = it be preferred over passing it around as a parameter? Good question I asked myself recently. FWIW, status quo is that we normally only get the RPCEnv in the API and t= hen pass it along. I broke that recently once when adding the better warn for the CT start, = but explicitly made it such that it won't fail if a RPCEnv singleton isn't in= stantiated, and I was not too happy with it, is was rather done out of time pressure = for the release. In general I'd rather try to avoid using side-effects in "pure" methods, = that are only helpers or "bussiness-logic", and try to contain RPCEnv to the A= PI/CLI if possible. If one would need to add a new $rpcenv param to 3+ methods to c= hain it through it may be a sign that there's a general design issue with the app= roach taken though.