From nobody Mon Feb 9 08:55:01 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1551743789971443.4947633703547; Mon, 4 Mar 2019 15:56:29 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EA25787627; Mon, 4 Mar 2019 23:56:27 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BC28558B0; Mon, 4 Mar 2019 23:56:27 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7696541F3D; Mon, 4 Mar 2019 23:56:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x24NsGWT002651 for ; Mon, 4 Mar 2019 18:54:17 -0500 Received: by smtp.corp.redhat.com (Postfix) id EEE095D71A; Mon, 4 Mar 2019 23:54:16 +0000 (UTC) Received: from mx1.redhat.com (ext-mx15.extmail.prod.ext.phx2.redhat.com [10.5.110.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E311D5D6B3 for ; Mon, 4 Mar 2019 23:54:14 +0000 (UTC) Received: from mail-qt1-f196.google.com (mail-qt1-f196.google.com [209.85.160.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DE44030832DC for ; Mon, 4 Mar 2019 23:54:13 +0000 (UTC) Received: by mail-qt1-f196.google.com with SMTP id p48so7180097qtk.2 for ; Mon, 04 Mar 2019 15:54:13 -0800 (PST) Received: from localhost.localdomain ([177.188.104.249]) by smtp.gmail.com with ESMTPSA id d32sm4670568qtc.88.2019.03.04.15.54.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Mar 2019 15:54:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=EJ/Gug8zWUdbCeQUxA5EroJueMn5sDITJYDUzmpwWyg=; b=q8b3YipU385X5UF7kv3aH6M7noxEFHx7UqLMzhgBkdxTV/Yui9T0PQrnWLBbDfydzT mtPUqxJnIERrlJXsNfn6Q8r8dm4ldBpEvd6Wwe09WjEHa5Ikm5PhCDZky8EVqwBDxFjA rEs3Z05fXHxGUXaNiYmkriPK3Zwg7/EKLw3JB5ij/4XDvk5Y47xiZB7G63nlQ+9ty3mk GmmuzpU1jPJy48TExXXc81Yq9KSU9z9Z7XH9zoevlfYDEHOQHkcFI0V/15Azwsmn09gO j2w0FPH6RnHrEHr872cIahA1i8pbdgHOjlKDn4YTe2u3lMJ2+cI9KUHODCKkLfZjFO8c rvFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EJ/Gug8zWUdbCeQUxA5EroJueMn5sDITJYDUzmpwWyg=; b=rCbplvroaYdk64QChngxb0FyxHZF9bznEUhtqd3n49Cu0uPKzcL3kRWq0NbZnY9L92 ff8Gi6pLvXaR3kMnDPeTqONCKeNvpJzpq8CIwUytqIUA0qp7cXXiUpe59L460MHQrqUn HUOpPZ+d5mcr54TumH3SJ6YzkPDjoeMaiwYoJIdJ9D0c6MeouTRIU1sUzTw/SeNur6qR W3aco0Y6GRpdL6iY/uXoXZr0XkKCgTn3wpeC8Wjg6t4OpN212UZS/JS5PGwq0iczcgcX 1r3GxrAaybAL5cJdMC+U4s1ZVprzxzB3Jc7cGPbdIfyOAJyo33gIi7K3I+11aTz5LM+b r70w== X-Gm-Message-State: APjAAAXPwmmMSbzRaPG0iqSb+ViwKEyDWT9atugsrSC/NrpsZJ116O6H 9YS4+ivkW5oeOCrwHKSTrxe/Rpcn X-Google-Smtp-Source: APXvYqywSc1BNNdjDhGm/TkfOgmWbO3rIiolyyDdPcuXS/e06IPXLvH5hJ0fugxRZL0GHf8rKeBBgg== X-Received: by 2002:a0c:963d:: with SMTP id 58mr16390158qvx.25.1551743652672; Mon, 04 Mar 2019 15:54:12 -0800 (PST) From: Julio Faracco To: libvir-list@redhat.com Date: Mon, 4 Mar 2019 20:53:59 -0300 Message-Id: <20190304235404.16320-2-jcfaracco@gmail.com> In-Reply-To: <20190304235404.16320-1-jcfaracco@gmail.com> References: <20190304235404.16320-1-jcfaracco@gmail.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Mon, 04 Mar 2019 23:54:14 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Mon, 04 Mar 2019 23:54:14 +0000 (UTC) for IP:'209.85.160.196' DOMAIN:'mail-qt1-f196.google.com' HELO:'mail-qt1-f196.google.com' FROM:'jcfaracco@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.13 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS) 209.85.160.196 mail-qt1-f196.google.com 209.85.160.196 mail-qt1-f196.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.44 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/6] lxc: Rebase lxcNetworkParseData struct to support indexes. X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 04 Mar 2019 23:56:28 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The current logic of lxcNetworkParseData uses one single structure to record data over the network definitions inside config files. The logic consider the entry 'type' as a new network definition, every time that algorithm find this tag. This new structure was designed to consider network definitions as an array of network structures. Signed-off-by: Julio Faracco --- src/lxc/lxc_native.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/lxc/lxc_native.c b/src/lxc/lxc_native.c index 2fd349ac1d..bf82cd1e98 100644 --- a/src/lxc/lxc_native.c +++ b/src/lxc/lxc_native.c @@ -423,8 +423,9 @@ lxcCreateHostdevDef(int mode, int type, const char *dat= a) return hostdev; } =20 -typedef struct { - virDomainDefPtr def; +typedef struct _lxcNetworkParseData lxcNetworkParseData; +typedef lxcNetworkParseData *lxcNetworkParseDataPtr; +struct _lxcNetworkParseData { char *type; char *link; char *mac; @@ -436,9 +437,14 @@ typedef struct { size_t nips; char *gateway_ipv4; char *gateway_ipv6; - bool privnet; - size_t networks; -} lxcNetworkParseData; + size_t index; +}; + +typedef struct { + lxcNetworkParseDataPtr *data; + size_t nnetworks; +} lxcNetworkParseArray; + =20 static int lxcAddNetworkRouteDefinition(const char *address, --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list