From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 6D9CD1FF2CA for ; Tue, 23 Jul 2024 16:00:05 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D9AE64CB5; Tue, 23 Jul 2024 16:00:38 +0200 (CEST) Message-ID: <6201e0b2-4712-4ad0-8561-a33e970cd427@proxmox.com> Date: Tue, 23 Jul 2024 16:00:35 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Proxmox VE development discussion , Stefan Hanreich References: <20240723131409.132792-1-s.hanreich@proxmox.com> Content-Language: en-US From: Fiona Ebner In-Reply-To: <20240723131409.132792-1-s.hanreich@proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL -0.061 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 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 qemu-server 1/1] fix #5619: honor link_down setting when hot-plugging nic 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: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Am 23.07.24 um 15:14 schrieb Stefan Hanreich: > When detaching and attaching the network device on update, the > link_down setting is not considered and the network device always gets > attached to the guest - even if link_down is set. > > Fixes: 3f14f206 ("nic online bridge/vlan change: link disconnect/reconnect") > Please don't use newlines between trailers. > Signed-off-by: Stefan Hanreich Reviewed-by: Fiona Ebner > --- > PVE/QemuServer.pm | 12 ++++-------- > 1 file changed, 4 insertions(+), 8 deletions(-) > > diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm > index 88c274d..19e59a8 100644 > --- a/PVE/QemuServer.pm > +++ b/PVE/QemuServer.pm > @@ -5339,20 +5339,16 @@ sub vmconfig_update_net { > PVE::Network::tap_plug($iface, $newnet->{bridge}, $newnet->{tag}, $newnet->{firewall}, $newnet->{trunks}, $newnet->{rate}); > } > > - #set link_up in guest if bridge or vlan change to notify guest (dhcp renew for example) I'd prefer to not remove the comment completely, but adapt and move it to below. Then nobody needs to wonder why link status is set if only bridge or tag changes for example. > - if (safe_string_ne($oldnet->{bridge}, $newnet->{bridge}) || > - safe_num_ne($oldnet->{tag}, $newnet->{tag}) > - ) { > - qemu_set_link_status($vmid, $opt, 1); > - } > - > } elsif (safe_num_ne($oldnet->{rate}, $newnet->{rate})) { > # Rate can be applied on its own but any change above needs to > # include the rate in tap_plug since OVS resets everything. > PVE::Network::tap_rate_limit($iface, $newnet->{rate}); > } > > - if (safe_string_ne($oldnet->{link_down}, $newnet->{link_down})) { > + if (safe_string_ne($oldnet->{link_down}, $newnet->{link_down}) > + || safe_string_ne($oldnet->{bridge}, $newnet->{bridge}) > + || safe_num_ne($oldnet->{tag}, $newnet->{tag}) > + ) { > qemu_set_link_status($vmid, $opt, !$newnet->{link_down}); > } > _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel