From nobody Sun May 12 01:32:17 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 1551743789971443.4947633703547; Mon, 4 Mar 2019 15:56:29 -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 EA25787627; Mon, 4 Mar 2019 23:56:27 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BC28558B0; Mon, 4 Mar 2019 23:56:27 +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 7696541F3D; Mon, 4 Mar 2019 23:56:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x24NsGWT002651 for ; Mon, 4 Mar 2019 18:54:17 -0500 Received: by smtp.corp.redhat.com (Postfix) id EEE095D71A; Mon, 4 Mar 2019 23:54:16 +0000 (UTC) Received: from mx1.redhat.com (ext-mx15.extmail.prod.ext.phx2.redhat.com [10.5.110.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E311D5D6B3 for ; Mon, 4 Mar 2019 23:54:14 +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 DE44030832DC for ; Mon, 4 Mar 2019 23:54:13 +0000 (UTC) Received: by mail-qt1-f196.google.com with SMTP id p48so7180097qtk.2 for ; Mon, 04 Mar 2019 15:54:13 -0800 (PST) Received: from localhost.localdomain ([177.188.104.249]) by smtp.gmail.com with ESMTPSA id d32sm4670568qtc.88.2019.03.04.15.54.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Mar 2019 15:54:12 -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=EJ/Gug8zWUdbCeQUxA5EroJueMn5sDITJYDUzmpwWyg=; b=q8b3YipU385X5UF7kv3aH6M7noxEFHx7UqLMzhgBkdxTV/Yui9T0PQrnWLBbDfydzT mtPUqxJnIERrlJXsNfn6Q8r8dm4ldBpEvd6Wwe09WjEHa5Ikm5PhCDZky8EVqwBDxFjA rEs3Z05fXHxGUXaNiYmkriPK3Zwg7/EKLw3JB5ij/4XDvk5Y47xiZB7G63nlQ+9ty3mk GmmuzpU1jPJy48TExXXc81Yq9KSU9z9Z7XH9zoevlfYDEHOQHkcFI0V/15Azwsmn09gO j2w0FPH6RnHrEHr872cIahA1i8pbdgHOjlKDn4YTe2u3lMJ2+cI9KUHODCKkLfZjFO8c rvFg== 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=EJ/Gug8zWUdbCeQUxA5EroJueMn5sDITJYDUzmpwWyg=; b=rCbplvroaYdk64QChngxb0FyxHZF9bznEUhtqd3n49Cu0uPKzcL3kRWq0NbZnY9L92 ff8Gi6pLvXaR3kMnDPeTqONCKeNvpJzpq8CIwUytqIUA0qp7cXXiUpe59L460MHQrqUn HUOpPZ+d5mcr54TumH3SJ6YzkPDjoeMaiwYoJIdJ9D0c6MeouTRIU1sUzTw/SeNur6qR W3aco0Y6GRpdL6iY/uXoXZr0XkKCgTn3wpeC8Wjg6t4OpN212UZS/JS5PGwq0iczcgcX 1r3GxrAaybAL5cJdMC+U4s1ZVprzxzB3Jc7cGPbdIfyOAJyo33gIi7K3I+11aTz5LM+b r70w== X-Gm-Message-State: APjAAAXPwmmMSbzRaPG0iqSb+ViwKEyDWT9atugsrSC/NrpsZJ116O6H 9YS4+ivkW5oeOCrwHKSTrxe/Rpcn X-Google-Smtp-Source: APXvYqywSc1BNNdjDhGm/TkfOgmWbO3rIiolyyDdPcuXS/e06IPXLvH5hJ0fugxRZL0GHf8rKeBBgg== X-Received: by 2002:a0c:963d:: with SMTP id 58mr16390158qvx.25.1551743652672; Mon, 04 Mar 2019 15:54:12 -0800 (PST) From: Julio Faracco To: libvir-list@redhat.com Date: Mon, 4 Mar 2019 20:53:59 -0300 Message-Id: <20190304235404.16320-2-jcfaracco@gmail.com> In-Reply-To: <20190304235404.16320-1-jcfaracco@gmail.com> References: <20190304235404.16320-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.44]); Mon, 04 Mar 2019 23:54:14 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Mon, 04 Mar 2019 23:54:14 +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.13 (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.84 on 10.5.110.44 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/6] lxc: Rebase lxcNetworkParseData struct to support indexes. 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.26]); Mon, 04 Mar 2019 23:56:28 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The current logic of lxcNetworkParseData uses one single structure to record data over the network definitions inside config files. The logic consider the entry 'type' as a new network definition, every time that algorithm find this tag. This new structure was designed to consider network definitions as an array of network structures. Signed-off-by: Julio Faracco --- src/lxc/lxc_native.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/lxc/lxc_native.c b/src/lxc/lxc_native.c index 2fd349ac1d..bf82cd1e98 100644 --- a/src/lxc/lxc_native.c +++ b/src/lxc/lxc_native.c @@ -423,8 +423,9 @@ lxcCreateHostdevDef(int mode, int type, const char *dat= a) return hostdev; } =20 -typedef struct { - virDomainDefPtr def; +typedef struct _lxcNetworkParseData lxcNetworkParseData; +typedef lxcNetworkParseData *lxcNetworkParseDataPtr; +struct _lxcNetworkParseData { char *type; char *link; char *mac; @@ -436,9 +437,14 @@ typedef struct { size_t nips; char *gateway_ipv4; char *gateway_ipv6; - bool privnet; - size_t networks; -} lxcNetworkParseData; + size_t index; +}; + +typedef struct { + lxcNetworkParseDataPtr *data; + size_t nnetworks; +} lxcNetworkParseArray; + =20 static int lxcAddNetworkRouteDefinition(const char *address, --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 12 01:32:17 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 1551743689650535.6442852161479; Mon, 4 Mar 2019 15:54:49 -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 AFEE6307D961; Mon, 4 Mar 2019 23:54:46 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F0BBF1710E; Mon, 4 Mar 2019 23:54:45 +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 8813541F3C; Mon, 4 Mar 2019 23:54:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x24NsGT5002642 for ; Mon, 4 Mar 2019 18:54:16 -0500 Received: by smtp.corp.redhat.com (Postfix) id B809B608C1; Mon, 4 Mar 2019 23:54:16 +0000 (UTC) Received: from mx1.redhat.com (ext-mx18.extmail.prod.ext.phx2.redhat.com [10.5.110.47]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B238F6085B for ; Mon, 4 Mar 2019 23:54:16 +0000 (UTC) Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.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 85A1C308222E for ; Mon, 4 Mar 2019 23:54:15 +0000 (UTC) Received: by mail-qk1-f196.google.com with SMTP id h28so3842605qkk.7 for ; Mon, 04 Mar 2019 15:54:15 -0800 (PST) Received: from localhost.localdomain ([177.188.104.249]) by smtp.gmail.com with ESMTPSA id d32sm4670568qtc.88.2019.03.04.15.54.12 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Mar 2019 15:54:13 -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=pbNDRG3C5sEoaRfpitE1HXtG3HpCZm5kb2XM2hFdnEE=; b=QOHKAyy9WKWy6n7CypES3DU2277nijvrRRQVhgRiaFntNaJrUOBHTWWXbabQvblfjm xwFWvuKijv1prQnBBcBlI2C8JpRpURb//h5e4SkZ6xA/lQ6DN9gJ4Rupv0L58ecd24y6 teykSxUAySYhIfeItX73wNFGVTdMfEIa9xAwZLtgCxUnE2go/79iTA+PHfAzHKJ8XsSV Cv9Nl3t86ttSL5dshKztCT9ohpJeeOvK1DwShlJnvqAplIMIDlRgLDucgKQJ2FHZdt4B wm1bfJcIwP0dyAws7MidbkVYuu9N5qI9vTOcfPfhZdIGeWrnWppc8HhNRb+xutWT4ZUs 0AVw== 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=pbNDRG3C5sEoaRfpitE1HXtG3HpCZm5kb2XM2hFdnEE=; b=ZLOOy0mo3CJSMQO6q/vl8x2kYi4D3mbemj3zOig2wf48/YHRI6X1rMLHgFOtcG4cKC U2Jvf2BotChHMPEQqgejd+sBqWfbfHEXFyTxL3GSE9913SKA3EK1bq6413aaepRqEwPx CW+/l9l02DDKYH2ffNt8ni9HwLS79hI9W1M0M6/821ZBsUT8sCh/akIFOIyqVh+ckW3g GEaK1b32RUfhooW4cIJ1o8OdmhjDkm79/tnJeuHv19080gxL1HbQgUrlpU+5+e0YK4lQ oHNMDxah8fk1xxOHdHB0+Cta/cH4Na9Tu5KLUZUzolmFd1hjqf2vjapzoCrcYjK6E1qg A5sA== X-Gm-Message-State: APjAAAVgcnK1Bti4pwVzd5ZtS9JzkoX1dRVCWOU730PTEUpYeasXJWqy UieqPGqFM+d3vYipCiLD7QZlmXbj X-Google-Smtp-Source: APXvYqysI6r1s2DhNzwrG/hBHDXLQq9DXgDJpUWLItgGgXz/otz/sDpkO0lKeSHweKZJh31FjtI7mw== X-Received: by 2002:a37:d649:: with SMTP id t70mr15762763qki.44.1551743654203; Mon, 04 Mar 2019 15:54:14 -0800 (PST) From: Julio Faracco To: libvir-list@redhat.com Date: Mon, 4 Mar 2019 20:54:00 -0300 Message-Id: <20190304235404.16320-3-jcfaracco@gmail.com> In-Reply-To: <20190304235404.16320-1-jcfaracco@gmail.com> References: <20190304235404.16320-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.47]); Mon, 04 Mar 2019 23:54:15 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Mon, 04 Mar 2019 23:54:15 +0000 (UTC) for IP:'209.85.222.196' DOMAIN:'mail-qk1-f196.google.com' HELO:'mail-qk1-f196.google.com' FROM:'jcfaracco@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.111 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.222.196 mail-qk1-f196.google.com 209.85.222.196 mail-qk1-f196.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.47 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/6] lxc: Rebase lxcNetworkParseData pointers to use new structures. 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.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.48]); Mon, 04 Mar 2019 23:54:48 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This commit refactor the code logic to introduce new array structures instead of single lxcNetworkParseData struct. Signed-off-by: Julio Faracco --- src/lxc/lxc_native.c | 94 +++++++++++++++----------------------------- 1 file changed, 32 insertions(+), 62 deletions(-) diff --git a/src/lxc/lxc_native.c b/src/lxc/lxc_native.c index bf82cd1e98..7200743da7 100644 --- a/src/lxc/lxc_native.c +++ b/src/lxc/lxc_native.c @@ -484,7 +484,7 @@ lxcAddNetworkRouteDefinition(const char *address, } =20 static int -lxcAddNetworkDefinition(lxcNetworkParseData *data) +lxcAddNetworkDefinition(virDomainDefPtr def, lxcNetworkParseDataPtr data) { virDomainNetDefPtr net =3D NULL; virDomainHostdevDefPtr hostdev =3D NULL; @@ -532,9 +532,9 @@ lxcAddNetworkDefinition(lxcNetworkParseData *data) &hostdev->source.caps.u.net.ip.nr= outes) < 0) goto error; =20 - if (VIR_EXPAND_N(data->def->hostdevs, data->def->nhostdevs, 1) < 0) + if (VIR_EXPAND_N(def->hostdevs, def->nhostdevs, 1) < 0) goto error; - data->def->hostdevs[data->def->nhostdevs - 1] =3D hostdev; + def->hostdevs[def->nhostdevs - 1] =3D hostdev; } else { if (!(net =3D lxcCreateNetDef(data->type, data->link, data->mac, data->flag, data->macvlanmode, @@ -556,9 +556,9 @@ lxcAddNetworkDefinition(lxcNetworkParseData *data) &net->guestIP.nroutes) < 0) goto error; =20 - if (VIR_EXPAND_N(data->def->nets, data->def->nnets, 1) < 0) + if (VIR_EXPAND_N(def->nets, def->nnets, 1) < 0) goto error; - data->def->nets[data->def->nnets - 1] =3D net; + def->nets[def->nnets - 1] =3D net; } =20 return 1; @@ -572,44 +572,10 @@ lxcAddNetworkDefinition(lxcNetworkParseData *data) return -1; } =20 - -static int -lxcNetworkParseDataType(virConfValuePtr value, - lxcNetworkParseData *parseData) -{ - virDomainDefPtr def =3D parseData->def; - size_t networks =3D parseData->networks; - bool privnet =3D parseData->privnet; - int status; - - /* Store the previous NIC */ - status =3D lxcAddNetworkDefinition(parseData); - - if (status < 0) - return -1; - else if (status > 0) - networks++; - else if (parseData->type !=3D NULL && STREQ(parseData->type, "none")) - privnet =3D false; - - /* clean NIC to store a new one */ - memset(parseData, 0, sizeof(*parseData)); - - parseData->def =3D def; - parseData->networks =3D networks; - parseData->privnet =3D privnet; - - /* Keep the new value */ - parseData->type =3D value->str; - - return 0; -} - - static int lxcNetworkParseDataIPs(const char *name, virConfValuePtr value, - lxcNetworkParseData *parseData) + lxcNetworkParseDataPtr parseData) { int family =3D AF_INET; char **ipparts =3D NULL; @@ -648,14 +614,13 @@ lxcNetworkParseDataIPs(const char *name, static int lxcNetworkParseDataSuffix(const char *entry, virConfValuePtr value, - lxcNetworkParseData *parseData) + lxcNetworkParseDataPtr parseData) { int elem =3D virLXCNetworkConfigEntryTypeFromString(entry); =20 switch (elem) { case VIR_LXC_NETWORK_CONFIG_TYPE: - if (lxcNetworkParseDataType(value, parseData) < 0) - return -1; + parseData->type =3D value->str; break; case VIR_LXC_NETWORK_CONFIG_LINK: parseData->link =3D value->str; @@ -700,7 +665,7 @@ lxcNetworkParseDataSuffix(const char *entry, static int lxcNetworkParseDataEntry(const char *name, virConfValuePtr value, - lxcNetworkParseData *parseData) + lxcNetworkParseDataPtr parseData) { const char *suffix =3D STRSKIP(name, "lxc.network."); =20 @@ -711,7 +676,8 @@ lxcNetworkParseDataEntry(const char *name, static int lxcNetworkWalkCallback(const char *name, virConfValuePtr value, void *data) { - lxcNetworkParseData *parseData =3D data; + lxcNetworkParseArray *networks =3D data; + lxcNetworkParseDataPtr parseData =3D NULL; =20 if (STRPREFIX(name, "lxc.network.")) return lxcNetworkParseDataEntry(name, value, parseData); @@ -724,26 +690,26 @@ lxcConvertNetworkSettings(virDomainDefPtr def, virCon= fPtr properties) { int status; int result =3D -1; - size_t i; - lxcNetworkParseData data =3D {def, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, 0, - NULL, NULL, true, 0}; + size_t i, j; + bool privnet =3D true; + lxcNetworkParseArray nets =3D {NULL, 0}; =20 - if (virConfWalk(properties, lxcNetworkWalkCallback, &data) < 0) + if (virConfWalk(properties, lxcNetworkWalkCallback, &nets) < 0) goto error; =20 + for (i =3D 0; i < nets.nnetworks; i++) { + lxcNetworkParseDataPtr data =3D nets.data[i]; =20 - /* Add the last network definition found */ - status =3D lxcAddNetworkDefinition(&data); + /* Add network definitions */ + status =3D lxcAddNetworkDefinition(def, data); =20 - if (status < 0) - goto error; - else if (status > 0) - data.networks++; - else if (data.type !=3D NULL && STREQ(data.type, "none")) - data.privnet =3D false; + if (status < 0) + goto error; + else if (data->type !=3D NULL && STREQ(data->type, "none")) + privnet =3D false; + } =20 - if (data.networks =3D=3D 0 && data.privnet) { + if (nets.nnetworks =3D=3D 0 && privnet) { /* When no network type is provided LXC only adds loopback */ def->features[VIR_DOMAIN_FEATURE_PRIVNET] =3D VIR_TRISTATE_SWITCH_= ON; } @@ -752,9 +718,13 @@ lxcConvertNetworkSettings(virDomainDefPtr def, virConf= Ptr properties) return result; =20 error: - for (i =3D 0; i < data.nips; i++) - VIR_FREE(data.ips[i]); - VIR_FREE(data.ips); + for (i =3D 0; i < nets.nnetworks; i++) { + for (j =3D 0; i < nets.data[i]->nips; i++) + VIR_FREE(nets.data[i]->ips[j]); + VIR_FREE(nets.data[i]->ips); + } + for (i =3D 0; i < nets.nnetworks; i++) + VIR_FREE(nets.data[i]); return -1; } =20 --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 12 01:32:17 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 1551743722053268.4394724632224; Mon, 4 Mar 2019 15:55:22 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9B5E330821E0; Mon, 4 Mar 2019 23:55:19 +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 6A3905D9D3; Mon, 4 Mar 2019 23:55:19 +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 BA7EF181A12A; Mon, 4 Mar 2019 23:55:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x24NsHmd002657 for ; Mon, 4 Mar 2019 18:54:17 -0500 Received: by smtp.corp.redhat.com (Postfix) id 9ECD0608C1; Mon, 4 Mar 2019 23:54:17 +0000 (UTC) Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 953796085B for ; Mon, 4 Mar 2019 23:54:17 +0000 (UTC) Received: from mail-qk1-f195.google.com (mail-qk1-f195.google.com [209.85.222.195]) (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 A6E91356C4 for ; Mon, 4 Mar 2019 23:54:16 +0000 (UTC) Received: by mail-qk1-f195.google.com with SMTP id a15so3856114qkc.1 for ; Mon, 04 Mar 2019 15:54:16 -0800 (PST) Received: from localhost.localdomain ([177.188.104.249]) by smtp.gmail.com with ESMTPSA id d32sm4670568qtc.88.2019.03.04.15.54.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Mar 2019 15:54:15 -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=ZixAmc5eO6ILt5fRk81bsuvXVBkBNluQAgRVdACcrug=; b=h8KCduyX5NZHIRvkAN31v9sylHExAMRvQwPxvM3jHVjcmaXKQ6cJDq+RZeKNSJX2fA FEjkm2dPjQ5wf33JrD9+GPz7WkWKEl1Nlxz7ZxkU7iXPgg0NEOoPLLhOkZPocnNKdYZe wqQyVnPv06FYbZJvUJ4cTLqoFpQ1Qtva2hQli74+EGoQLmGflydnQ3/WwLRhMhi149Nw snmr7iHNJ79ol3FcjpChrz7Nw5NSaunVzMn3WrLtTs7Oly00hLvmSwCZrn/P/4ZH8L52 u66Q+0u29y3s0MWwcmLCXgl0dEp34uFlX7NPGJcnvXdHlh3873r88Tqhr5jISNOGjgjC Go/Q== 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=ZixAmc5eO6ILt5fRk81bsuvXVBkBNluQAgRVdACcrug=; b=AGX85CLSgdoCQMU811tyi9gyLODSBr6tPubxREzlBCwbLzVACnxix66t+NFmaBdEWx OG+nsNFRPaiqIadXJpwRnw2Pyxi/z9Qq2l3v/ug2Oi3SOG7tGeWK/ZW1iWyy1FoUmKAI l3hWYPyCKaLGkRROcRHMVH9qfoZmdN2E/wQgDSuCg/FRodJJDERzInlkJ4ayWT1GJoft nXu7wFyGaAcxAoXyf9fTpQbKdqUCaE97D0Y8nNPdockwJmKR5FZEezQRnxV1fc7DChqh 3poBcnxiA85vCuc0SLvsc4Bqi35IIiCt04gHmhsaA7fgH3jTMI4lSu9n+4RxdxUAzdzn sWvg== X-Gm-Message-State: APjAAAV0gsy5nsFWQbFVDoYlIbOMewgF6BkGJEmV2gImbiDNaJViYhjy 9xMI69dHFZGmNuOHtHPKhQ1YWZAq X-Google-Smtp-Source: APXvYqzFmfMj8gqucaq760kZI1G2QqOrConUpHyIO9S3T4lGpYMFDbY7zfCkwvRIxpZm2UCph3pnnw== X-Received: by 2002:a05:620a:164a:: with SMTP id c10mr15652976qko.3.1551743655577; Mon, 04 Mar 2019 15:54:15 -0800 (PST) From: Julio Faracco To: libvir-list@redhat.com Date: Mon, 4 Mar 2019 20:54:01 -0300 Message-Id: <20190304235404.16320-4-jcfaracco@gmail.com> In-Reply-To: <20190304235404.16320-1-jcfaracco@gmail.com> References: <20190304235404.16320-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.30]); Mon, 04 Mar 2019 23:54:16 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 04 Mar 2019 23:54:16 +0000 (UTC) for IP:'209.85.222.195' DOMAIN:'mail-qk1-f195.google.com' HELO:'mail-qk1-f195.google.com' FROM:'jcfaracco@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.111 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.222.195 mail-qk1-f195.google.com 209.85.222.195 mail-qk1-f195.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/6] lxc: Introduce lxcNetworkGetParseDataLegacy() method. 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.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Mon, 04 Mar 2019 23:55:20 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This function was introduced to fetch/alloc new data for legacy entries inside config file: 'lxc.network.foo'. Libvirt still need to support both versions. So, this function can be easy to remove in the future. Signed-off-by: Julio Faracco --- src/lxc/lxc_native.c | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/src/lxc/lxc_native.c b/src/lxc/lxc_native.c index 7200743da7..4d26d1a20b 100644 --- a/src/lxc/lxc_native.c +++ b/src/lxc/lxc_native.c @@ -572,6 +572,37 @@ lxcAddNetworkDefinition(virDomainDefPtr def, lxcNetwor= kParseDataPtr data) return -1; } =20 +static lxcNetworkParseDataPtr +lxcNetworkGetParseDataLegacy(lxcNetworkParseArray *networks, + const char *name) +{ + const char *suffix =3D STRSKIP(name, "lxc.network."); + int elem =3D virLXCNetworkConfigEntryTypeFromString(suffix); + size_t index =3D networks->nnetworks; + + if (elem =3D=3D VIR_LXC_NETWORK_CONFIG_TYPE) { + if (!networks->data) { + if (VIR_ALLOC_N(networks->data, index + 1) < 0) + return NULL; + } else { + if (VIR_REALLOC_N(networks->data, index + 1) < 0) + return NULL; + } + + if (VIR_ALLOC(networks->data[index]) < 0) + return NULL; + + networks->data[index]->index =3D index; + networks->nnetworks++; + + /* Return a new network. */ + return networks->data[index]; + } + + /* Return the last network. */ + return networks->data[index-1]; +} + static int lxcNetworkParseDataIPs(const char *name, virConfValuePtr value, @@ -679,8 +710,12 @@ lxcNetworkWalkCallback(const char *name, virConfValueP= tr value, void *data) lxcNetworkParseArray *networks =3D data; lxcNetworkParseDataPtr parseData =3D NULL; =20 - if (STRPREFIX(name, "lxc.network.")) + if (STRPREFIX(name, "lxc.network.")) { + if (!(parseData =3D lxcNetworkGetParseDataLegacy(networks, name))) + return -1; + return lxcNetworkParseDataEntry(name, value, parseData); + } =20 return 0; } --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 12 01:32:17 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 1551743730251333.6588751449748; Mon, 4 Mar 2019 15:55:30 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ED1563082A32; Mon, 4 Mar 2019 23:55:27 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B66F35D6B3; Mon, 4 Mar 2019 23:55:27 +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 265E741F3E; Mon, 4 Mar 2019 23:55:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x24NsJ2c002677 for ; Mon, 4 Mar 2019 18:54:19 -0500 Received: by smtp.corp.redhat.com (Postfix) id D2C4F5D71A; Mon, 4 Mar 2019 23:54:19 +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 C819E5D6B3 for ; Mon, 4 Mar 2019 23:54:19 +0000 (UTC) Received: from mail-qk1-f195.google.com (mail-qk1-f195.google.com [209.85.222.195]) (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 841C53DD47 for ; Mon, 4 Mar 2019 23:54:18 +0000 (UTC) Received: by mail-qk1-f195.google.com with SMTP id y15so3852167qki.8 for ; Mon, 04 Mar 2019 15:54:18 -0800 (PST) Received: from localhost.localdomain ([177.188.104.249]) by smtp.gmail.com with ESMTPSA id d32sm4670568qtc.88.2019.03.04.15.54.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Mar 2019 15:54:16 -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=Ls3P68EdKN3d14X1Y8OICIpHYn7KsC0ML8uW1wmq99I=; b=TOU0799hCJ/8w45eztyyI0BKd1K5Qkl6m7Vi9FO4Al7H3Vb9mwZC43MzGCJ+4Rjhqo M7tXEv2/rJGG//GiajpTWe53ppalQqyanYnkVEa2Ma9RmxJCADx5TC9tMdWZjlCgaMkG JGyYwYANYtsaVVMshv55kCp5O9ZZ4H0Mf4zz68w7apFITR3VKVjAJSvnREvUlGiIxw7Z LZf3sG5gtJ2dl3/GVpTHH9/+rTkyK6xyOOg3P7WKSE05KNk5eQLrZrlM7av+5x9xnAas YIgV/WrdmTUkqZLyGDTXT1wn0YmQCrLD54LKPZX9QYMP8wHWMhx+Yoy8Srx4QF+E9uvV D4vA== 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=Ls3P68EdKN3d14X1Y8OICIpHYn7KsC0ML8uW1wmq99I=; b=WbjsC0PtKl7FjvISh+EbdkFi7JInswceaymV8y5QCpuJCR7HD+DuB8gBUgOqmNTv3U Sz1l7w058ULmr6BdDS7pd48CpZc+zHRAcjKsj5aMR7aB/fa3tzSTWvslToNjJtbGYkYm B8V8XxCpEZA1YN6c9OsBu9ca9FzQ0cFFxErPQArhOGvvXn9aHMEJForvioauFfuwrVoA wpB/EezB3kuAmxw3hyfJuec+Xl43NXE4tYtT6QaYwhBr698edrC7uT/Pn4GQh0BtAgdW Q736KzN3uf3iGXyNeoTEZpLdURgsDgBDwBkUJuzb5hkk96MD1xM2ILEiawTgtBqBBsxM gUPQ== X-Gm-Message-State: APjAAAUr+M8/1FM3wykyUHVLHE2qEuMmcf1XabK2t/t9QPgNa5rj0K4g UkigncCzhMYHZ1PTaD7FfSklvBKv X-Google-Smtp-Source: APXvYqz/VMKaoLctA+N2fe02bFibHFmC1bUM3UkDInyHGmpv2HcIpJ9kze0SK3fJeFted9b3GnMopg== X-Received: by 2002:a37:4949:: with SMTP id w70mr15257349qka.52.1551743657097; Mon, 04 Mar 2019 15:54:17 -0800 (PST) From: Julio Faracco To: libvir-list@redhat.com Date: Mon, 4 Mar 2019 20:54:02 -0300 Message-Id: <20190304235404.16320-5-jcfaracco@gmail.com> In-Reply-To: <20190304235404.16320-1-jcfaracco@gmail.com> References: <20190304235404.16320-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.29]); Mon, 04 Mar 2019 23:54:18 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 04 Mar 2019 23:54:18 +0000 (UTC) for IP:'209.85.222.195' DOMAIN:'mail-qk1-f195.google.com' HELO:'mail-qk1-f195.google.com' FROM:'jcfaracco@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.111 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.222.195 mail-qk1-f195.google.com 209.85.222.195 mail-qk1-f195.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/6] lxc: Introduce lxcNetworkGetParseData() for 'lxc.net.' entry. 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.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Mon, 04 Mar 2019 23:55:28 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This commit moves old lxcNetworkGetParseData() to lxcNetworkGetParseDataLegacy() and create a new method for LXC version 3.X called lxcNetworkGetParseData(). This is same idea of method lxcNetworkGetParseDataLegacy(). In the future, it can be easy to remove or rebase, in case of deprecate 'lxc.network.foo' style. Signed-off-by: Julio Faracco --- src/lxc/lxc_native.c | 65 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/src/lxc/lxc_native.c b/src/lxc/lxc_native.c index 4d26d1a20b..de7145ef1b 100644 --- a/src/lxc/lxc_native.c +++ b/src/lxc/lxc_native.c @@ -603,6 +603,53 @@ lxcNetworkGetParseDataLegacy(lxcNetworkParseArray *net= works, return networks->data[index-1]; } =20 +static lxcNetworkParseDataPtr +lxcNetworkGetParseData(lxcNetworkParseArray *networks, + const char *name) +{ + size_t index, nnetworks =3D networks->nnetworks; + size_t i; + + sscanf(name, "lxc.net.%zu", &index); + + if (!nnetworks) { + if (VIR_ALLOC_N(networks->data, 1) < 0) + return NULL; + + if (VIR_ALLOC(networks->data[0]) < 0) + return NULL; + + networks->data[0]->index =3D index; + networks->nnetworks++; + + return networks->data[0]; + } + + for (i =3D 0; i < nnetworks; i++) { + if (networks->data[i]->index =3D=3D index) + return networks->data[i]; + } + + /* This is a new element in an existing array. */ + if (VIR_REALLOC_N(networks->data, nnetworks + 1) < 0) + return NULL; + + if (VIR_ALLOC(networks->data[nnetworks]) < 0) + return NULL; + + networks->nnetworks++; + + for (i =3D nnetworks; i > 0; i--) { + if (networks->data[i-1]->index < index) { + networks->data[i]->index =3D index; + return networks->data[i]; + } + memcpy(networks->data[i], networks->data[i-1], sizeof(lxcNetworkPa= rseData)); + } + + return NULL; +} + static int lxcNetworkParseDataIPs(const char *name, virConfValuePtr value, @@ -692,14 +739,25 @@ lxcNetworkParseDataSuffix(const char *entry, return 0; } =20 +static int +lxcNetworkParseDataEntryLegacy(const char *name, + virConfValuePtr value, + lxcNetworkParseData *parseData) +{ + const char *suffix =3D STRSKIP(name, "lxc.network."); + + return lxcNetworkParseDataSuffix(suffix, value, parseData); +} =20 static int lxcNetworkParseDataEntry(const char *name, virConfValuePtr value, lxcNetworkParseDataPtr parseData) { - const char *suffix =3D STRSKIP(name, "lxc.network."); + const char *suffix =3D STRSKIP(name, "lxc.net."); =20 + suffix =3D strchr(suffix, '.'); + suffix =3D STRSKIP(suffix, "."); return lxcNetworkParseDataSuffix(suffix, value, parseData); } =20 @@ -714,6 +772,11 @@ lxcNetworkWalkCallback(const char *name, virConfValueP= tr value, void *data) if (!(parseData =3D lxcNetworkGetParseDataLegacy(networks, name))) return -1; =20 + return lxcNetworkParseDataEntryLegacy(name, value, parseData); + } else if (STRPREFIX(name, "lxc.net.")) { + if (!(parseData =3D lxcNetworkGetParseData(networks, name))) + return -1; + return lxcNetworkParseDataEntry(name, value, parseData); } =20 --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 12 01:32:17 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 1551743793494398.04952420337054; Mon, 4 Mar 2019 15:56:33 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C06643082B58; Mon, 4 Mar 2019 23:56:31 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8F23B6013F; Mon, 4 Mar 2019 23:56:31 +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 47F60131F7; Mon, 4 Mar 2019 23:56:31 +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 x24NsOba002688 for ; Mon, 4 Mar 2019 18:54:24 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1E3931710E; Mon, 4 Mar 2019 23:54:24 +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 184F55C207 for ; Mon, 4 Mar 2019 23:54:22 +0000 (UTC) Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com [209.85.222.193]) (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 6AC123DDBD for ; Mon, 4 Mar 2019 23:54:20 +0000 (UTC) Received: by mail-qk1-f193.google.com with SMTP id x9so3866145qkf.0 for ; Mon, 04 Mar 2019 15:54:20 -0800 (PST) Received: from localhost.localdomain ([177.188.104.249]) by smtp.gmail.com with ESMTPSA id d32sm4670568qtc.88.2019.03.04.15.54.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Mar 2019 15:54:18 -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=z/2qQf+it4QbW/Nf3xe/thdClF9rxMTSGUBJRhj9Af0=; b=eCzzpm073SIENsQor/GLtKg9tClLiqyUysFPGrckWpFEeooOCsrRwB6rCk7bpugSk+ hwrPieC7uHxPOftJMsiJargIsznoGnv5ICZjMcs7nbPatXUz2Q1feglSSp3TyTzkTjL7 f9PZwOWPjqmBtkUB9bFOi44kDcrX4Adxakc3Mm0KQctAXMvcScLJaZb2XilHUjWhV/PB mIJJu1hKV8L/Nl+6yuRY909glUAfxFevWuxMVzJ9HnTW7p5pA46DEbvDTER6UbJv27/Y x++dJMkOodd1LQb+QU4dmVHnTf6f8/jISW0ZfYtzAt6Cv3n+yYp4JXcD/LTdV+Ic0Fjc DOxA== 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=z/2qQf+it4QbW/Nf3xe/thdClF9rxMTSGUBJRhj9Af0=; b=IjhQ+0u7rdyDEVzqjzOY8qjK2YSk/MHwZ0Xlwz1nzJ1/unzLGouOT04u5+weKWYgs0 TjtnirebwW2dn3BT4l25i7MVmxB6XFnywu14qXjb9L60g3IhM54WUC7qGZAnU9VDzxOl HdTP4xO+o9iO+bGnY3Trq2YAucKeDy3YFerESHuPXJLayVJQjCkNrM0tJmrxaMEmVJNn I+uG64VOPPLoQfRcgRQS99uMYYUdYreT5R38p0J9kdap4U5RdcaEraRNtWSNxo4qfXsG xdK070D89nLkIG82xs4G5xQ3CdKRGjB/9I52EWuW1BZPHgB3NlKarWHAu7FyLBIIeNPI buaA== X-Gm-Message-State: APjAAAWld2dLZA6j6nftjgiNaLSwX/RQ1UxuJZTRPlpO0TDpey4vBjVW OOtTl4ltzawCY8ZyUzgXHDmMtinx X-Google-Smtp-Source: APXvYqyhMcv18Bcx7BYrEmcYGgzvDzKLkT8t3WSu5ruC8sx/Nwjr/ilY6KhN2qMy320FYv2SjqeEKw== X-Received: by 2002:a37:de0b:: with SMTP id h11mr15421801qkj.238.1551743658782; Mon, 04 Mar 2019 15:54:18 -0800 (PST) From: Julio Faracco To: libvir-list@redhat.com Date: Mon, 4 Mar 2019 20:54:03 -0300 Message-Id: <20190304235404.16320-6-jcfaracco@gmail.com> In-Reply-To: <20190304235404.16320-1-jcfaracco@gmail.com> References: <20190304235404.16320-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.29]); Mon, 04 Mar 2019 23:54:20 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 04 Mar 2019 23:54:20 +0000 (UTC) for IP:'209.85.222.193' DOMAIN:'mail-qk1-f193.google.com' HELO:'mail-qk1-f193.google.com' FROM:'jcfaracco@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.111 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.222.193 mail-qk1-f193.google.com 209.85.222.193 mail-qk1-f193.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 5/6] tests: Change network settings of V3 testcase set. 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.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Mon, 04 Mar 2019 23:56:32 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Now, it is time to use the new pattern for LXC 3.X inside config test cases. In the past, we kept the old style to keep all functionalities. Now, it is possible to use indexes properly. Signed-off-by: Julio Faracco --- .../lxcconf2xml-ethernet-v3.config | 16 ++++---- .../lxcconf2xml-fstab-v3.config | 10 ++--- .../lxcconf2xml-macvlannetwork-v3.config | 10 ++--- .../lxcconf2xml-miscnetwork-v3.config | 38 +++++++++---------- .../lxcconf2xml-nonenetwork-v3.config | 2 +- .../lxcconf2xml-physnetwork-v3.config | 14 +++---- .../lxcconf2xml-simple-v3.config | 18 ++++----- .../lxcconf2xmldata/lxcconf2xml-simple.config | 18 ++++----- .../lxcconf2xml-vlannetwork-v3.config | 10 ++--- 9 files changed, 68 insertions(+), 68 deletions(-) diff --git a/tests/lxcconf2xmldata/lxcconf2xml-ethernet-v3.config b/tests/l= xcconf2xmldata/lxcconf2xml-ethernet-v3.config index 630cb2ebb6..0a641549f3 100644 --- a/tests/lxcconf2xmldata/lxcconf2xml-ethernet-v3.config +++ b/tests/lxcconf2xmldata/lxcconf2xml-ethernet-v3.config @@ -1,14 +1,14 @@ # Template used to create this container: opensuse # Template script checksum (SHA-1): 27307e0a95bd81b2c0bd82d6f87fdbe83be075= ef =20 -lxc.network.type =3D veth -lxc.network.flags =3D up -lxc.network.hwaddr =3D 02:00:15:8f:05:c1 -lxc.network.name =3D eth0 -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.net.0.type =3D veth +lxc.net.0.flags =3D up +lxc.net.0.hwaddr =3D 02:00:15:8f:05:c1 +lxc.net.0.name =3D eth0 +lxc.net.0.ipv4 =3D 192.168.122.2/24 +lxc.net.0.ipv4.gateway =3D 192.168.122.1 +lxc.net.0.ipv6 =3D 2003:db8:1:0:214:1234:fe0b:3596/64 +lxc.net.0.ipv6.gateway =3D 2003:db8:1:0:214:1234:fe0b:3595 =20 #remove next line if host DNS configuration should not be available to con= tainer lxc.mount.entry =3D proc proc proc nodev,noexec,nosuid 0 0 diff --git a/tests/lxcconf2xmldata/lxcconf2xml-fstab-v3.config b/tests/lxcc= onf2xmldata/lxcconf2xml-fstab-v3.config index 8b62818657..315ad45ad1 100644 --- a/tests/lxcconf2xmldata/lxcconf2xml-fstab-v3.config +++ b/tests/lxcconf2xmldata/lxcconf2xml-fstab-v3.config @@ -1,11 +1,11 @@ # Template used to create this container: opensuse # Template script checksum (SHA-1): 27307e0a95bd81b2c0bd82d6f87fdbe83be075= ef =20 -lxc.network.type =3D veth -lxc.network.flags =3D up -lxc.network.link =3D virbr0 -lxc.network.hwaddr =3D 02:00:15:8f:05:c1 -lxc.network.name =3D eth0 +lxc.net.1.type =3D veth +lxc.net.1.flags =3D up +lxc.net.1.link =3D virbr0 +lxc.net.1.hwaddr =3D 02:00:15:8f:05:c1 +lxc.net.1.name =3D eth0 =20 #remove next line if host DNS configuration should not be available to con= tainer lxc.mount.fstab =3D /var/lib/lxc/migrate_test/fstab diff --git a/tests/lxcconf2xmldata/lxcconf2xml-macvlannetwork-v3.config b/t= ests/lxcconf2xmldata/lxcconf2xml-macvlannetwork-v3.config index 631f07ecca..ab8d85361f 100644 --- a/tests/lxcconf2xmldata/lxcconf2xml-macvlannetwork-v3.config +++ b/tests/lxcconf2xmldata/lxcconf2xml-macvlannetwork-v3.config @@ -1,11 +1,11 @@ # Template used to create this container: opensuse # Template script checksum (SHA-1): 27307e0a95bd81b2c0bd82d6f87fdbe83be075= ef =20 -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.net.0.type =3D macvlan +lxc.net.0.flags =3D up +lxc.net.0.link =3D eth0 +lxc.net.0.hwaddr =3D 02:00:15:8f:05:c1 +lxc.net.0.macvlan.mode =3D vepa =20 #remove next line if host DNS configuration should not be available to con= tainer lxc.rootfs.path =3D /var/lib/lxc/migrate_test/rootfs diff --git a/tests/lxcconf2xmldata/lxcconf2xml-miscnetwork-v3.config b/test= s/lxcconf2xmldata/lxcconf2xml-miscnetwork-v3.config index b46cb3ee7d..9be8cf95ea 100644 --- a/tests/lxcconf2xmldata/lxcconf2xml-miscnetwork-v3.config +++ b/tests/lxcconf2xmldata/lxcconf2xml-miscnetwork-v3.config @@ -1,23 +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.net.0.type =3D phys +lxc.net.0.link =3D eth0 +lxc.net.0.name =3D eth1 +lxc.net.0.ipv4 =3D 192.168.122.2/24 +lxc.net.0.ipv4.gateway =3D 192.168.122.1 +lxc.net.0.ipv6 =3D 2003:db8:1:0:214:1234:fe0b:3596/64 +lxc.net.0.ipv6.gateway =3D 2003:db8:1:0:214:1234:fe0b:3595 =20 -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.net.1.type =3D vlan +lxc.net.1.flags =3D up +lxc.net.1.link =3D eth0 +lxc.net.1.hwaddr =3D 02:00:15:8f:05:c1 +lxc.net.1.vlan.id =3D 2 =20 -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.net.2.type =3D macvlan +lxc.net.2.flags =3D up +lxc.net.2.link =3D eth0 +lxc.net.2.hwaddr =3D 02:00:15:8f:05:c1 +lxc.net.2.macvlan.mode =3D vepa =20 -lxc.rootfs =3D /var/lib/lxc/migrate_test/rootfs -lxc.utsname =3D migrate_test +lxc.rootfs.path =3D /var/lib/lxc/migrate_test/rootfs +lxc.uts.name =3D migrate_test lxc.autodev=3D1 diff --git a/tests/lxcconf2xmldata/lxcconf2xml-nonenetwork-v3.config b/test= s/lxcconf2xmldata/lxcconf2xml-nonenetwork-v3.config index f81a786f1e..2402723d9e 100644 --- a/tests/lxcconf2xmldata/lxcconf2xml-nonenetwork-v3.config +++ b/tests/lxcconf2xmldata/lxcconf2xml-nonenetwork-v3.config @@ -1,4 +1,4 @@ lxc.rootfs.path =3D /var/lib/lxc/migrate_test/rootfs lxc.uts.name =3D migrate_test lxc.autodev=3D1 -lxc.network.type =3D none +lxc.net.0.type =3D none diff --git a/tests/lxcconf2xmldata/lxcconf2xml-physnetwork-v3.config b/test= s/lxcconf2xmldata/lxcconf2xml-physnetwork-v3.config index 92729841d7..23f9d78dbd 100644 --- a/tests/lxcconf2xmldata/lxcconf2xml-physnetwork-v3.config +++ b/tests/lxcconf2xmldata/lxcconf2xml-physnetwork-v3.config @@ -1,10 +1,10 @@ -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.net.1.type =3D phys +lxc.net.1.link =3D eth0 +lxc.net.1.name =3D eth1 +lxc.net.1.ipv4 =3D 192.168.122.2/24 +lxc.net.1.ipv4.gateway =3D 192.168.122.1 +lxc.net.1.ipv6 =3D 2003:db8:1:0:214:1234:fe0b:3596/64 +lxc.net.1.ipv6.gateway =3D 2003:db8:1:0:214:1234:fe0b:3595 =20 lxc.rootfs.path =3D /var/lib/lxc/migrate_test/rootfs lxc.uts.name =3D migrate_test diff --git a/tests/lxcconf2xmldata/lxcconf2xml-simple-v3.config b/tests/lxc= conf2xmldata/lxcconf2xml-simple-v3.config index a0036a482e..b0656571b2 100644 --- a/tests/lxcconf2xmldata/lxcconf2xml-simple-v3.config +++ b/tests/lxcconf2xmldata/lxcconf2xml-simple-v3.config @@ -1,15 +1,15 @@ # Template used to create this container: opensuse # Template script checksum (SHA-1): 27307e0a95bd81b2c0bd82d6f87fdbe83be075= ef =20 -lxc.network.type =3D veth -lxc.network.flags =3D up -lxc.network.link =3D virbr0 -lxc.network.hwaddr =3D 02:00:15:8f:05:c1 -lxc.network.name =3D eth0 -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.net.0.type =3D veth +lxc.net.0.flags =3D up +lxc.net.0.link =3D virbr0 +lxc.net.0.hwaddr =3D 02:00:15:8f:05:c1 +lxc.net.0.name =3D eth0 +lxc.net.0.ipv4 =3D 192.168.122.2/24 +lxc.net.0.ipv4.gateway =3D 192.168.122.1 +lxc.net.0.ipv6 =3D 2003:db8:1:0:214:1234:fe0b:3596/64 +lxc.net.0.ipv6.gateway =3D 2003:db8:1:0:214:1234:fe0b:3595 =20 #remove next line if host DNS configuration should not be available to con= tainer lxc.mount.entry =3D proc proc proc nodev,noexec,nosuid 0 0 diff --git a/tests/lxcconf2xmldata/lxcconf2xml-simple.config b/tests/lxccon= f2xmldata/lxcconf2xml-simple.config index 50a44bba95..a8429e4657 100644 --- a/tests/lxcconf2xmldata/lxcconf2xml-simple.config +++ b/tests/lxcconf2xmldata/lxcconf2xml-simple.config @@ -1,15 +1,15 @@ # Template used to create this container: opensuse # Template script checksum (SHA-1): 27307e0a95bd81b2c0bd82d6f87fdbe83be075= ef =20 -lxc.network.type =3D veth -lxc.network.flags =3D up -lxc.network.link =3D virbr0 -lxc.network.hwaddr =3D 02:00:15:8f:05:c1 -lxc.network.name =3D eth0 -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.net.0.type =3D veth +lxc.net.0.flags =3D up +lxc.net.0.link =3D virbr0 +lxc.net.0.hwaddr =3D 02:00:15:8f:05:c1 +lxc.net.0.name =3D eth0 +lxc.net.0.ipv4 =3D 192.168.122.2/24 +lxc.net.0.ipv4.gateway =3D 192.168.122.1 +lxc.net.0.ipv6 =3D 2003:db8:1:0:214:1234:fe0b:3596/64 +lxc.net.0.ipv6.gateway =3D 2003:db8:1:0:214:1234:fe0b:3595 =20 #remove next line if host DNS configuration should not be available to con= tainer lxc.mount.entry =3D proc proc proc nodev,noexec,nosuid 0 0 diff --git a/tests/lxcconf2xmldata/lxcconf2xml-vlannetwork-v3.config b/test= s/lxcconf2xmldata/lxcconf2xml-vlannetwork-v3.config index 31e26997dd..fb4539261f 100644 --- a/tests/lxcconf2xmldata/lxcconf2xml-vlannetwork-v3.config +++ b/tests/lxcconf2xmldata/lxcconf2xml-vlannetwork-v3.config @@ -1,11 +1,11 @@ # Template used to create this container: opensuse # Template script checksum (SHA-1): 27307e0a95bd81b2c0bd82d6f87fdbe83be075= ef =20 -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.net.1.type =3D vlan +lxc.net.1.flags =3D up +lxc.net.1.link =3D eth0 +lxc.net.1.hwaddr =3D 02:00:15:8f:05:c1 +lxc.net.1.vlan.id =3D 2 =20 lxc.rootfs.path =3D /var/lib/lxc/migrate_test/rootfs lxc.uts.name =3D migrate_test --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 12 01:32:17 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 1551743797164243.54415111655226; Mon, 4 Mar 2019 15:56:37 -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 02575356DA; Mon, 4 Mar 2019 23:56:35 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CAC8517119; Mon, 4 Mar 2019 23:56:34 +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 8A2743FB14; Mon, 4 Mar 2019 23:56:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x24NsPv8002693 for ; Mon, 4 Mar 2019 18:54:25 -0500 Received: by smtp.corp.redhat.com (Postfix) id 42F011001DDE; Mon, 4 Mar 2019 23:54:25 +0000 (UTC) Received: from mx1.redhat.com (ext-mx12.extmail.prod.ext.phx2.redhat.com [10.5.110.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2E9821001DCD for ; Mon, 4 Mar 2019 23:54:22 +0000 (UTC) Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com [209.85.160.171]) (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 3B5B73091786 for ; Mon, 4 Mar 2019 23:54:21 +0000 (UTC) Received: by mail-qt1-f171.google.com with SMTP id j36so7163782qta.7 for ; Mon, 04 Mar 2019 15:54:21 -0800 (PST) Received: from localhost.localdomain ([177.188.104.249]) by smtp.gmail.com with ESMTPSA id d32sm4670568qtc.88.2019.03.04.15.54.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Mar 2019 15:54:19 -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=7oX1n0Mxrmr3C8az55tbCMfx0XXvluUyoUlM18brbJk=; b=MSttmlTNIkyw2pLIJxerAHnqJTOYEjgUGhM0UNfcPMo+RzwGu4PoJMxdM56GAqjiFw RMwOwkMmJgGSDyMfakoREBlU7nBqgEuvSrpNGQX7uAQ8AYKSGUbGTwrGQDoPHUudjP73 iGEWLqZlbgB5ph2cMC3+wC1kVg0J0PKmdy9uMvVKH+Mw8NjJPzpDA2kNE8aOV8ejlqEl 1ZtzuQE6MyTtYo1iOYiPeqjd4C5dZALTHJhOfEEefsufKwOWtBDwz23fUYRS9twjbzBZ 8y54NY8gNY8e8jYMcTxD//D6Zcz4aTlaZuvDhfeVmkcmncCnF49eQg4GCbl0MIFq4cEY XRUg== 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=7oX1n0Mxrmr3C8az55tbCMfx0XXvluUyoUlM18brbJk=; b=p5MPn3ceducZANbqSkBNFkvjPJ1S9bzLEzKABKTfITyQAo8JZRgSMFgnf1bExv7635 GQX1Bpov5EYaEa+JCsYFzdIM468lOWXOn3Z0fMPTc73sWr9bMdGjsJorIITeKCcFEBXS 3Dywq+oB6onI/kM14g5PqO9bQvIibQfWJ2OQV59st61SOkHm2VDTSV3fiGLFzSMKLnkl puCibkm7hhh03gIuXlEFvWFGOuzEWkeKfRckQfcZeXqKhOFU8Yvu4oRFpzTLTg2tDBu+ pxqT4GL3lmE0+CLRKwMpn0v6xHV/OTbPPLtQRKoIO026l+U4El8FU7RusNdXy6o4brv+ vPXw== X-Gm-Message-State: APjAAAVgJ/k5IYdZuE+YT33bYpAoXeUNJRsiPry7NzsBtsZXipC16P/k IFBtIOVH6FB7Hq9GrMCJ8dCBLB+O X-Google-Smtp-Source: APXvYqzvlLLg9De2l+g/0tsnp7N7vRqhBnXqw8XZOC8n6NjQVS94u1aBFp1+Yvu9+71VYzZUswmVIQ== X-Received: by 2002:a0c:9acc:: with SMTP id k12mr16907293qvf.211.1551743660187; Mon, 04 Mar 2019 15:54:20 -0800 (PST) From: Julio Faracco To: libvir-list@redhat.com Date: Mon, 4 Mar 2019 20:54:04 -0300 Message-Id: <20190304235404.16320-7-jcfaracco@gmail.com> In-Reply-To: <20190304235404.16320-1-jcfaracco@gmail.com> References: <20190304235404.16320-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.41]); Mon, 04 Mar 2019 23:54:21 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Mon, 04 Mar 2019 23:54:21 +0000 (UTC) for IP:'209.85.160.171' DOMAIN:'mail-qt1-f171.google.com' HELO:'mail-qt1-f171.google.com' FROM:'jcfaracco@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.111 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.160.171 mail-qt1-f171.google.com 209.85.160.171 mail-qt1-f171.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.41 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 6/6] tests: Introduce random network settings to test indexes. 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.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.30]); Mon, 04 Mar 2019 23:56:35 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This is the same test of miscnetwork. The XML output needs to be the same. It contains random networks entries separated by indexes and it needs to produce the order XML definition. Signed-off-by: Julio Faracco --- .../lxcconf2xml-randomnetwork-v3.config | 21 +++++++++ .../lxcconf2xml-randomnetwork.xml | 45 +++++++++++++++++++ tests/lxcconf2xmltest.c | 1 + 3 files changed, 67 insertions(+) create mode 100644 tests/lxcconf2xmldata/lxcconf2xml-randomnetwork-v3.conf= ig create mode 100644 tests/lxcconf2xmldata/lxcconf2xml-randomnetwork.xml diff --git a/tests/lxcconf2xmldata/lxcconf2xml-randomnetwork-v3.config b/te= sts/lxcconf2xmldata/lxcconf2xml-randomnetwork-v3.config new file mode 100644 index 0000000000..8d898fa6e0 --- /dev/null +++ b/tests/lxcconf2xmldata/lxcconf2xml-randomnetwork-v3.config @@ -0,0 +1,21 @@ +lxc.net.0.type =3D phys +lxc.net.1.flags =3D up +lxc.net.0.link =3D eth0 +lxc.net.2.link =3D eth0 +lxc.net.1.hwaddr =3D 02:00:15:8f:05:c1 +lxc.net.1.link =3D eth0 +lxc.net.0.name =3D eth1 +lxc.net.2.macvlan.mode =3D vepa +lxc.net.2.type =3D macvlan +lxc.net.1.type =3D vlan +lxc.net.0.ipv4 =3D 192.168.122.2/24 +lxc.net.0.ipv4.gateway =3D 192.168.122.1 +lxc.net.1.vlan.id =3D 2 +lxc.net.0.ipv6 =3D 2003:db8:1:0:214:1234:fe0b:3596/64 +lxc.net.2.flags =3D up +lxc.net.2.hwaddr =3D 02:00:15:8f:05:c1 +lxc.net.0.ipv6.gateway =3D 2003:db8:1:0:214:1234:fe0b:3595 + +lxc.rootfs.path =3D /var/lib/lxc/migrate_test/rootfs +lxc.uts.name =3D migrate_test +lxc.autodev=3D1 diff --git a/tests/lxcconf2xmldata/lxcconf2xml-randomnetwork.xml b/tests/lx= cconf2xmldata/lxcconf2xml-randomnetwork.xml new file mode 100644 index 0000000000..63189cfaec --- /dev/null +++ b/tests/lxcconf2xmldata/lxcconf2xml-randomnetwork.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 2a277042ce..78927d29b1 100644 --- a/tests/lxcconf2xmltest.c +++ b/tests/lxcconf2xmltest.c @@ -163,6 +163,7 @@ mymain(void) DO_TEST3("macvlannetwork", false); DO_TEST3("vlannetwork", false); DO_TEST3("miscnetwork", false); + DO_TEST3("randomnetwork", 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