From nobody Mon May 6 15:51:55 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-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1580135201376395.60027395242014; Mon, 27 Jan 2020 06:26:41 -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-347-bs3HXsQeMfm4X-pdxJcuHg-1; Mon, 27 Jan 2020 09:26:38 -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 3684818CA241; Mon, 27 Jan 2020 14:26:30 +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 AD7D08E9E7; Mon, 27 Jan 2020 14:26:29 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 4C80D8577B; Mon, 27 Jan 2020 14:26:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00REQRwK032484 for ; Mon, 27 Jan 2020 09:26:27 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5A2A310E60F4; Mon, 27 Jan 2020 14:26:27 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 54F1410E60F2 for ; Mon, 27 Jan 2020 14:26:25 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (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 4C72110197EF for ; Mon, 27 Jan 2020 14:26:25 +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-257-x-BvmQbjMbuCb9LI4SA49w-1; Mon, 27 Jan 2020 09:26:19 -0500 Received: by mail-qk1-f196.google.com with SMTP id q15so9725394qke.9 for ; Mon, 27 Jan 2020 06:26:19 -0800 (PST) Received: from localhost.localdomain ([179.98.106.224]) by smtp.gmail.com with ESMTPSA id r37sm10039334qtj.44.2020.01.27.06.26.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2020 06:26:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580135200; 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=W6X1J078D9raM9w1l7XFbgcYDRljtZL5ZK1tfxmDze4=; b=inHk1xPBDZxU+E0n2J3/Ue6dCEUQHkI6LXn+yxqLzUP+un6Vl1EVGMq3vZ/qruxVPA8eA+ 8ORDHJHQpHKntHYkgObE+8LTWcA54Ufel/dCCJOgctvSnrpaNkuJ0Ufbtk8j7lS1Ala60N YPvB04W9Vrr4CBeoOsIGG0GeC8TTovo= 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=J+jP5WpPyfoUqdmFRK4ZUswp7h/NaoPR281TQn/z+Hc=; b=nBVhLaD2Gh3wKTxDkQXOclw9u/ooS5d0okaBgQBiK1mUs6ArKcH6oXstDcW9m7tamI Q0dSZGtEUb9iyAJZpSPGpyyCZeEGu2NQ/19t9KStH4I14isXpxAEyRlt8KewyIIgDOt8 NhMVt6iLaV3+u8TV22rAapS6PGo9AF+3ir1ypaYsAzWyU4GUSXQb+piw6jOAuYd5YtoD 9ua/dlkFwZzexD0dgvwLsxc9XDHuvhZrQBYU+S5C4aNOSN/WMbfeqXFDe5tvErs7/crt S1f5P40s1UvUBYqDY0lJofRDK7Yb3u7gaaQW5e869pQ/hjFOkr7G2qaRPo5Na20Jadfg 7iyg== X-Gm-Message-State: APjAAAUvFra6B5+MWxa4Oe2Uhz96YiK0HcCmmlgf+dEkflaMgPyz21tv kZOxyo/AmJ78kSlXjdtaYsM1bSYe X-Google-Smtp-Source: APXvYqy8NSFo0a62F3obVhZD6bUfrlJI5oSPcPptO1Xhp4vMZcEH8GZeZxrJtu5Krh5770vJ2W2zyw== X-Received: by 2002:a37:27cc:: with SMTP id n195mr15230560qkn.428.1580135178893; Mon, 27 Jan 2020 06:26:18 -0800 (PST) From: Julio Faracco To: libvir-list@redhat.com Subject: [PATCH 1/4] lxc: refactor lxcNetworkParseData pointers to use new structures Date: Mon, 27 Jan 2020 11:25:45 -0300 Message-Id: <20200127142547.6677-2-jcfaracco@gmail.com> In-Reply-To: <20200127142547.6677-1-jcfaracco@gmail.com> References: <20200127142547.6677-1-jcfaracco@gmail.com> MIME-Version: 1.0 X-MC-Unique: x-BvmQbjMbuCb9LI4SA49w-1 X-MC-Unique: bs3HXsQeMfm4X-pdxJcuHg-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 00REQRwK032484 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" 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 Reviewed-by: Daniel P. Berrang=C3=A9 --- 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..1102928705 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 Mon May 6 15:51:55 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-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1580135209188684.2232618515794; Mon, 27 Jan 2020 06:26:49 -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-295-kb2wRuqfMLKAZqmzPSm-qQ-1; Mon, 27 Jan 2020 09:26:45 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id DFDF4140D; Mon, 27 Jan 2020 14:26:38 +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 94B0260C18; Mon, 27 Jan 2020 14:26:38 +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 3C7CF18089C8; Mon, 27 Jan 2020 14:26:38 +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 00REQas9032506 for ; Mon, 27 Jan 2020 09:26:36 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2BF022026D67; Mon, 27 Jan 2020 14:26:36 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 272E820230A6 for ; Mon, 27 Jan 2020 14:26:34 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (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 0C0BE801572 for ; Mon, 27 Jan 2020 14:26:34 +0000 (UTC) Received: from mail-qk1-f195.google.com (mail-qk1-f195.google.com [209.85.222.195]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-241-NwaMlQs0Pnuc2QhdspufyA-1; Mon, 27 Jan 2020 09:26:29 -0500 Received: by mail-qk1-f195.google.com with SMTP id 21so9751904qky.4 for ; Mon, 27 Jan 2020 06:26:29 -0800 (PST) Received: from localhost.localdomain ([179.98.106.224]) by smtp.gmail.com with ESMTPSA id r37sm10039334qtj.44.2020.01.27.06.26.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2020 06:26:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580135208; 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=mzjn5QcljXtuUfAiDLRHMrKpWWaVAhGIN1S2ArY2lk4=; b=jAPqgSVjngnm6i9Tl1D+pCvRO8B8r8kCp9XqIwt/a3G5Sb+jbim7d6uTbf+bRo2czBJbip ZPnbegrswN8I5lznav3sADSz5V2vA6xaFf3NpoC0AD4VzOZED6W2ln18Ps8+WGDZ52N09H CHbfGHtt1HRGgK/WDm7CBRHiJvuVyjs= 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=rY7IVtg74JmkaSWhGZlfH5dkDOJqdmn048QwPGvZGb0=; b=ea6Gk7NIlENIrl+wFSUAXBIhk6ENngQemEyYognIXTY3Lu0MliI75F9e3H6sk9Rae7 Apaj+DoF/eV6IMxgTENtjh0UOU8SJ78pRYEqPU1Xa5sETiRdU6QZqowq03s532eo5HMv g9HVHzJ4w+3UN2tYm3uMQg2kNWfXQJCnM1d5MSqK/IP8EQ3leEPc0Jyl/kxI1opReoUY OpsMmpbihp7jQyaJMNVUZjt4p2bMTVh3KgZF3V9usn+ZuHyXFk1OTUWyhGc3bOdA2HQE 8eScpTkDMqRR/tZ1xZ/3DgLgsTfeJF4symfd4KiH87+vQu3uuoOt6nhLPSu4JJKsAnJQ eXLA== X-Gm-Message-State: APjAAAXlUcvwc8C978SDbkXN63Yuy81gCdpr8z+bEmzlMUbI4/+jGqLx Bth4O2FoXUbdkt89wo0pSiNP70Xx X-Google-Smtp-Source: APXvYqyFXlHebu7o9OZ1Sohbb0c0rP6wEW3d/+bFBlNPOMYQRX3pBQp1B7Hyj0SZDVdGhVDkHpmnrw== X-Received: by 2002:a05:620a:1269:: with SMTP id b9mr16782629qkl.312.1580135188498; Mon, 27 Jan 2020 06:26:28 -0800 (PST) From: Julio Faracco To: libvir-list@redhat.com Subject: [PATCH 2/4] lxc: add LXC version 3 network parser Date: Mon, 27 Jan 2020 11:25:47 -0300 Message-Id: <20200127142547.6677-3-jcfaracco@gmail.com> In-Reply-To: <20200127142547.6677-1-jcfaracco@gmail.com> References: <20200127142547.6677-1-jcfaracco@gmail.com> MIME-Version: 1.0 X-MC-Unique: NwaMlQs0Pnuc2QhdspufyA-1 X-MC-Unique: kb2wRuqfMLKAZqmzPSm-qQ-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 00REQas9032506 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.12 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 | 45 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/lxc/lxc_native.c b/src/lxc/lxc_native.c index 1102928705..ae8d3cb85d 100644 --- a/src/lxc/lxc_native.c +++ b/src/lxc/lxc_native.c @@ -649,6 +649,49 @@ 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 =3D STRSKIP(name, "lxc.net."); + size_t index; + + suffix =3D strchr(suffix, '.') + 1; + sscanf(name, "lxc.net.%zu", &index); + + if (!(parseData =3D lxcNetworkGetParseDataByIndex(networks, index))) + return -1; + + return lxcNetworkParseDataSuffix(suffix, value, parseData); +} + + static lxcNetworkParseDataPtr lxcNetworkGetParseDataByIndexLegacy(lxcNetworkParseDataArray *networks, const char *entry) @@ -695,6 +738,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 Mon May 6 15:51:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.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 205.139.110.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 [205.139.110.120]) by mx.zohomail.com with SMTPS id 1580135209214969.0762670761812; Mon, 27 Jan 2020 06:26:49 -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-310-luBYsrk5OPaWal_tKjLxbQ-1; Mon, 27 Jan 2020 09:26:45 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id C216A8017CC; Mon, 27 Jan 2020 14:26:40 +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 8CA8860BFB; Mon, 27 Jan 2020 14:26:40 +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 3941E18089CF; Mon, 27 Jan 2020 14:26:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00REQc84032512 for ; Mon, 27 Jan 2020 09:26:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6D8B92166B29; Mon, 27 Jan 2020 14:26:38 +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 692D72166B2B for ; Mon, 27 Jan 2020 14:26:36 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (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 1BA4E185AB72 for ; Mon, 27 Jan 2020 14:26:36 +0000 (UTC) Received: from mail-qt1-f196.google.com (mail-qt1-f196.google.com [209.85.160.196]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-16-fUDsWGkjO4G_6TacMhVdKQ-1; Mon, 27 Jan 2020 09:26:33 -0500 Received: by mail-qt1-f196.google.com with SMTP id e5so7469587qtm.6 for ; Mon, 27 Jan 2020 06:26:33 -0800 (PST) Received: from localhost.localdomain ([179.98.106.224]) by smtp.gmail.com with ESMTPSA id r37sm10039334qtj.44.2020.01.27.06.26.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2020 06:26:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580135208; 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=yKeWmzLdleYbLzFKlFewiBqsWe5XNT8+qQpWqDQmSA4=; b=LGHDQH3eX1DGEhZbL563ccHxY1jsF4yWT6I0/10w7FFRN8JTkseI/X7olC4xrWc0JgHUPw OJXL1i+U8R8XZhXjftVhaCCd5CoXFWNu/49IEFbse1jRV3ZScR/5jVnsOPfVqGggxYiUxv PU2CZkx0BrQnbWmLeszEqVIrI7Bm+uk= 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=GRvRaUoKQ2K+Hndm84XQLPSvjI1uy4VCdpMJD66kyOM=; b=KXjIQDCI42Gb6xSK5tZqvjRz20BvOIstEQ++L68FVEgtxTBUITWvO04xQyc9afS9dH iLy5qe9coISkZdIJ5Q2JXTKSKzhYtMfIpJe4xoeXM3UrGmBk76Nr9REWcUbenBups17a qKt/mLVv+xFfdmE2JqKoDuzVAeIZ0dLbPC2MN0oGbPRczGepwv1IAWuQKP7Ob5qzys1N ths0Qx4xkEXCB9bqXxHK3I74X+77GZ5OQcWiKexiB+mDJbgFEAgP5j0GUuGzIGV8whjD NzQZGDtRr6KRWyXYGQnHZ8fOZ1I6eGiSogFEkeUh22QQyJa8Ocm/40kuByfe3qRst661 n5wg== X-Gm-Message-State: APjAAAV5+/ZJluuGAOFOOHpAodvTxp0F73xD9wsy74IKzBC4MAYDZrKN IUcLq3uT2zfFIRjb9vQx5yLEDVhE X-Google-Smtp-Source: APXvYqyoAgHCulI5dbRz3NqdN3uKdNLAaDnddM9yA7v0+J0O3yITCTR3AT9Okjq+4hbL/L7k93ZFww== X-Received: by 2002:aed:2150:: with SMTP id 74mr15783918qtc.323.1580135192263; Mon, 27 Jan 2020 06:26:32 -0800 (PST) From: Julio Faracco To: libvir-list@redhat.com Subject: [PATCH 3/4] lxc: remove domain definition from lxc network struct Date: Mon, 27 Jan 2020 11:25:48 -0300 Message-Id: <20200127142547.6677-4-jcfaracco@gmail.com> In-Reply-To: <20200127142547.6677-1-jcfaracco@gmail.com> References: <20200127142547.6677-1-jcfaracco@gmail.com> MIME-Version: 1.0 X-MC-Unique: fUDsWGkjO4G_6TacMhVdKQ-1 X-MC-Unique: luBYsrk5OPaWal_tKjLxbQ-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 00REQc84032512 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.12 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 Reviewed-by: Daniel P. Berrang=C3=A9 --- 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 ae8d3cb85d..4af1b62817 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; @@ -759,9 +761,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 Mon May 6 15:51:55 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 1580135276076482.16876207153337; Mon, 27 Jan 2020 06:27:56 -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-97-Et4DYlxePXiLsEs6CcGmdA-1; Mon, 27 Jan 2020 09:26:47 -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 01CF0802572; Mon, 27 Jan 2020 14:26:41 +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 C8BF11001DDE; Mon, 27 Jan 2020 14:26:40 +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 6FEE485786; Mon, 27 Jan 2020 14:26:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00REQcFo032517 for ; Mon, 27 Jan 2020 09:26:39 -0500 Received: by smtp.corp.redhat.com (Postfix) id DCCF410EE6D7; Mon, 27 Jan 2020 14:26:38 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D7FA610EE6CD for ; Mon, 27 Jan 2020 14:26:38 +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 BE70E85A32E for ; Mon, 27 Jan 2020 14:26:38 +0000 (UTC) Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com [209.85.160.169]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-302-n7i0x1e4O-qHfX9_ptZJOQ-1; Mon, 27 Jan 2020 09:26:36 -0500 Received: by mail-qt1-f169.google.com with SMTP id l19so1901466qtq.8 for ; Mon, 27 Jan 2020 06:26:36 -0800 (PST) Received: from localhost.localdomain ([179.98.106.224]) by smtp.gmail.com with ESMTPSA id r37sm10039334qtj.44.2020.01.27.06.26.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2020 06:26:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580135275; 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=ClTcTv3nG8ZqH1ZcjSLbV2ZOkviLtcmfbhIaXbtBqBCsNm+GokWJBmxMzB9iqBOGkKGF+0 hi6FLU/3ZcRjT5t7Jo0er1f9YqjR1dyhXJgHKql7xLYcCkLzQU8hf8PDcxZByeOgYOsP4z uR/wmaJjO0s0M8+TtRRRO26QYVJaUwc= 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=by9hNUhL32bTWWeZgUJeiQGjUVOEdfNaYLWN1T7xoho=; b=a+zjJ/sm6RbDvsZrJVqKeObX6SuAuBlDk7CFa1YeFQPADAJj2qEuVzm837Sti7FzA9 UKYt1tZ9zNDxoVz396P6PzLnFH0hZhOaHm+4g7vcm4zGCp4jUfcBZuQ4jYScEXKFGoTw LK3X9tIwK6dTjWJL0Tho37R1Qgdv/044n1QqS7k6wolknedtBNx4lyjUF1FIqDrFUIka Og1oN5csG9nR8M6LGIW+jWQz96K52N8PUVCX5k3FoJOfS2FMWea+Ba7RQBTA10/amglQ j7YGG+xgyxGx86azEGf/L3CBGSQm3/dXas9YdVBUp6CXljjdjhlpIEA4y69fVYHajDLn K7JA== X-Gm-Message-State: APjAAAUq6D8iufnwn+29ERuUo3xuXsKUfbOdNDIuWKR4tqIYF1lHSoYt iNS1YCOvYQM1VvjE4WQttwc38KeG X-Google-Smtp-Source: APXvYqwWWhP0H1p3BoXrBrNmmH02bsPCmzR/KSOX6Xnur+9382/4aM2PQt10Lk0vonh2D0e8zeGGjA== X-Received: by 2002:ac8:4410:: with SMTP id j16mr11375470qtn.261.1580135195481; Mon, 27 Jan 2020 06:26:35 -0800 (PST) From: Julio Faracco To: libvir-list@redhat.com Subject: [PATCH 4/4] tests: update LXC config dataset to support V3 indexes Date: Mon, 27 Jan 2020 11:25:49 -0300 Message-Id: <20200127142547.6677-5-jcfaracco@gmail.com> In-Reply-To: <20200127142547.6677-1-jcfaracco@gmail.com> References: <20200127142547.6677-1-jcfaracco@gmail.com> MIME-Version: 1.0 X-MC-Unique: n7i0x1e4O-qHfX9_ptZJOQ-1 X-MC-Unique: Et4DYlxePXiLsEs6CcGmdA-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 00REQcFo032517 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 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 Reviewed-by: Daniel P. Berrang=C3=A9 --- .../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