From nobody Fri Apr 19 03:08:10 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; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1543375518393911.5009859222074; Tue, 27 Nov 2018 19:25:18 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E89E081F11; Wed, 28 Nov 2018 03:25:14 +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 B45DE19749; Wed, 28 Nov 2018 03:25:13 +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 C5ED918005B1; Wed, 28 Nov 2018 03:25:08 +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 wAS3P7SN022358 for ; Tue, 27 Nov 2018 22:25:07 -0500 Received: by smtp.corp.redhat.com (Postfix) id 17408600C8; Wed, 28 Nov 2018 03:25:07 +0000 (UTC) Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 090DC600C2 for ; Wed, 28 Nov 2018 03:25:06 +0000 (UTC) Received: from mail-qt1-f196.google.com (mail-qt1-f196.google.com [209.85.160.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7E2E2C028345 for ; Wed, 28 Nov 2018 03:25:05 +0000 (UTC) Received: by mail-qt1-f196.google.com with SMTP id y20so24366491qtm.13 for ; Tue, 27 Nov 2018 19:25:05 -0800 (PST) Received: from localhost.localdomain ([2804:431:b704:2a6e:f5c0:e531:dcb0:2cf6]) by smtp.gmail.com with ESMTPSA id z20sm2699503qkb.41.2018.11.27.19.25.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Nov 2018 19:25:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=pkdbMz2a2Zfk09YSib7FVNkfP2Yr41xIsah1PirluMg=; b=JBwR8KUHdoVrazVZxBtUg/gsYpB4EYklpIWr4OTR7PLmEZ0IeTw7FqrFxB9s9LNDj3 FE1eAlSpapw4CGNtFAeSbRl1CDyYAdIDVAUxzPgzg32RspyBhsKJ0jwsdUjL1v6Z8Vfy hyN7ooM1HMmS4ZLcBUT1yyw9SphAKToUEdL7IegLmCwBv+Xp2UbgnWIjopMKT2U1O/LQ f6Bbnt9JYs3qGhrctJCghWdarxumAsu+Uc53V7dsK/RCJeEbzeH9drkJ7p9geiDRcFIe +DARiS3NX1AHvKOGBkgLQsICHqkWU7iI68xSKK0xdzYoUElUa+8nS22fBY4UrqnZvZt8 chlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pkdbMz2a2Zfk09YSib7FVNkfP2Yr41xIsah1PirluMg=; b=OtsN2DzoRWcIFBaDKogcDwsz63rd8FUuVc+xM0VmMF93cYT+9hfbb/+X80E4csBxdW AHiy41tr61zfLyUa6ybwfbrv5BeoMgNHeDaChV8wRkAF15OcJw7FUGv7Q/rKcFyCv+34 gjmzF47le/swvPtTanQbfWEgD1KeaNtnwR59w3LTMXYkLfQV01vsfqVQqkMTA/qH1Vcg JjvHBB2LwFr3sZ28ukrfNZ++FIzqiyqaPprAcU1i0D2tcf1oOFPTnUhP//3IiogSXhfO Qu25RJJMosYItUEtlJyWtCNcurHhB4iT81bFu67GSX1IHw3F4N1qZFWJm85u7jvhMc6B 19Pw== X-Gm-Message-State: AA+aEWakqkLaLIrntlREnxP9O6WgA4j4WK0RP3z3UUlnxxzbeqMVh6pN scBbrfgnWIi9Nc8gOordr8Dtbpr3 X-Google-Smtp-Source: AFSGD/WWGzpqfa0WSmVv58DwqHNKvX9UqyfxswIxxF0n5k5JRhek0hnBzHAiCZnuG9pM5tdIJmxbFA== X-Received: by 2002:a0c:89e9:: with SMTP id 38mr34052962qvs.31.1543375504467; Tue, 27 Nov 2018 19:25:04 -0800 (PST) From: Julio Faracco To: libvir-list@redhat.com Date: Wed, 28 Nov 2018 11:24:37 +0800 Message-Id: <20181128032438.3367-2-jcfaracco@gmail.com> In-Reply-To: <20181128032438.3367-1-jcfaracco@gmail.com> References: <20181128032438.3367-1-jcfaracco@gmail.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 28 Nov 2018 03:25:05 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 28 Nov 2018 03:25:05 +0000 (UTC) for IP:'209.85.160.196' DOMAIN:'mail-qt1-f196.google.com' HELO:'mail-qt1-f196.google.com' FROM:'jcfaracco@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.108 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS) 209.85.160.196 mail-qt1-f196.google.com 209.85.160.196 mail-qt1-f196.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/2] lxc: Initializing IPv6 and IPv4 gateway to overwrite old settings. 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-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 28 Nov 2018 03:25:16 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This commit fixes a bug when you have multiple network settings defined. Basically, if you set an IPv6 or IPv4 gateway, it carries on next network settings. It is happening because the data is not being initialized when a new network type is defined. So, the old data still persists into the pointer. Signed-off-by: Julio Faracco --- src/lxc/lxc_native.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lxc/lxc_native.c b/src/lxc/lxc_native.c index 9f6d4b3de8..0c9b315459 100644 --- a/src/lxc/lxc_native.c +++ b/src/lxc/lxc_native.c @@ -583,6 +583,9 @@ lxcNetworkWalkCallback(const char *name, virConfValuePt= r value, void *data) parseData->ips =3D NULL; parseData->nips =3D 0; =20 + parseData->gateway_ipv4 =3D NULL; + parseData->gateway_ipv6 =3D NULL; + /* Keep the new value */ parseData->type =3D value->str; } --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 19 03:08:10 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; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1543375538892525.9575632105282; Tue, 27 Nov 2018 19:25:38 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E709388E50; Wed, 28 Nov 2018 03:25:36 +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 762611A7D0; Wed, 28 Nov 2018 03:25:36 +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 3367C181B9E9; Wed, 28 Nov 2018 03:25:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wAS3PBpU022378 for ; Tue, 27 Nov 2018 22:25:11 -0500 Received: by smtp.corp.redhat.com (Postfix) id D01B45C1B5; Wed, 28 Nov 2018 03:25:11 +0000 (UTC) Received: from mx1.redhat.com (ext-mx19.extmail.prod.ext.phx2.redhat.com [10.5.110.48]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C86045C1B2 for ; Wed, 28 Nov 2018 03:25:08 +0000 (UTC) Received: from mail-qt1-f177.google.com (mail-qt1-f177.google.com [209.85.160.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DA20D307D855 for ; Wed, 28 Nov 2018 03:25:06 +0000 (UTC) Received: by mail-qt1-f177.google.com with SMTP id n21so24366371qtl.6 for ; Tue, 27 Nov 2018 19:25:06 -0800 (PST) Received: from localhost.localdomain ([2804:431:b704:2a6e:f5c0:e531:dcb0:2cf6]) by smtp.gmail.com with ESMTPSA id z20sm2699503qkb.41.2018.11.27.19.25.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Nov 2018 19:25:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=srrsmgTP+bb+AjIjTDOUeRtSDIKpqn1veeSEamiPDnE=; b=BhbLj53L+cVxWHSJahVqv8INVG083PoF6Tahgl7cpGBoD/q3seJWR50UjxRmcWznKi SLUaTT3AMbjnUG4r1i9k/rrMXKJfv58b5NpSRhQZceeEG5JJhSj4/Wd81DwogqiJskHM uXstk7ZfamR3RegTTlKe1jpAm1f0TaupgpnRm1dCVWDoUqWZxlMdWR2YakVJwp3XG7eC UzzGPmMblmj9f61JbA0II43qfyI1OObRbXFOLedvM67PWJHjH1jeCJTb7t1KmZaT8poP 2dQQdMi+3w5IbYcyMCHUsPAGXVOWF8JB7JeM3e8+aY6ZkV/yLrYAf02xqNaOcJIkHtBw iWhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=srrsmgTP+bb+AjIjTDOUeRtSDIKpqn1veeSEamiPDnE=; b=ZG9FkvSRemXiEyuZX27TPJ90qyDvKOFUQVqDn3kLBog6hga4byOxN/lfK+5DvC1cbB gdfBe9tlj3F7IiUC77lPU5NzXNuun3YihWeTjPQ7QDIO6JgwKh1zppPtkj4QRtlma8pM agIu5qo/3rv54Cpl4lUjNfyKtCEuhywsYeE0Ig95MgPdC0G9qHl3h01ghGqt3AFiWPnf FExg5Gcl4CsQ2WctlfaecDPxmOl4wAAT0o46H79nrIZL3XaUSfWpU2WF3UWuFa4crmOx 34Iqohe3xtr3+ZvMfPsdqY74347GsCp16qRelX/BtjQrEMLX6aA07aF4DHxfsD62CUSM QTuA== X-Gm-Message-State: AA+aEWbdyFqmmq67AZAFTmcwKdvJqxcDoT2h/GDA+cznJ5+YkrtTQGVe CWvuPGyeR/2as1f+uM8UNw4eRnEp X-Google-Smtp-Source: AFSGD/VjtUmUefbtKF24OaBQ6AokOvf37XMDfKEsQzUoBJ9YYRYhH6kWzVs7oQHfQcTq6Cu0yM+b2Q== X-Received: by 2002:a0c:9144:: with SMTP id q62mr33401762qvq.87.1543375505820; Tue, 27 Nov 2018 19:25:05 -0800 (PST) From: Julio Faracco To: libvir-list@redhat.com Date: Wed, 28 Nov 2018 11:24:38 +0800 Message-Id: <20181128032438.3367-3-jcfaracco@gmail.com> In-Reply-To: <20181128032438.3367-1-jcfaracco@gmail.com> References: <20181128032438.3367-1-jcfaracco@gmail.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Wed, 28 Nov 2018 03:25:07 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Wed, 28 Nov 2018 03:25:07 +0000 (UTC) for IP:'209.85.160.177' DOMAIN:'mail-qt1-f177.google.com' HELO:'mail-qt1-f177.google.com' FROM:'jcfaracco@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.11 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_PASS) 209.85.160.177 mail-qt1-f177.google.com 209.85.160.177 mail-qt1-f177.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.48 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/2] tests: Adding test case to include multiple network definitions. 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-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 28 Nov 2018 03:25:37 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This commit includes a test case for multiple network definitions. It is useful right now, but it will be more useful when the index used by LXC version 3.X is implemented to support this new settings. Signed-off-by: Julio Faracco --- .../lxcconf2xml-miscnetwork-v3.config | 23 ++++++++++ .../lxcconf2xml-miscnetwork.config | 23 ++++++++++ .../lxcconf2xml-miscnetwork.xml | 45 +++++++++++++++++++ tests/lxcconf2xmltest.c | 2 + 4 files changed, 93 insertions(+) create mode 100644 tests/lxcconf2xmldata/lxcconf2xml-miscnetwork-v3.config create mode 100644 tests/lxcconf2xmldata/lxcconf2xml-miscnetwork.config create mode 100644 tests/lxcconf2xmldata/lxcconf2xml-miscnetwork.xml diff --git a/tests/lxcconf2xmldata/lxcconf2xml-miscnetwork-v3.config b/test= s/lxcconf2xmldata/lxcconf2xml-miscnetwork-v3.config new file mode 100644 index 0000000000..b46cb3ee7d --- /dev/null +++ b/tests/lxcconf2xmldata/lxcconf2xml-miscnetwork-v3.config @@ -0,0 +1,23 @@ +lxc.network.type =3D phys +lxc.network.link =3D eth0 +lxc.network.name =3D eth1 +lxc.network.ipv4 =3D 192.168.122.2/24 +lxc.network.ipv4.gateway =3D 192.168.122.1 +lxc.network.ipv6 =3D 2003:db8:1:0:214:1234:fe0b:3596/64 +lxc.network.ipv6.gateway =3D 2003:db8:1:0:214:1234:fe0b:3595 + +lxc.network.type =3D vlan +lxc.network.flags =3D up +lxc.network.link =3D eth0 +lxc.network.hwaddr =3D 02:00:15:8f:05:c1 +lxc.network.vlan.id =3D 2 + +lxc.network.type =3D macvlan +lxc.network.flags =3D up +lxc.network.link =3D eth0 +lxc.network.hwaddr =3D 02:00:15:8f:05:c1 +lxc.network.macvlan.mode =3D vepa + +lxc.rootfs =3D /var/lib/lxc/migrate_test/rootfs +lxc.utsname =3D migrate_test +lxc.autodev=3D1 diff --git a/tests/lxcconf2xmldata/lxcconf2xml-miscnetwork.config b/tests/l= xcconf2xmldata/lxcconf2xml-miscnetwork.config new file mode 100644 index 0000000000..b46cb3ee7d --- /dev/null +++ b/tests/lxcconf2xmldata/lxcconf2xml-miscnetwork.config @@ -0,0 +1,23 @@ +lxc.network.type =3D phys +lxc.network.link =3D eth0 +lxc.network.name =3D eth1 +lxc.network.ipv4 =3D 192.168.122.2/24 +lxc.network.ipv4.gateway =3D 192.168.122.1 +lxc.network.ipv6 =3D 2003:db8:1:0:214:1234:fe0b:3596/64 +lxc.network.ipv6.gateway =3D 2003:db8:1:0:214:1234:fe0b:3595 + +lxc.network.type =3D vlan +lxc.network.flags =3D up +lxc.network.link =3D eth0 +lxc.network.hwaddr =3D 02:00:15:8f:05:c1 +lxc.network.vlan.id =3D 2 + +lxc.network.type =3D macvlan +lxc.network.flags =3D up +lxc.network.link =3D eth0 +lxc.network.hwaddr =3D 02:00:15:8f:05:c1 +lxc.network.macvlan.mode =3D vepa + +lxc.rootfs =3D /var/lib/lxc/migrate_test/rootfs +lxc.utsname =3D migrate_test +lxc.autodev=3D1 diff --git a/tests/lxcconf2xmldata/lxcconf2xml-miscnetwork.xml b/tests/lxcc= onf2xmldata/lxcconf2xml-miscnetwork.xml new file mode 100644 index 0000000000..63189cfaec --- /dev/null +++ b/tests/lxcconf2xmldata/lxcconf2xml-miscnetwork.xml @@ -0,0 +1,45 @@ + + migrate_test + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 65536 + 65536 + 1 + + exe + /sbin/init + + + + + + + destroy + restart + destroy + + /usr/libexec/libvirt_lxc + + + + + + + + + + + + eth0 + + + + + + + + + eth0.2 + + + + diff --git a/tests/lxcconf2xmltest.c b/tests/lxcconf2xmltest.c index 0766239ec4..2a277042ce 100644 --- a/tests/lxcconf2xmltest.c +++ b/tests/lxcconf2xmltest.c @@ -137,6 +137,7 @@ mymain(void) DO_TEST("physnetwork", false); DO_TEST("macvlannetwork", false); DO_TEST("vlannetwork", false); + DO_TEST("miscnetwork", false); DO_TEST("idmap", false); DO_TEST("memtune", false); DO_TEST("cputune", false); @@ -161,6 +162,7 @@ mymain(void) DO_TEST3("physnetwork", false); DO_TEST3("macvlannetwork", false); DO_TEST3("vlannetwork", false); + DO_TEST3("miscnetwork", false); DO_TEST3("idmap", false); DO_TEST3("memtune", false); DO_TEST3("cputune", false); --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list