From nobody Fri Apr 19 18:38:54 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 1546023719074964.5868674745414; Fri, 28 Dec 2018 11:01:59 -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 8F696C059B6F; Fri, 28 Dec 2018 19:01:56 +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 08154600D7; Fri, 28 Dec 2018 19:01:56 +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 824403F954; Fri, 28 Dec 2018 19:01:54 +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 wBSJ1rrd013071 for ; Fri, 28 Dec 2018 14:01:53 -0500 Received: by smtp.corp.redhat.com (Postfix) id 183086013B; Fri, 28 Dec 2018 19:01:53 +0000 (UTC) Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1019F600D7 for ; Fri, 28 Dec 2018 19:01:50 +0000 (UTC) Received: from mail-qt1-f194.google.com (mail-qt1-f194.google.com [209.85.160.194]) (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 472548666C for ; Fri, 28 Dec 2018 19:01:49 +0000 (UTC) Received: by mail-qt1-f194.google.com with SMTP id t13so24224949qtn.3 for ; Fri, 28 Dec 2018 11:01:49 -0800 (PST) Received: from localhost.localdomain (200-100-184-135.dial-up.telesp.net.br. [200.100.184.135]) by smtp.gmail.com with ESMTPSA id b20sm20713570qkb.17.2018.12.28.11.01.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Dec 2018 11:01:47 -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=chJ74pZk4D/437gRLauiqGENIixRB1AntTwVS5zJAMI=; b=ryHkKz31Ehacx3K2G+dTERbtH9ZAsxj+/tMlIg7a8o58dWPZtW83BkTk5Ji5I7n6f1 uwvyLbJKL9buE9Oz9z4sdni8RbuRICIBjC+gNVuXwECfosFYBMnJ0y7YSUxxmp7ACBJZ T5USfSuHaizto2TnNflKajm1SeASy999TxTzcH88NpFqPeKfl7fZcuCdfSX3eWkPW04n CnYCAXLZdokqDtsJpzCvt0Lj0EJvhd3TWSjOoS+SRtFj6qK2R1lOX+TMcK7lxq+Epgz9 Pc0XMxRae5ns2OTRenrwNm+xXuVkWaZwuPS048DQDEc7I6oQLE5X/B119nRVETdsqvdE 7zxA== 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=chJ74pZk4D/437gRLauiqGENIixRB1AntTwVS5zJAMI=; b=lQRX4rMz0ekB3fm66BZGQf+0d6yH2XIGm0yuQ3Ymu3tqhWCDm72rV7pMMUiynyPHfW w700ImGxlZ8Y9u7rIVJYzCaKYPw0Zd7mx8OGKrsZxDKZS4ibu9dIUfsyOTaakDAo9V6t k3lEt0IzJU20TI+nwvxjebe+wXiWCYC4DeL5OVIdAfTok6fXYaneOnjDI1vLYg4UzGpU vxnwlndJ+5UDQQ1tnzsrFbQEQtBqVYB74CZAcaMHtq0jNlUbaKk7FFUy+yGqFfSqOFF4 ho0nBw4u0CNFMEV/r6bxTLyqB4A2fumahkksj1ZHedh9FaNCd65TKSs45vMZZ58iCH57 8Ahg== X-Gm-Message-State: AJcUukdEqAMV/yjfMuMVBkKJXZx14TKIY8sDzJHYynCrigL7mTOPpMdZ Gs0PExL7/H+TQSc59pTq4SGOimMC X-Google-Smtp-Source: ALg8bN6kLssCQC4GtpPer3cklGZM35KVf+/D8IR5/zA9La8fl6Q3uJQ5AsQ1CUbat048l7/AododZA== X-Received: by 2002:a0c:98ca:: with SMTP id g10mr27212736qvd.13.1546023708238; Fri, 28 Dec 2018 11:01:48 -0800 (PST) From: Julio Faracco To: libvir-list@redhat.com Date: Fri, 28 Dec 2018 17:01:36 -0200 Message-Id: <20181228190138.21128-2-jcfaracco@gmail.com> In-Reply-To: <20181228190138.21128-1-jcfaracco@gmail.com> References: <20181228190138.21128-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.26]); Fri, 28 Dec 2018 19:01:49 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 28 Dec 2018 19:01:49 +0000 (UTC) for IP:'209.85.160.194' DOMAIN:'mail-qt1-f194.google.com' HELO:'mail-qt1-f194.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.194 mail-qt1-f194.google.com 209.85.160.194 mail-qt1-f194.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/3] lxc: refactoring LXC network definition with a sparse array. 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.32]); Fri, 28 Dec 2018 19:01:57 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" LXC was using a single data structure to define all LXC NICs. In terms of optimization it is very interesting, but it is not useful when you use a index to define networks. After major release 3.0, LXC adopted indexes for network definitions. So, this commit adds a sparse vector to handle network indexes. Now, networks can be defined in sequence using the legacy config. Or using a sparse array, using version 3 with indexes. Signed-off-by: Julio Faracco --- src/lxc/lxc_native.c | 191 ++++++++++++++++++++++++++++--------------- 1 file changed, 124 insertions(+), 67 deletions(-) diff --git a/src/lxc/lxc_native.c b/src/lxc/lxc_native.c index 1eee3fc2bb..860cf87227 100644 --- a/src/lxc/lxc_native.c +++ b/src/lxc/lxc_native.c @@ -22,6 +22,7 @@ #include =20 #include "internal.h" +#include "c-ctype.h" #include "lxc_container.h" #include "lxc_native.h" #include "util/viralloc.h" @@ -409,8 +410,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; @@ -422,9 +424,13 @@ typedef struct { size_t nips; char *gateway_ipv4; char *gateway_ipv6; - bool privnet; - size_t networks; -} lxcNetworkParseData; + size_t index; +}; + +typedef struct { + lxcNetworkParseDataPtr *data; + int networks; +} lxcNetworkParseArray; =20 static int lxcAddNetworkRouteDefinition(const char *address, @@ -464,7 +470,7 @@ lxcAddNetworkRouteDefinition(const char *address, } =20 static int -lxcAddNetworkDefinition(lxcNetworkParseData *data) +lxcAddNetworkDefinition(virDomainDefPtr def, lxcNetworkParseData *data) { virDomainNetDefPtr net =3D NULL; virDomainHostdevDefPtr hostdev =3D NULL; @@ -512,9 +518,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, @@ -536,9 +542,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; @@ -552,51 +558,89 @@ lxcAddNetworkDefinition(lxcNetworkParseData *data) return -1; } =20 +#define lxcNetworkHasIndex(entry) \ + (STRPREFIX(entry, "lxc.net.") && c_isdigit(entry[8])) + +#define lxcNetworkIndexHasType(entry, type) \ + (lxcNetworkHasIndex(entry) && virFileHasSuffix(entry, type)) + static int lxcNetworkWalkCallback(const char *name, virConfValuePtr value, void *data) { - lxcNetworkParseData *parseData =3D data; - int status; + lxcNetworkParseArray *parseData =3D data; + size_t index; + + /* Managing memory and indexes for version 3.0 */ + if (lxcNetworkHasIndex(name)) { + sscanf(name, "lxc.net.%zu", &index); + + if (index >=3D parseData->networks) { + if (!parseData->data) { + if (VIR_ALLOC_N(parseData->data, index + 1) < 0) + return -1; + } else { + if (VIR_REALLOC_N(parseData->data, index + 1) < 0) + return -1; + } =20 - if (STREQ(name, "lxc.network.type")) { - virDomainDefPtr def =3D parseData->def; - size_t networks =3D parseData->networks; - bool privnet =3D parseData->privnet; + parseData->networks =3D index + 1; + } =20 - /* Store the previous NIC */ - status =3D lxcAddNetworkDefinition(parseData); + if (!parseData->data[index]) { + if (VIR_ALLOC(parseData->data[index]) < 0) + return -1; + } + } else { + /* Indexes can be 0 when a network is defined */ + index =3D parseData->networks - 1; + } =20 - if (status < 0) - return -1; - else if (status > 0) - networks++; - else if (parseData->type !=3D NULL && STREQ(parseData->type, "none= ")) - privnet =3D false; + if (STREQ(name, "lxc.network.type")) { + /* A new NIC will be added */ + index =3D parseData->networks; =20 - /* clean NIC to store a new one */ - memset(parseData, 0, sizeof(*parseData)); + if (!parseData->data) { + if (VIR_ALLOC_N(parseData->data, index + 1) < 0) + return -1; + } else { + if (VIR_REALLOC_N(parseData->data, index + 1) < 0) + return -1; + } =20 - parseData->def =3D def; - parseData->networks =3D networks; - parseData->privnet =3D privnet; + if (VIR_ALLOC(parseData->data[index]) < 0) + return -1; =20 /* Keep the new value */ - parseData->type =3D value->str; + parseData->data[index]->type =3D value->str; + parseData->data[index]->index =3D index; + + /* Network interface added */ + parseData->networks++; } - else if (STREQ(name, "lxc.network.link")) - parseData->link =3D value->str; - else if (STREQ(name, "lxc.network.hwaddr")) - parseData->mac =3D value->str; - else if (STREQ(name, "lxc.network.flags")) - parseData->flag =3D value->str; - else if (STREQ(name, "lxc.network.macvlan.mode")) - parseData->macvlanmode =3D value->str; - else if (STREQ(name, "lxc.network.vlan.id")) - parseData->vlanid =3D value->str; - else if (STREQ(name, "lxc.network.name")) - parseData->name =3D value->str; - else if (STREQ(name, "lxc.network.ipv4") || - STREQ(name, "lxc.network.ipv6")) { + else if (lxcNetworkIndexHasType(name, ".type")) + parseData->data[index]->type =3D value->str; + else if (STREQ(name, "lxc.network.link") || + lxcNetworkIndexHasType(name, ".link")) + parseData->data[index]->link =3D value->str; + else if (STREQ(name, "lxc.network.hwaddr") || + lxcNetworkIndexHasType(name, ".hwaddr")) + parseData->data[index]->mac =3D value->str; + else if (STREQ(name, "lxc.network.flags") || + lxcNetworkIndexHasType(name, ".flags")) + parseData->data[index]->flag =3D value->str; + else if (STREQ(name, "lxc.network.macvlan.mode") || + lxcNetworkIndexHasType(name, ".macvlan.mode")) + parseData->data[index]->macvlanmode =3D value->str; + else if (STREQ(name, "lxc.network.vlan.id") || + lxcNetworkIndexHasType(name, ".vlan.id")) + parseData->data[index]->vlanid =3D value->str; + else if (STREQ(name, "lxc.network.name") || + lxcNetworkIndexHasType(name, ".name")) + parseData->data[index]->name =3D value->str; + else if ((STREQ(name, "lxc.network.ipv4") || + STREQ(name, "lxc.network.ipv6")) || + (lxcNetworkIndexHasType(name, ".ipv4") || + lxcNetworkIndexHasType(name, ".ipv6"))) { int family =3D AF_INET; char **ipparts =3D NULL; virNetDevIPAddrPtr ip =3D NULL; @@ -604,7 +648,8 @@ lxcNetworkWalkCallback(const char *name, virConfValuePt= r value, void *data) if (VIR_ALLOC(ip) < 0) return -1; =20 - if (STREQ(name, "lxc.network.ipv6")) + if (STREQ(name, "lxc.network.ipv6") || + lxcNetworkIndexHasType(name, ".ipv6")) family =3D AF_INET6; =20 ipparts =3D virStringSplit(value->str, "/", 2); @@ -622,15 +667,19 @@ lxcNetworkWalkCallback(const char *name, virConfValue= Ptr value, void *data) =20 virStringListFree(ipparts); =20 - if (VIR_APPEND_ELEMENT(parseData->ips, parseData->nips, ip) < 0) { + if (VIR_APPEND_ELEMENT(parseData->data[index]->ips, + parseData->data[index]->nips, ip) < 0) { VIR_FREE(ip); return -1; } - } else if (STREQ(name, "lxc.network.ipv4.gateway")) { - parseData->gateway_ipv4 =3D value->str; - } else if (STREQ(name, "lxc.network.ipv6.gateway")) { - parseData->gateway_ipv6 =3D value->str; - } else if (STRPREFIX(name, "lxc.network")) { + } else if (STREQ(name, "lxc.network.ipv4.gateway") || + lxcNetworkIndexHasType(name, ".ipv4.gateway")) { + parseData->data[index]->gateway_ipv4 =3D value->str; + } else if (STREQ(name, "lxc.network.ipv6.gateway") || + lxcNetworkIndexHasType(name, ".ipv6.gateway")) { + parseData->data[index]->gateway_ipv6 =3D value->str; + } else if (STRPREFIX(name, "lxc.network") || + lxcNetworkHasIndex(name)) { VIR_WARN("Unhandled network property: %s =3D %s", name, value->str); @@ -645,25 +694,29 @@ 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}; + 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.networks; i++) { + lxcNetworkParseDataPtr data =3D nets.data[i]; =20 - /* Add the last network definition found */ - status =3D lxcAddNetworkDefinition(&data); + /* It needs to guarantee that index exists. */ + /* Since there is a sparse array. */ + if (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.networks =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; } @@ -672,9 +725,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 <=3D nets.networks; i++) { + for (i =3D 0; i < nets.data[i]->nips; i++) + VIR_FREE(nets.data[i]->ips[i]); + VIR_FREE(nets.data[i]->ips); + } + for (i =3D 0; i <=3D nets.networks; 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 Fri Apr 19 18:38:54 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 1546023737000901.6025716535997; Fri, 28 Dec 2018 11:02:17 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EA97EA4041; Fri, 28 Dec 2018 19:02: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 B001A60C62; Fri, 28 Dec 2018 19:02:14 +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 6BCD5181B9F6; Fri, 28 Dec 2018 19:02:14 +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 wBSJ1tDK013081 for ; Fri, 28 Dec 2018 14:01:55 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4C0A31001F45; Fri, 28 Dec 2018 19:01:55 +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 447E91000049 for ; Fri, 28 Dec 2018 19:01:53 +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 5E3F13DDBE for ; Fri, 28 Dec 2018 19:01:51 +0000 (UTC) Received: by mail-qt1-f196.google.com with SMTP id t13so24225030qtn.3 for ; Fri, 28 Dec 2018 11:01:51 -0800 (PST) Received: from localhost.localdomain (200-100-184-135.dial-up.telesp.net.br. [200.100.184.135]) by smtp.gmail.com with ESMTPSA id b20sm20713570qkb.17.2018.12.28.11.01.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Dec 2018 11:01:49 -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=8OO2oSM1tGPpwVPUhFQ3FsegzlLFjUQPSYoM+PmbHbM=; b=mRaCKjmt4HEL08Jxpr6zdWUkYyx1swQJ6XGVRs2zlL7CsXDccHNt6GF5bkS87aZTEj iEYWxOsn1mxmKjVQny6VHghBADHFKlotbTdq3we4RUqBm4rMZO+yxWehwY9FIPZBwV4c f2eeSbbKUJb6YAl9utqzoQvBia+7JEWucRz6WU+FXiM7eE0XmHuRWdwtfCMVPhVYK9lh DVluSsqI9bTppN9AZZkR6IgEHycoxmV2hhRY8SXju/JnlinPV8oR1qsS10+POPCrvpZV m+ZvdY7Why4nER56kDPGFcQoOkkig4ro5UjtR7rvAMiu/XapdCC0DVdPneNiYSBWdH6H 6zBw== 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=8OO2oSM1tGPpwVPUhFQ3FsegzlLFjUQPSYoM+PmbHbM=; b=ccx1IeOmNvaMQ31GcJL+b1B0EzVTdPqMsJGFqEHT3156NNq1mPmPir8QEjPk0v95uu GLpxdInzBoRBsAkEUltkT2mdcvVYdFffEhVIWWeMkQL+Qh7IFneke9aBCWco1pg9yagS 5oXltGXRgTvVmQFDvFzHtfnjmpW9xTZI+J9Zp+jYStvQpaIil3VlF+kz27k635GEew55 IHEFOod10Zqp/8BV8j6AZAI4KmkCcc3GoKkuSP68Unopuc3WRiROJ+ITVIxwUnGlvGPF k2oKyzjYUwW1YZq4u3pxuQaR3zt+qYjaDLZe10y84aiviyLiv8hBpvo9zTIa8uJpRWzZ N1XQ== X-Gm-Message-State: AA+aEWYcqABXuyKIMjgjTb99VqheQ5aFQ6vop7XDWVTvX/8i3KYilWXf EiyPFD8eeXjBQ1iIU3pGUlW2qgD9 X-Google-Smtp-Source: ALg8bN5Y5hyQZsgC0QPkdfIAJc53P+0DtJYuYyER4XcJUmNtU8Ouk0A/im+R2AYnRWVwToFa5bmocw== X-Received: by 2002:ac8:64a:: with SMTP id e10mr26323862qth.314.1546023710174; Fri, 28 Dec 2018 11:01:50 -0800 (PST) From: Julio Faracco To: libvir-list@redhat.com Date: Fri, 28 Dec 2018 17:01:37 -0200 Message-Id: <20181228190138.21128-3-jcfaracco@gmail.com> In-Reply-To: <20181228190138.21128-1-jcfaracco@gmail.com> References: <20181228190138.21128-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]); Fri, 28 Dec 2018 19:01:51 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 28 Dec 2018 19:01:51 +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.29 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/3] tests: Change legacy network configs to version 3.0 with 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 28 Dec 2018 19:02:15 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This commit only change the legacy network settings ("lxc.network.") inside v3 tests to the new format ("lxc.net.X.") adopted in version 3.0. It enhaces some test cases to cover other scenarions. 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-physnetwork-v3.config | 14 +++---- .../lxcconf2xml-simple-v3.config | 18 ++++----- .../lxcconf2xml-vlannetwork-v3.config | 10 ++--- 7 files changed, 58 insertions(+), 58 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..3034e4d1ca 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.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.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.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 =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-physnetwork-v3.config b/test= s/lxcconf2xmldata/lxcconf2xml-physnetwork-v3.config index 92729841d7..9cf96163b3 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.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.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..09cc91c2c6 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.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 +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 #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..172211c21f 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.0.type =3D vlan +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.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 Fri Apr 19 18:38:54 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 1546023739882245.51997652198804; Fri, 28 Dec 2018 11:02:19 -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 CD9BA369CE; Fri, 28 Dec 2018 19:02:17 +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 94CF017D08; Fri, 28 Dec 2018 19:02:17 +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 402613F7D5; Fri, 28 Dec 2018 19:02:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wBSJ1uhK013089 for ; Fri, 28 Dec 2018 14:01:56 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5A52117C39; Fri, 28 Dec 2018 19:01:56 +0000 (UTC) Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 500555DD6B for ; Fri, 28 Dec 2018 19:01:54 +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 CBFC1C0587EA for ; Fri, 28 Dec 2018 19:01:52 +0000 (UTC) Received: by mail-qt1-f196.google.com with SMTP id k12so24215229qtf.7 for ; Fri, 28 Dec 2018 11:01:52 -0800 (PST) Received: from localhost.localdomain (200-100-184-135.dial-up.telesp.net.br. [200.100.184.135]) by smtp.gmail.com with ESMTPSA id b20sm20713570qkb.17.2018.12.28.11.01.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Dec 2018 11:01:51 -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=HuUL71ld8dNvESEi3aGZKt3c7BK6kDJUwJ38uZoJjb0=; b=PemoWSKxq4MFIahrlE8Fr00rtjiO0gDnfHpqRaFDuFuOKSuR133LuWuITSO67CRQDO Vu9uXnPzcmvKDZe0qZ9n6BoZQBjYdygKdhreHNIm6vELnAzQE9AytonPdydLaQSEAih/ y1fOh/81xcMQ5MyD6J0On6Je5dwbhx3nrFakZdcLvjhyetRabZ6GiOczLREw3dACKw8W pcu3XmlZKsmUwHsVHrRwoKuKlOP+ck/ZxDwroCz8ycSF//o72UVb16ANWZEfcTT0Fufo X6U/waDAI6uxrn4wG2eX+OuHAzDMAOxKbZ+CZ5ORfwcr8BexXhNyvK5ml/rCXxpVqo0F RVXQ== 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=HuUL71ld8dNvESEi3aGZKt3c7BK6kDJUwJ38uZoJjb0=; b=d41w7AxAF+XpfJZGzFkad/8JnHzOI2BOTaJreOKoKhCgYYG/rHks3ucYm7FptRfd3K LNj5vgiU+xf/Zw0Fqeix1Xvay47X2CnS+nVEE8Mkd9QSsXtD/CPIMGqVtHMVLVKaZ4In RFMNHBCudq1VmILCcKtj6KMCdtSi+ttS/iObueHOoISNbGZqsQJAglbJpVZWyGXGyXbk t1YitgaHkCre3ncywGjU+Rgr9+C6RLIacu/5LzM8OpMfecXlQtPxc7vAYIDgNuj2/b0F xgEjAOw4Sf8Rl7JIdo1a6dsy250mySKWkeONmO4MnhNpAY2wFv44SpvQS1vY8CBBj3cG ODhQ== X-Gm-Message-State: AJcUukfRHI3CHfPdS/O4fknI1PRkixnaJ7TPP/oGnLuuKzJsmo2ZaHIZ lgupDFgLVBZ2SHjHFMD1RFvxYV+P X-Google-Smtp-Source: ALg8bN5+8g+9pmaC2d3Wz4XsETsN3yYmszTMoOJo+CRGvu5VxyFJ/GH2fD+Wlu07illsMj1pgW82nQ== X-Received: by 2002:a0c:d033:: with SMTP id u48mr27092658qvg.146.1546023711785; Fri, 28 Dec 2018 11:01:51 -0800 (PST) From: Julio Faracco To: libvir-list@redhat.com Date: Fri, 28 Dec 2018 17:01:38 -0200 Message-Id: <20181228190138.21128-4-jcfaracco@gmail.com> In-Reply-To: <20181228190138.21128-1-jcfaracco@gmail.com> References: <20181228190138.21128-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.32]); Fri, 28 Dec 2018 19:01:53 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 28 Dec 2018 19:01:53 +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.32 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/3] tests: Include a random network testcase 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 28 Dec 2018 19:02:18 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This is a test case to test network indexes. NICs must be created considering the sequence of each index no matter where the entry is. They do not be defined in sequence as legacy version suggests. 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..b69cec32d6 --- /dev/null +++ b/tests/lxcconf2xmldata/lxcconf2xml-randomnetwork-v3.config @@ -0,0 +1,21 @@ +lxc.net.20.type =3D macvlan +lxc.net.1.type =3D phys +lxc.net.10.flags =3D up +lxc.net.20.hwaddr =3D 02:00:15:8f:05:c1 +lxc.net.20.flags =3D up +lxc.net.1.link =3D eth0 +lxc.net.1.name =3D eth1 +lxc.net.10.type =3D vlan +lxc.net.1.ipv6.gateway =3D 2003:db8:1:0:214:1234:fe0b:3595 +lxc.net.1.ipv6 =3D 2003:db8:1:0:214:1234:fe0b:3596/64 +lxc.net.20.link =3D eth0 +lxc.net.10.vlan.id =3D 2 +lxc.net.1.ipv4.gateway =3D 192.168.122.1 +lxc.net.10.link =3D eth0 +lxc.net.1.ipv4 =3D 192.168.122.2/24 +lxc.net.10.hwaddr =3D 02:00:15:8f:05:c1 +lxc.net.20.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-randomnetwork.xml b/tests/lx= cconf2xmldata/lxcconf2xml-randomnetwork.xml new file mode 100644 index 0000000000..baaceb5455 --- /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