From nobody Sat May 18 23:23:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1580230168592658.3938767778088; Tue, 28 Jan 2020 08:49:28 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-32-56nkoXF9NoS6-19Uvb24uw-1; Tue, 28 Jan 2020 11:49:11 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7ACDD1005510; Tue, 28 Jan 2020 16:49:05 +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 4A90A4521; Tue, 28 Jan 2020 16:49:05 +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 C15531803C37; Tue, 28 Jan 2020 16:49:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00SGn3JP028284 for ; Tue, 28 Jan 2020 11:49:03 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0D73AD1BCC; Tue, 28 Jan 2020 16:49:03 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0925363A70 for ; Tue, 28 Jan 2020 16:49:00 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A6B74185B0CA for ; Tue, 28 Jan 2020 16:49:00 +0000 (UTC) Received: from mail-qv1-f66.google.com (mail-qv1-f66.google.com [209.85.219.66]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-236-dxvJBlgmNLaTmFaUmCNc6Q-1; Tue, 28 Jan 2020 11:48:54 -0500 Received: by mail-qv1-f66.google.com with SMTP id m5so3436457qvv.4; Tue, 28 Jan 2020 08:48:54 -0800 (PST) Received: from localhost.localdomain ([2804:431:c7cb:a9a6:59b3:4b4:e00c:2a48]) by smtp.gmail.com with ESMTPSA id n132sm13013505qke.58.2020.01.28.08.48.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jan 2020 08:48:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580230167; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=wIJKJwAirfUdLtgmYKdVR+j3CduyetcNPjHJONH4mtw=; b=RyHwk3LxxNGDbfwLmGEstexQ0iF89p1wwRjfb9pzy0rXqFrpJznyGW1oki2kD7w4A+9vVm jvi/G8uXHquZfvcrJIFIQAn/oM9YJjXNcyMfof0Xb6tLjVgSDRGM7JMaR2/IjuuWVCphYy IX/LPTAHIMaxBkGYHN0V5hBDdXBQdMc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+Vt9Bb2OFnDY8RdK+5heP3rOwv0C4jkLyuCq1YgV79k=; b=AhFd5pvpMaoIvcLx74b+VpsVySHY0JgKP+LuMNdBW7UiGyBkELecGNgZBdq/vd2yRW 0gbCvi5nB2IvFLYnhLWy3MYb+BcAspFuZPsnhF/qtE3xU+8dBxLsFciIla/CyRTFSD0+ G7Z6oq1xfGalTwjCxkXboH2pQguV4Rg0g02qdBFWuRUi2qp6d8wgxFpda7Lxu5ZVBb/O ly3VrdEFbi5qtNbIY7HiknyeB+RZsw+lSJpC1A9yO7NVpiYxdsctcwWpLCQCSQwxya+O bTkWWhkCQ5/hHyRWBmvDlWVykzMVbC7xSKXsOkpdw4A5G+0Xpkgz3uy7cxq810C8pPwj 8zEA== X-Gm-Message-State: APjAAAUDHKo3xlEWt7sSnptaDlhsAtTe5Awub89tXotbv+2l5qIGFa8h hKtiU5cmTsmV2Km/5lE88IUSFO/4 X-Google-Smtp-Source: APXvYqyLtAoBRvw9u/cy8GtLxybj4QSW89tIUUhEj5DLqVCTKfWYkNeFaL1a8/w6i+Xfw+FZik4AKw== X-Received: by 2002:ad4:5525:: with SMTP id ba5mr22371148qvb.117.1580230133237; Tue, 28 Jan 2020 08:48:53 -0800 (PST) From: Julio Faracco To: libvir-list@redhat.com Subject: [PATCH v2 1/4] lxc: refactor lxcNetworkParseData pointers to use new structures Date: Tue, 28 Jan 2020 13:48:20 -0300 Message-Id: <20200128164822.32047-2-jcfaracco@gmail.com> In-Reply-To: <20200128164822.32047-1-jcfaracco@gmail.com> References: <20200128164822.32047-1-jcfaracco@gmail.com> MIME-Version: 1.0 X-MC-Unique: dxvJBlgmNLaTmFaUmCNc6Q-1 X-MC-Unique: 56nkoXF9NoS6-19Uvb24uw-1 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 00SGn3JP028284 X-loop: libvir-list@redhat.com 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: , 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-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Struct lxcNetworkParseData is being used as a single pointer which iterates through LXC config lines. It means that it will be applied as a network each time that a new type appears. After, the same struct is used to populate a new network interface. This commit changes this logic to multiple lxcNetworkParseData to move this strcuture to an array. It makes more sense if we are using indexes to fill interface settings. This is better to improve code clarity. This commit still introduces *Legacy() functions to keep support of network old style definitions. Signed-off-by: Julio Faracco --- src/lxc/lxc_native.c | 129 +++++++++++++++++++++++-------------------- 1 file changed, 68 insertions(+), 61 deletions(-) diff --git a/src/lxc/lxc_native.c b/src/lxc/lxc_native.c index dd2345c324..b101848c09 100644 --- a/src/lxc/lxc_native.c +++ b/src/lxc/lxc_native.c @@ -411,7 +411,9 @@ lxcCreateHostdevDef(int mode, int type, const char *dat= a) return hostdev; } =20 -typedef struct { +typedef struct _lxcNetworkParseData lxcNetworkParseData; +typedef lxcNetworkParseData *lxcNetworkParseDataPtr; +struct _lxcNetworkParseData { virDomainDefPtr def; char *type; char *link; @@ -424,9 +426,14 @@ typedef struct { size_t nips; char *gateway_ipv4; char *gateway_ipv6; - bool privnet; - size_t networks; -} lxcNetworkParseData; + size_t index; +}; + +typedef struct { + size_t ndata; + lxcNetworkParseDataPtr *parseData; +} lxcNetworkParseDataArray; + =20 static int lxcAddNetworkRouteDefinition(const char *address, @@ -552,39 +559,6 @@ lxcAddNetworkDefinition(lxcNetworkParseData *data) } =20 =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, @@ -633,8 +607,7 @@ lxcNetworkParseDataSuffix(const char *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; @@ -676,12 +649,40 @@ lxcNetworkParseDataSuffix(const char *entry, } =20 =20 +static lxcNetworkParseDataPtr +lxcNetworkGetParseDataByIndexLegacy(lxcNetworkParseDataArray *networks, + const char *entry) +{ + int elem =3D virLXCNetworkConfigEntryTypeFromString(entry); + size_t ndata =3D networks->ndata; + + if (elem =3D=3D VIR_LXC_NETWORK_CONFIG_TYPE) { + /* Index was not found. So, it is time to add new * + * interface and return this last position. */ + if (VIR_EXPAND_N(networks->parseData, networks->ndata, 1) < 0) + return NULL; + + networks->parseData[ndata] =3D g_new0(lxcNetworkParseData, 1); + networks->parseData[ndata]->index =3D networks->ndata; + + return networks->parseData[ndata]; + } + + /* Return last element added like a stack. */ + return networks->parseData[ndata - 1]; +} + + static int -lxcNetworkParseDataEntry(const char *name, - virConfValuePtr value, - lxcNetworkParseData *parseData) +lxcNetworkParseDataEntryLegacy(const char *name, + virConfValuePtr value, + lxcNetworkParseDataArray *networks) { const char *suffix =3D STRSKIP(name, "lxc.network."); + lxcNetworkParseData *parseData; + + if (!(parseData =3D lxcNetworkGetParseDataByIndexLegacy(networks, suff= ix))) + return -1; =20 return lxcNetworkParseDataSuffix(suffix, value, parseData); } @@ -690,10 +691,10 @@ lxcNetworkParseDataEntry(const char *name, static int lxcNetworkWalkCallback(const char *name, virConfValuePtr value, void *data) { - lxcNetworkParseData *parseData =3D data; + lxcNetworkParseDataArray *networks =3D data; =20 if (STRPREFIX(name, "lxc.network.")) - return lxcNetworkParseDataEntry(name, value, parseData); + return lxcNetworkParseDataEntryLegacy(name, value, networks); =20 return 0; } @@ -702,35 +703,41 @@ static int lxcConvertNetworkSettings(virDomainDefPtr def, virConfPtr properties) { int status; - size_t i; - lxcNetworkParseData data =3D {def, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, 0, - NULL, NULL, true, 0}; + bool privnet =3D true; + size_t i, j; + lxcNetworkParseDataArray networks =3D {0, NULL}; + + networks.parseData =3D g_new0(lxcNetworkParseDataPtr, 1); =20 - if (virConfWalk(properties, lxcNetworkWalkCallback, &data) < 0) + if (virConfWalk(properties, lxcNetworkWalkCallback, &networks) < 0) goto error; =20 + for (i =3D 0; i < networks.ndata; i++) { + lxcNetworkParseDataPtr data =3D networks.parseData[i]; + data->def =3D def; =20 - /* Add the last network definition found */ - status =3D lxcAddNetworkDefinition(&data); + status =3D lxcAddNetworkDefinition(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 (networks.ndata =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; } return 0; =20 error: - for (i =3D 0; i < data.nips; i++) - VIR_FREE(data.ips[i]); - VIR_FREE(data.ips); + for (i =3D 0; i < networks.ndata; i++) { + lxcNetworkParseDataPtr data =3D networks.parseData[i]; + for (j =3D 0; j < data->nips; j++) + VIR_FREE(data->ips[j]); + VIR_FREE(data->ips); + } + VIR_FREE(networks.parseData); return -1; } =20 --=20 2.20.1 From nobody Sat May 18 23:23:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1580230161884204.26746255346222; Tue, 28 Jan 2020 08:49:21 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-302-gXeIgpT0MeGfBDs52cLsvA-1; Tue, 28 Jan 2020 11:49:18 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F35E3107ACCD; Tue, 28 Jan 2020 16:49:11 +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 C88831001B23; Tue, 28 Jan 2020 16:49:11 +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 7B41F85797; Tue, 28 Jan 2020 16:49:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00SGn6tT028298 for ; Tue, 28 Jan 2020 11:49:06 -0500 Received: by smtp.corp.redhat.com (Postfix) id 81D7C63A70; Tue, 28 Jan 2020 16:49:06 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7D7AAD1E80 for ; Tue, 28 Jan 2020 16:49:06 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5ED36185B0D2 for ; Tue, 28 Jan 2020 16:49:06 +0000 (UTC) Received: from mail-qt1-f194.google.com (mail-qt1-f194.google.com [209.85.160.194]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-392-b9qgCLd0PHGFXkzxxPqeMw-1; Tue, 28 Jan 2020 11:49:03 -0500 Received: by mail-qt1-f194.google.com with SMTP id c24so10792668qtp.5; Tue, 28 Jan 2020 08:49:03 -0800 (PST) Received: from localhost.localdomain ([2804:431:c7cb:a9a6:59b3:4b4:e00c:2a48]) by smtp.gmail.com with ESMTPSA id n132sm13013505qke.58.2020.01.28.08.49.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jan 2020 08:49:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580230160; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=8j5nitdM4cP9ppuiXkQWPKTRL6r55MrYA+Ey/IHEW9M=; b=ccEW3IzHQMZnxUeP6h8JV1eQedkusc4HfqoAz5Cw8FAfUWlSPNY195JJuXAFdTxiJLucKo GR6kUw3PkkQOfaN4KpPCwYINd3sGuhtKouT4odmbom5kWWomEsbE6rsNi75r5EMhn7op/n Btv4BF9pJFZfHO2qK2VGHGkhXW1HpRo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sJw+q3iP37EtjK2JK50+rML0PlQyFf6l8IZCqXwIBUk=; b=UerQFRckfv0aWND6NV6ZicQ1DjJGslVN/8wOP9DxnPkbxThHTEvPGEs6vKEA8ysXsQ ZsaSlFo6xujQgq3iZFTEOHqVPH6iH8B6pgs2Qs1yl/HQDEmLUATRufy/PmkpwdsjkYKk stcmzJgpCw+VBK1/XWNpPkymXm6v+SvkCVODB7wxR261EkPZz7K/Awc6ZLlKszU9Zitu kHmSEQgo0JDhi++ldtULJxPuTQvzdy1exTFo9ODO6TjhyDqG1DycCrgRuPUtB0Ft1g0Y lkK33UkhW7xa4FTe5s7YcBABDyCWBWxjOG1zPlZBsO+cxwpvo41mRK6jRijIkjXybLpn U1zA== X-Gm-Message-State: APjAAAXSaLVfmW96f7b76ZqtWYWxXQcgb4bMvbdHZfOhMlq5ax+AG1yE XFR/RsayPi1PKvaGQ2VFOUn7oWyf X-Google-Smtp-Source: APXvYqxnAzhuGyvWJnjuQi1MjP6gEFDciT2ivUrlUCBIluy2Lu1xm4Us+MzPig9+SNHGvXNzgHBD2g== X-Received: by 2002:ac8:704:: with SMTP id g4mr22624173qth.197.1580230142325; Tue, 28 Jan 2020 08:49:02 -0800 (PST) From: Julio Faracco To: libvir-list@redhat.com Subject: [PATCH v2 2/4] lxc: add LXC version 3 network parser Date: Tue, 28 Jan 2020 13:48:22 -0300 Message-Id: <20200128164822.32047-3-jcfaracco@gmail.com> In-Reply-To: <20200128164822.32047-1-jcfaracco@gmail.com> References: <20200128164822.32047-1-jcfaracco@gmail.com> MIME-Version: 1.0 X-MC-Unique: b9qgCLd0PHGFXkzxxPqeMw-1 X-MC-Unique: gXeIgpT0MeGfBDs52cLsvA-1 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 00SGn6tT028298 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" LXC version 3 or higher introduced indexes for network interfaces. Libvirt should be able to parse entries like `lxc.net.2.KEY`. This commit adds functions to parse this type of field. That's why array structures are so important this time. Signed-off-by: Julio Faracco --- src/lxc/lxc_native.c | 51 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/src/lxc/lxc_native.c b/src/lxc/lxc_native.c index b101848c09..15be33c9f1 100644 --- a/src/lxc/lxc_native.c +++ b/src/lxc/lxc_native.c @@ -649,6 +649,55 @@ lxcNetworkParseDataSuffix(const char *entry, } =20 =20 +static lxcNetworkParseDataPtr +lxcNetworkGetParseDataByIndex(lxcNetworkParseDataArray *networks, + unsigned int index) +{ + size_t ndata =3D networks->ndata; + size_t i; + + for (i =3D 0; i < ndata; i++) { + if (networks->parseData[i]->index =3D=3D index) + return networks->parseData[i]; + } + + /* Index was not found. So, it is time to add new * + * interface and return this last position. */ + if (VIR_EXPAND_N(networks->parseData, networks->ndata, 1) < 0) + return NULL; + + networks->parseData[ndata] =3D g_new0(lxcNetworkParseData, 1); + networks->parseData[ndata]->index =3D index; + + return networks->parseData[ndata]; +} + + +static int +lxcNetworkParseDataEntry(const char *name, + virConfValuePtr value, + lxcNetworkParseDataArray *networks) +{ + lxcNetworkParseData *parseData; + const char *suffix_tmp =3D STRSKIP(name, "lxc.net."); + char *suffix =3D NULL; + unsigned long long index; + + if (virStrToLong_ull(suffix_tmp, &suffix, 10, &index) < 0) + return -1; + + if (suffix[0] !=3D '.') + return -1; + + suffix++; + + if (!(parseData =3D lxcNetworkGetParseDataByIndex(networks, index))) + return -1; + + return lxcNetworkParseDataSuffix(suffix, value, parseData); +} + + static lxcNetworkParseDataPtr lxcNetworkGetParseDataByIndexLegacy(lxcNetworkParseDataArray *networks, const char *entry) @@ -695,6 +744,8 @@ lxcNetworkWalkCallback(const char *name, virConfValuePt= r value, void *data) =20 if (STRPREFIX(name, "lxc.network.")) return lxcNetworkParseDataEntryLegacy(name, value, networks); + if (STRPREFIX(name, "lxc.net.")) + return lxcNetworkParseDataEntry(name, value, networks); =20 return 0; } --=20 2.20.1 From nobody Sat May 18 23:23:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1580230165537546.1902205077077; Tue, 28 Jan 2020 08:49:25 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-317-awRddtt8MlWSasxv8ex1Kg-1; Tue, 28 Jan 2020 11:49:22 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 03973801E70; Tue, 28 Jan 2020 16:49:16 +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 CF3F78E9E7; Tue, 28 Jan 2020 16:49:15 +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 81CAA877E1; Tue, 28 Jan 2020 16:49:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00SGnCOV028308 for ; Tue, 28 Jan 2020 11:49:12 -0500 Received: by smtp.corp.redhat.com (Postfix) id 978F620230A9; Tue, 28 Jan 2020 16:49:12 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8DE212026D67 for ; Tue, 28 Jan 2020 16:49:10 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1B603185B0D6 for ; Tue, 28 Jan 2020 16:49:10 +0000 (UTC) Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-138-MHLiAaMzPQqSgtZk65NoYw-1; Tue, 28 Jan 2020 11:49:06 -0500 Received: by mail-qk1-f196.google.com with SMTP id h23so14034587qkh.0; Tue, 28 Jan 2020 08:49:06 -0800 (PST) Received: from localhost.localdomain ([2804:431:c7cb:a9a6:59b3:4b4:e00c:2a48]) by smtp.gmail.com with ESMTPSA id n132sm13013505qke.58.2020.01.28.08.49.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jan 2020 08:49:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580230164; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=3/jA1BajsH0T4YGseRJsPcsAM3uOZQvxTsFcy+t4zb8=; b=HdTyWiWYX+YuT7FDvisGFEi9kMhUyrGDvk+lSKMwJ4MsEVX61+LH8KuqgUwwnj8A2jclM/ eCgQLjkvMU+tIxrFr28py9nfmdmP3uoVYbtOFe3FEViGr0NGgt2uPqea+0e+x8M9hDerFQ L19i+Fe3Y56yfwn8bhzOBODwbNQdAVU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OoAMHsTX0SnjUVgelPdoukXqH9ESAiweHOhqg3RHbcU=; b=plx8/2dW7llVUj5A5OZVg9dtx0XG7fxUjvzvRJTZ3KRg5EnlvVpG8mFdTzJq7tC9vh 7uuZICWq/IKH8Jbtf88D+Nq/UrY+ukK0dW+iPcSnuqLZkertOoiUDII9tT077kAPXQID P0twgGZxcdgiBgbYSfPTjZK176GK7SHjCFEtxaVXHQg0PZWO6fXLvxdxX9E7LFMZmdu6 eHVlcV2BY71ghqBMLMTyQA3y5aMYErQdmeto6W7fD+pF77krojIx9qXEB0Jc9hh4kQgz FV22Mts0tFgtpWzGj8qcdCgi3H2bOVR9vklVL0Bb7J/hV6fkXft90d9I9oWBnuvuFCL5 st4w== X-Gm-Message-State: APjAAAX41Y1y4ZWYmzi1IRGRQPir78lt69H++KAM2SXdhTdMKhZrTGp1 GeTstbwT9hJbRafEiqkW13qNPhdU X-Google-Smtp-Source: APXvYqzLzwd2+/JuVex4pjqzffU3dphhYUDl85w4zmiuYy8u3jxRzOYjUhgJ74mFXIehu4ybtMqOAQ== X-Received: by 2002:a05:620a:9:: with SMTP id j9mr8736236qki.397.1580230145382; Tue, 28 Jan 2020 08:49:05 -0800 (PST) From: Julio Faracco To: libvir-list@redhat.com Subject: [PATCH v2 3/4] lxc: remove domain definition from lxc network struct Date: Tue, 28 Jan 2020 13:48:23 -0300 Message-Id: <20200128164822.32047-4-jcfaracco@gmail.com> In-Reply-To: <20200128164822.32047-1-jcfaracco@gmail.com> References: <20200128164822.32047-1-jcfaracco@gmail.com> MIME-Version: 1.0 X-MC-Unique: MHLiAaMzPQqSgtZk65NoYw-1 X-MC-Unique: awRddtt8MlWSasxv8ex1Kg-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 00SGnCOV028308 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Domain definition is useless now inside network structure. This pointer was required because new network definition was being added each time that a new network type appeared. So, this should be processed into old function `lxcNetworkParseDataType()`. Now, as it was moved to an array, it can be handle together each interface pointer. Signed-off-by: Julio Faracco --- src/lxc/lxc_native.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/lxc/lxc_native.c b/src/lxc/lxc_native.c index 15be33c9f1..b90fb6f40d 100644 --- a/src/lxc/lxc_native.c +++ b/src/lxc/lxc_native.c @@ -414,7 +414,6 @@ lxcCreateHostdevDef(int mode, int type, const char *dat= a) typedef struct _lxcNetworkParseData lxcNetworkParseData; typedef lxcNetworkParseData *lxcNetworkParseDataPtr; struct _lxcNetworkParseData { - virDomainDefPtr def; char *type; char *link; char *mac; @@ -470,13 +469,16 @@ lxcAddNetworkRouteDefinition(const char *address, } =20 static int -lxcAddNetworkDefinition(lxcNetworkParseData *data) +lxcAddNetworkDefinition(virDomainDefPtr def, lxcNetworkParseData *data) { virDomainNetDefPtr net =3D NULL; virDomainHostdevDefPtr hostdev =3D NULL; bool isPhys, isVlan =3D false; size_t i; =20 + if (!data) + return -1; + if ((data->type =3D=3D NULL) || STREQ(data->type, "empty") || STREQ(data->type, "") || STREQ(data->type, "none")) return 0; @@ -518,9 +520,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, @@ -542,9 +544,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; @@ -765,9 +767,8 @@ lxcConvertNetworkSettings(virDomainDefPtr def, virConfP= tr properties) =20 for (i =3D 0; i < networks.ndata; i++) { lxcNetworkParseDataPtr data =3D networks.parseData[i]; - data->def =3D def; =20 - status =3D lxcAddNetworkDefinition(data); + status =3D lxcAddNetworkDefinition(def, data); =20 if (status < 0) goto error; --=20 2.20.1 From nobody Sat May 18 23:23:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1580230175406841.8890566418384; Tue, 28 Jan 2020 08:49:35 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-257-BJJUyMVyN5C9sSBjiK9qEg-1; Tue, 28 Jan 2020 11:49:20 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5F8A01882CCD; Tue, 28 Jan 2020 16:49:14 +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 3844986E22; Tue, 28 Jan 2020 16:49: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 E3347870B1; Tue, 28 Jan 2020 16:49:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00SGnC2D028309 for ; Tue, 28 Jan 2020 11:49:12 -0500 Received: by smtp.corp.redhat.com (Postfix) id 98FC52026D67; Tue, 28 Jan 2020 16:49:12 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 93A8E20230A6 for ; Tue, 28 Jan 2020 16:49:11 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EB0A18001FC for ; Tue, 28 Jan 2020 16:49:10 +0000 (UTC) Received: from mail-qv1-f45.google.com (mail-qv1-f45.google.com [209.85.219.45]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-346-735GK0w5MOy1OQH3hdQIrw-1; Tue, 28 Jan 2020 11:49:08 -0500 Received: by mail-qv1-f45.google.com with SMTP id s7so894808qvn.8; Tue, 28 Jan 2020 08:49:08 -0800 (PST) Received: from localhost.localdomain ([2804:431:c7cb:a9a6:59b3:4b4:e00c:2a48]) by smtp.gmail.com with ESMTPSA id n132sm13013505qke.58.2020.01.28.08.49.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jan 2020 08:49:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580230174; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=AN/UgC9kmKxlzyxblYtsHS7G2ihfQf/he/qp538igRU=; b=gkgYxxasDYX9GklZ96OL97IbVWH0kO57jQ+9zFbUFxMK4/9CwtFeKHs4ZZbUai3zBzbJtp gBbtzqXempurnCa0Gjt5Xo2B1mspwDlRCGriTkfMJzwBxspkO52I6XMkyyqspR3fdEBviD xGu1aE8oURiWQU9dXSzyASfInKTq9RY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=by9hNUhL32bTWWeZgUJeiQGjUVOEdfNaYLWN1T7xoho=; b=rbPXMbHL0uC+slGpeW3KXZFBiC8f1yaN8/XUmz8ptkd7kIWvLUmP1lm2Ep6hFz0Wpy Y+mvhEymYRYvN/ifjDcfgyqLj5E0a43eDakxglkK2tU2mOeVBRf7XpxJCt4bnbaYwuwv E9ci5GaN5SsO4B1tEKOJWwWio/Oj9dInnRUAfhzbssnxRV3QiTEAlq/SwCl3Fa0x3gys sK07hkJOlVFZcLPuNXrsypS5LGKvMSjEbdgq52FoMh8S7uuiOJGWe5dCQyGK6O5ZKLjV 2zlD22lGrL5LEsziGiyA6ME58uJX4IK47nAfhNEdqdRJB/V0CIc0zXzK08GY1/HtC247 z22A== X-Gm-Message-State: APjAAAWtRgA5B79JhavCMdMFhK09Q0/82zuXEIbwJxbEcCQvLLFhO9XW S8Tl6KTG3WqnRyY5qoj7lvkzQTMq X-Google-Smtp-Source: APXvYqzD6u24+J5ietx4jPNdh3gZgnbhmX77/FOvxCNkSEuZDA0LL1eiW12mnAye4ui6xHQnDGbWEA== X-Received: by 2002:ad4:4c08:: with SMTP id bz8mr17170537qvb.241.1580230147674; Tue, 28 Jan 2020 08:49:07 -0800 (PST) From: Julio Faracco To: libvir-list@redhat.com Subject: [PATCH v2 4/4] tests: update LXC config dataset to support V3 indexes Date: Tue, 28 Jan 2020 13:48:24 -0300 Message-Id: <20200128164822.32047-5-jcfaracco@gmail.com> In-Reply-To: <20200128164822.32047-1-jcfaracco@gmail.com> References: <20200128164822.32047-1-jcfaracco@gmail.com> MIME-Version: 1.0 X-MC-Unique: 735GK0w5MOy1OQH3hdQIrw-1 X-MC-Unique: BJJUyMVyN5C9sSBjiK9qEg-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 00SGnC2D028309 X-loop: libvir-list@redhat.com 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: , 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-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" LXC version 3 config files are still using network old style definition. So, as LXC supports it now, they can be converted to use this new definition. Signed-off-by: Julio Faracco --- .../lxcconf2xml-ethernet-v3.config | 16 ++++++++-------- .../lxcconf2xml-fstab-v3.config | 10 +++++----- .../lxcconf2xml-macvlannetwork-v3.config | 10 +++++----- .../lxcconf2xml-simple-v3.config | 18 +++++++++--------- 4 files changed, 27 insertions(+), 27 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..79bcfa1bd1 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.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 =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-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 --=20 2.20.1