From nobody Thu May 2 03:43:35 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 1580263009072385.28723011068007; Tue, 28 Jan 2020 17:56: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-60-uwxvIw3-NACO0sUY66VFdw-1; Tue, 28 Jan 2020 20:56: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 0AAF3107ACC5; Wed, 29 Jan 2020 01:56:40 +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 7968D60BFB; Wed, 29 Jan 2020 01:56:39 +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 6990A85953; Wed, 29 Jan 2020 01:56:38 +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 00T1sRvj012453 for ; Tue, 28 Jan 2020 20:54:27 -0500 Received: by smtp.corp.redhat.com (Postfix) id ACC7110BE39D; Wed, 29 Jan 2020 01:54:27 +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 A746410BE362 for ; Wed, 29 Jan 2020 01:54:27 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.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 3173C86D719 for ; Wed, 29 Jan 2020 01:54:27 +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-139-p_4PFHYbOTuKVvO5_Cmw5g-1; Tue, 28 Jan 2020 20:54:25 -0500 Received: by mail-qk1-f195.google.com with SMTP id s187so15493141qke.8; Tue, 28 Jan 2020 17:54:25 -0800 (PST) Received: from localhost.localdomain ([2804:431:c7cb:c3b5:59b3:4b4:e00c:2a48]) by smtp.gmail.com with ESMTPSA id t15sm198798qkg.49.2020.01.28.17.54.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jan 2020 17:54:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580263007; 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=LIJsLzW4qCqnfH6MR5CmdiOJfnnyzeo1u9w95dqmtLZ2y1ZqD/1fqbDLeAEtOfM4BS8bZA Y2hnamF2iCu3LrTZkPB7CmfLIlneXdSgdI1XV9fLl2yw8QXlgSFZV+pJ3iqiorXzIpFX+V Rxu9QS/PeHh6Jo19OVpKmjvp8q1fEnk= 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=EMG+WsXupJ8c0GV71/vmH42pRngx3jEw6cStjuW9FOf3CMKxIZ8Dt+G7q80GuZfYSt gO/l5ijJsJGVP5QtsxaV8HiubuYGqFhBn0hKQQPfCvNdSeVcDMoUByqzHLEjgzwagvEd 9jjieomPXlX4vQ5J7RaP49J3fDqMZPJORn3+jBQvlXhHlxTQrrm4/tj1KPpO9RwqeC30 +xjNwOvJDwsGedYWY523o+O0UehxRU4OOTjO4BUBe8B3hUMHnCOKwSRTVO49kTwJZKch 1A/zPLUct20ExLLP8TnAsCpzx21qG6/vKXvT0jaotmdv3+HJv6CmMKeYDq88/G9DOWdc vDQw== X-Gm-Message-State: APjAAAWWDJvw8sDOp99sg8N6E41saeufZe8R9T9dhjVxKM8rgWjXGfbp OWDUEFlumwNt6EKx68unTymaUyXF X-Google-Smtp-Source: APXvYqwD9alBbtaKxacFEbux/lj4VZkpELRJGKZp7UwQjmr7N9Yc6rAOA0eYIwD0qgQPUPOp+wtIDw== X-Received: by 2002:a37:6684:: with SMTP id a126mr25050154qkc.499.1580262862706; Tue, 28 Jan 2020 17:54:22 -0800 (PST) From: Julio Faracco To: libvir-list@redhat.com Subject: [PATCH v3 1/4] lxc: refactor lxcNetworkParseData pointers to use new structures Date: Tue, 28 Jan 2020 22:54:08 -0300 Message-Id: <20200129015411.11701-2-jcfaracco@gmail.com> In-Reply-To: <20200129015411.11701-1-jcfaracco@gmail.com> References: <20200129015411.11701-1-jcfaracco@gmail.com> MIME-Version: 1.0 X-MC-Unique: p_4PFHYbOTuKVvO5_Cmw5g-1 X-MC-Unique: uwxvIw3-NACO0sUY66VFdw-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 00T1sRvj012453 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" 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 Thu May 2 03:43:35 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-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-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1580263024765218.2945746466803; Tue, 28 Jan 2020 17:57:04 -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-7-q8JUpvBdO4ugaqtaYybdhg-1; Tue, 28 Jan 2020 20:57:01 -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 AA78A107ACC9; Wed, 29 Jan 2020 01:56:55 +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 8181C7C42C; Wed, 29 Jan 2020 01:56:55 +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 0D00F18089C8; Wed, 29 Jan 2020 01:56:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00T1uc2w012652 for ; Tue, 28 Jan 2020 20:56:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0229180894; Wed, 29 Jan 2020 01:56:38 +0000 (UTC) Received: from mimecast-mx01.redhat.com (mimecast01.extmail.prod.ext.phx2.redhat.com [10.5.110.50]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F01787C42C for ; Wed, 29 Jan 2020 01:56:35 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 57AC11005510 for ; Wed, 29 Jan 2020 01:56:35 +0000 (UTC) Received: from mail-qv1-f68.google.com (mail-qv1-f68.google.com [209.85.219.68]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-169-CRjdRKpgP8WSzBdfmbkcrQ-1; Tue, 28 Jan 2020 20:54:25 -0500 Received: by mail-qv1-f68.google.com with SMTP id n8so7264489qvg.11; Tue, 28 Jan 2020 17:54:25 -0800 (PST) Received: from localhost.localdomain ([2804:431:c7cb:c3b5:59b3:4b4:e00c:2a48]) by smtp.gmail.com with ESMTPSA id t15sm198798qkg.49.2020.01.28.17.54.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jan 2020 17:54:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580263023; 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=O1M8k+gbmSLWvCHXvzcmGhW9LqkgBrfykI0wV09IrNI=; b=NpXdHgkrpqiG9d0F7ZY1X+m9ZSqIiJZFwMedAwshp0VcEzB83cx5BHM0ZPWgto+tiwlYzA daU/fnE7qIqwnfjypxrDu3NvYteTfycMpSNvccd9zB2k9KOr+GVLNGkvIXR3EesiAGsmEU 5cufa5TNkiIYWGHm3JSyWCDETwp0bc4= 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=BrlWnwIpbFQngLUylsZYyiJ4B5UdaQNHWCY2R1gAjwg=; b=ooWg5nVaW1By8ehBDHJyK4VHtWqY0VS6c4GuVA6LYXFhMe3G0jbElGMzaJ2v94qcS3 zp525v+2H+8JwvR7zpE/MDqD8cVCb2vOwcUi/WXCFGQfLkwYhHrd0zzISlMZWxzU4JbH uqVsoIF/ugHnkhzegKskjZTRinE8HfM0V9/4W+LyQcyzbTDaE3RJdPSogeKhQTp7lInn K3Pr4ctCWgah+HpMsUkID5yAgHdAThVwdKI4N45kZhnB1fO02WcFeec3N67XRlE9JX8Z QsKotaZRgMJuANXtsX75FPYzsnxKsFmWP+ogkh/c2saNQxZR1jlM8E5AKRiaK/mPE8N/ MNww== X-Gm-Message-State: APjAAAWYmQ802/CalbxIfjkt0i6q+UFnfBDBNQG4n36O93kIrDiC41V0 ifAZuNSbXJ+B3gLtscUM6cGfC5Z0 X-Google-Smtp-Source: APXvYqz95fHiPSOEhdpHQBVhPDm7pXU9M/JlK7eEiIm6H6vwAnwzC3eVdltogDAvPCrZpIjjWKn96w== X-Received: by 2002:ad4:4434:: with SMTP id e20mr25819457qvt.157.1580262864602; Tue, 28 Jan 2020 17:54:24 -0800 (PST) From: Julio Faracco To: libvir-list@redhat.com Subject: [PATCH v3 2/4] lxc: add LXC version 3 network parser Date: Tue, 28 Jan 2020 22:54:09 -0300 Message-Id: <20200129015411.11701-3-jcfaracco@gmail.com> In-Reply-To: <20200129015411.11701-1-jcfaracco@gmail.com> References: <20200129015411.11701-1-jcfaracco@gmail.com> MIME-Version: 1.0 X-MC-Unique: CRjdRKpgP8WSzBdfmbkcrQ-1 X-MC-Unique: q8JUpvBdO4ugaqtaYybdhg-1 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 00T1uc2w012652 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 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..35ac05f702 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."); + g_autofree 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 Thu May 2 03:43:35 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 1580263036550540.7681650022488; Tue, 28 Jan 2020 17:57:16 -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-226-B1hk136_OvO5N5sbuxKE5w-1; Tue, 28 Jan 2020 20:57:05 -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 E4BEA1005513; Wed, 29 Jan 2020 01:56:59 +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 B8C018E9EA; Wed, 29 Jan 2020 01:56:59 +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 6294285974; Wed, 29 Jan 2020 01:56:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00T1uexN012665 for ; Tue, 28 Jan 2020 20:56:40 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8E71E5C219; Wed, 29 Jan 2020 01:56:40 +0000 (UTC) Received: from mimecast-mx01.redhat.com (mimecast03.extmail.prod.ext.phx2.redhat.com [10.5.110.60]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 88D1F5C545 for ; Wed, 29 Jan 2020 01:56:37 +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-mx01.redhat.com (Postfix) with ESMTPS id 6E6771800D41 for ; Wed, 29 Jan 2020 01:56:37 +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-164-gHMUCXI7NIiUpfPgCqBjLQ-1; Tue, 28 Jan 2020 20:54:27 -0500 Received: by mail-qt1-f196.google.com with SMTP id c24so12052131qtp.5; Tue, 28 Jan 2020 17:54:27 -0800 (PST) Received: from localhost.localdomain ([2804:431:c7cb:c3b5:59b3:4b4:e00c:2a48]) by smtp.gmail.com with ESMTPSA id t15sm198798qkg.49.2020.01.28.17.54.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jan 2020 17:54:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580263035; 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=Gz1UkyWhUedHtKJdd5tIWBJ6f2oh2En1Shl94xHorBc=; b=NCRsjbkihtaGYv+JDcFquM66YOkYhY9gOz6dGPn5yAiPxFjbdOGyO5Ta8wiTm4sR76zAoa n+8w3G+5gNQUGyy7U2kOJ/vraosMbBWHhUDZjgjhAYcKR/en+E25ECR+SBW97pHfSrcd+M sdRHELJu6IHKhwhDtNnOlMj0Wu3waAI= 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=QqFIS1uGX5BjNP73r+9FJTxtZbhDDXfobmFcj9N4C2k=; b=gJOYlLtU7xMilaH6KL23TrkaFa+1xlwqQLnOd8WJTLZVH/P3jcY4Jj2ZMUv1bJjIho dD6luDFUbwejtyN+5hpyNBeMl1EHrQc/f8qdRgSZlzgsmM17huCBmUySMfsBVihFP8tf XuO06nb5a+B+GL/N671NVk599ryJw5np5k4J+zXQ/T118dQuTVFKHR2fvJssHvc7Nhm/ Gnn3OEykYZkotf7azU1hSKFi6JNdrES7NvU8MFbll+8I6DgVZbZwDfudCh4lBRIK3x++ 26rEXNn4E09uDawQPBR5kex1d2hPKnU3ZwBGQbmo69bLJU/ZffE0njK43jfuW3kL/iNq PtPw== X-Gm-Message-State: APjAAAUeL5hQy/b1eR54/Ta8MPSQAoW5flyVfO3KA7at6VlviAs+EuHw OYL6RZtX7u2LZ5TjawwvpQATuxkX X-Google-Smtp-Source: APXvYqy1bvDySEP/2wxDcvxXrdcKlzYeWC9kxNUHXe5CaWZkfBez69gQce//h9fHP8WAnWG5GEl1Ig== X-Received: by 2002:ac8:1ac1:: with SMTP id h1mr24437694qtk.255.1580262866341; Tue, 28 Jan 2020 17:54:26 -0800 (PST) From: Julio Faracco To: libvir-list@redhat.com Subject: [PATCH v3 3/4] lxc: remove domain definition from lxc network struct Date: Tue, 28 Jan 2020 22:54:10 -0300 Message-Id: <20200129015411.11701-4-jcfaracco@gmail.com> In-Reply-To: <20200129015411.11701-1-jcfaracco@gmail.com> References: <20200129015411.11701-1-jcfaracco@gmail.com> MIME-Version: 1.0 X-MC-Unique: gHMUCXI7NIiUpfPgCqBjLQ-1 X-MC-Unique: B1hk136_OvO5N5sbuxKE5w-1 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 00T1uexN012665 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 35ac05f702..16dd0c1f5c 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 Thu May 2 03:43:35 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 1580263009969940.592064278148; Tue, 28 Jan 2020 17:56: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-207-6L81vs9yNFKy7kPCKY_gpA-1; Tue, 28 Jan 2020 20:56:44 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id A636B1882CCD; Wed, 29 Jan 2020 01:56:38 +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 465E183865; Wed, 29 Jan 2020 01:56:37 +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 00D6E85799; Wed, 29 Jan 2020 01:56:25 +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 00T1sVYg012484 for ; Tue, 28 Jan 2020 20:54:31 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8B8A410BE369; Wed, 29 Jan 2020 01:54:31 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8439110BE362 for ; Wed, 29 Jan 2020 01:54:31 +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 68BCF802881 for ; Wed, 29 Jan 2020 01:54:31 +0000 (UTC) Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.48]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-156-P4wPx7z5N8OtuE_n3WRlNw-1; Tue, 28 Jan 2020 20:54:29 -0500 Received: by mail-qv1-f48.google.com with SMTP id s7so1616174qvn.8; Tue, 28 Jan 2020 17:54:29 -0800 (PST) Received: from localhost.localdomain ([2804:431:c7cb:c3b5:59b3:4b4:e00c:2a48]) by smtp.gmail.com with ESMTPSA id t15sm198798qkg.49.2020.01.28.17.54.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jan 2020 17:54:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580263007; 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=Gq+pvCOc/wxRIyliWJPbQpWpF5MesFUaL1LhxstNjEkYgxXRvdg+h1cA0V1Bb+KLP84XKv qR2XRH0BF+PUbLgi90CcJAfBECKow8mRozjeu/s3QdhN//7kqvC2yktjGkXcXmaXdBN1kE yxeZuenYwsbitjYNRvuFIk5Q72ghArc= 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=TSsG4CKRlJSEeDUlRaMc4louIwgRxZUdZ5qNoaWsEgVH4yw6J3a1uV0q5HU6TxwtIL Rfwx7k4H3PPwMX6j0pvtwOp9fPP6TPlxM+fyD/Vibercq95VTucm6c5GaDdZaaDmUczq imeIVhJN4JXQ5vTuHJLPsEITZhLmPoIgfeBNhGqVIX1rJwRKdaCkirgDTxXCr7O/NXi+ p35nh339LHlrv4Eq5XWc/yws2ggLj6vCcrZRTLuqRIhmnJbTezJodAaGCALUjFlGKgDn tb5xcn829cCLaMSakc3b/GN3/jcdGYQHXE+UFOfvz9ZSNb8ks63Mt5UKb8y/IZ2oH6uE EiIg== X-Gm-Message-State: APjAAAXhoL0wRIuODr4GUcBppiMfxb3TcNkhtO/OR1hMKsnfGypjpma2 m2F3sXo0ANutBf9dBzd8DrcuIlCI X-Google-Smtp-Source: APXvYqzs0j9LHL7wXAyxbf2jWDpml3RLD8xjcUwbbY7kVP0CnqgZonOsjCM85i2xMnkDGuCZUTHCZw== X-Received: by 2002:a0c:cc8e:: with SMTP id f14mr19176080qvl.119.1580262868183; Tue, 28 Jan 2020 17:54:28 -0800 (PST) From: Julio Faracco To: libvir-list@redhat.com Subject: [PATCH v3 4/4] tests: update LXC config dataset to support V3 indexes Date: Tue, 28 Jan 2020 22:54:11 -0300 Message-Id: <20200129015411.11701-5-jcfaracco@gmail.com> In-Reply-To: <20200129015411.11701-1-jcfaracco@gmail.com> References: <20200129015411.11701-1-jcfaracco@gmail.com> MIME-Version: 1.0 X-MC-Unique: P4wPx7z5N8OtuE_n3WRlNw-1 X-MC-Unique: 6L81vs9yNFKy7kPCKY_gpA-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 00T1sVYg012484 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.11 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