From nobody Thu Mar 28 19:26:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1515702230870701.0533598462729; Thu, 11 Jan 2018 12:23:50 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BD717C056826; Thu, 11 Jan 2018 20:23:32 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EA4AB5C258; Thu, 11 Jan 2018 20:23:29 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 5F36E18033DA; Thu, 11 Jan 2018 20:23:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w0BH9oO2016794 for ; Thu, 11 Jan 2018 12:09:51 -0500 Received: by smtp.corp.redhat.com (Postfix) id C5C3F8660B; Thu, 11 Jan 2018 17:09:50 +0000 (UTC) Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C052C86604 for ; Thu, 11 Jan 2018 17:09:44 +0000 (UTC) Received: from ot-mail-smtp-1.pulsation.fr (ot-mail-smtp-1.pulsation.fr [80.74.64.222]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A64DE552C7 for ; Thu, 11 Jan 2018 17:09:26 +0000 (UTC) Received: from KLK755.klksi.fr (unknown [37.157.230.10]) (Authenticated sender: b.cama@kerlink.fr) by smtp.oceamail.net (Postfix) with ESMTPA id 155EB12A5; Thu, 11 Jan 2018 18:09:24 +0100 (CET) Received: from bca by KLK755.klksi.fr with local (Exim 4.89) (envelope-from ) id 1eZgLz-0006tv-Mm; Thu, 11 Jan 2018 18:09:23 +0100 From: Benjamin Cama To: libvir-list@redhat.com Date: Thu, 11 Jan 2018 18:08:58 +0100 Message-Id: <20180111170858.26462-1-b.cama@kerlink.fr> MIME-Version: 1.0 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 207 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 11 Jan 2018 17:09:28 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 11 Jan 2018 17:09:28 +0000 (UTC) for IP:'80.74.64.222' DOMAIN:'ot-mail-smtp-1.pulsation.fr' HELO:'ot-mail-smtp-1.pulsation.fr' FROM:'bca@kerlink.fr' RCPT:'' X-RedHat-Spam-Score: -0.011 (RCVD_IN_DNSWL_NONE, SPF_PASS) 80.74.64.222 ot-mail-smtp-1.pulsation.fr 80.74.64.222 ot-mail-smtp-1.pulsation.fr X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-Mailman-Approved-At: Thu, 11 Jan 2018 15:23:20 -0500 Cc: Benjamin Cama Subject: [libvirt] [RFC PATCH] lxc: Up back the veth interfaces by default X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 11 Jan 2018 20:23:44 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Upping an interface without configuring it is not a =E2=80=9Ccardinal sin= =E2=80=9D but a sensible way to achieve auto-configuration, e.g. with IPv6 SLAAC (RFC 4862). If NetworkManager has troube with interfaces having only a link-local address, this is a bug in NetworkManager, not in libvirt; it should listen for router advertisements to decide if some interface has global connectivity or not. With network interfaces up by default, stateless containers can be easily auto-configured through the network with SLAAC, without any specific configuration from the host system. This reverts commit c3cf3c43a0bb2e0e4909c32821e20f607635ec85. Signed-off-by: Benjamin Cama --- Hi, The patch that I propose to revert basically broke my workflow for light stateless containers, where they could be auto-configured on IPv6-only netw= ork through SLAAC. Of course, fully-fledged containers can bring up the interfa= ce themselves, but this behavior had previously been the default for quite some time, and is even indicated as default in src/conf/domain_conf.h ("Default = link state (up)"). I cannot find any real justification for the patch I am reverting, and the bugzilla looks private so I can not comment on the NetworkManager behavior, which looks very buggy to me. Please tell me if you think this is wrong. Also, please Cc me, I am not subscribed. Regards. .mailmap | 1 + src/lxc/lxc_container.c | 7 +------ src/lxc/lxc_native.c | 10 ++++++---- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.mailmap b/.mailmap index 2f0fc901e..9dc3bff85 100644 --- a/.mailmap +++ b/.mailmap @@ -36,6 +36,7 @@ + diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c index 96fceaf1b..e546f0aaf 100644 --- a/src/lxc/lxc_container.c +++ b/src/lxc/lxc_container.c @@ -517,12 +517,7 @@ lxcContainerRenameAndEnableInterfaces(virDomainDefPtr = vmDef, if (virNetDevSetName(veths[i], newname) < 0) goto cleanup; =20 - /* Only enable this device if there is a reason to do so (either - * at least one IP was specified, or link state was set to up in - * the config) - */ - if (netDef->guestIP.nips || - netDef->linkstate =3D=3D VIR_DOMAIN_NET_INTERFACE_LINK_STATE_U= P) { + if (netDef->linkstate !=3D VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOW= N) { VIR_DEBUG("Enabling %s", newname); if (virNetDevSetOnline(newname, true) < 0) goto cleanup; diff --git a/src/lxc/lxc_native.c b/src/lxc/lxc_native.c index fdc03a57e..f77a2a910 100644 --- a/src/lxc/lxc_native.c +++ b/src/lxc/lxc_native.c @@ -349,10 +349,12 @@ lxcCreateNetDef(const char *type, if (VIR_ALLOC(net) < 0) goto error; =20 - if (STREQ_NULLABLE(flag, "up")) - net->linkstate =3D VIR_DOMAIN_NET_INTERFACE_LINK_STATE_UP; - else - net->linkstate =3D VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN; + if (flag) { + if (STREQ(flag, "up")) + net->linkstate =3D VIR_DOMAIN_NET_INTERFACE_LINK_STATE_UP; + else + net->linkstate =3D VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN; + } =20 if (VIR_STRDUP(net->ifname_guest, name) < 0) goto error; --=20 2.11.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list