From nobody Wed Nov 27 02:22:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1561411487; cv=none; d=zoho.com; s=zohoarc; b=aathRRyn3BniQiBivhEB/u/sQ8KBr0wQ1L3mKA8t1p5gH1hxFunLKmX/zWuPiFf/qahY+jd1wV5QD3hFKa7a+FXH0phv+QyauU940NAvFELtS8njdZExY1+4uUPQk467BfjEzgzfG5FJBT6XcjmRRivtwYFweWYFvbdbcHnUvWw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561411487; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=2e8W/3cYRo/OKBdGlV3KRNlov/imkqqNfk+Qqx0tkIU=; b=Z6a5HSAIudeiJ9alsz2Q+OlxigoxwmhDdZ0jVAnwuU7glxtW5MZjEncIq1vpCSJb1OYMYTxaNMrVt/UnRBOMoP/qlRcGCKOtb1Ce1G+e9bXOENA+NozufGhkIdeGCkRF1lF92HrRS4+fhzP2CktZu4wdxgkAGQF9hvYq9+Fp/Hg= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1561411487760695.4488097580003; Mon, 24 Jun 2019 14:24:47 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0CD9959473; Mon, 24 Jun 2019 21:24:25 +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 846D260BFB; Mon, 24 Jun 2019 21:24: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 507343D87; Mon, 24 Jun 2019 21:24:01 +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 x5OLNxkd008236 for ; Mon, 24 Jun 2019 17:23:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7A2B45C238; Mon, 24 Jun 2019 21:23:59 +0000 (UTC) Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7508C5C236 for ; Mon, 24 Jun 2019 21:23:57 +0000 (UTC) Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) (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 50D04882F5 for ; Mon, 24 Jun 2019 21:23:47 +0000 (UTC) Received: by mail-wm1-f65.google.com with SMTP id f17so759876wme.2 for ; Mon, 24 Jun 2019 14:23:47 -0700 (PDT) Received: from archpc.localdomain (x8d1ee222.agdsn.tu-dresden.de. [141.30.226.34]) by smtp.gmail.com with ESMTPSA id r2sm1039182wma.26.2019.06.24.14.23.44 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 14:23:45 -0700 (PDT) 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=0l3zCXZub6x7vgKpyMQ4rjpq58yfLSxmQuZrngJ47RQ=; b=R4lFaLqEZhnEfUBWqo4CcsAFS+91AVcCDvAllh9H+Kvwg0j+79i2FGZM2jCaZU/cLE 3AOd3N6nuYqedGqtkDa1lNoYCe5C/gxhZ2jKndr4Xe3cCUUPVyFdYP6ER2fsniX0jtkt h1aathehqXEwvCT+Jo5AViQwNIo1pKQnqWc4/HZ4t7k+bO0Tfz13YcnSF8genddaniwM xMXh3Jx33bfy9ZcPVEAH8Sa+By0p2Lcohf22zsBk1AB0Y54GHkaayRfGSf6a+FTrVZXZ hz3ieYfONJbxluxC2UQrmfhF7gyXVH3wiLC0k7WvyCwP8A1CJRoH8FAY0yGGVvfTOm5Y Y22g== 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=0l3zCXZub6x7vgKpyMQ4rjpq58yfLSxmQuZrngJ47RQ=; b=RIU4yLfvq5bMK3RVJchNlav4eo6LIP1fhHxFDtNgmuxNq/KhuZIxQ3jNgnkml20qPA ULRui4O2TdMYd+nD/syKGNdpeW7toJPpUrvzhwUSSmmXN526u3l4zkJu6T0TOm7gs9nf sVt0LvhJ2Tfub2tKOH5CVDnFg6QgnQDrg+LeZ2mVQwZHHYhIcJ0dJdkXQE+poT9l2Ep/ RJFnn9MRpuKdrRzPLv+N32qhAsWFCQOeWvs1mkyhPNWw4SFKjmTw74AR1NmoSWIr1orm f565k7T20M7rI/qt8qfaD1V8t/hyDvYDYp/IXFaI3Je2bOczcy62deXskGeoyuhpanx5 8TuQ== X-Gm-Message-State: APjAAAUeV2MVR9/3apbJQ8KKG35Jm9TROFLiUAwxuPgCElRpfSpuQxAP MRSKIBXZVrkNxnchgsO7rHIOJck284ozvA== X-Google-Smtp-Source: APXvYqxfkMOEoOp+W8ecY8tex9Yh4i9IiHcXDFKSwDHtY4IXWazoPW5ttyeloCPKGesHAEbzb354Sg== X-Received: by 2002:a7b:c842:: with SMTP id c2mr17245216wml.28.1561411425653; Mon, 24 Jun 2019 14:23:45 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Mon, 24 Jun 2019 23:23:17 +0200 Message-Id: <20190624212318.25494-2-stamatis.iliass@gmail.com> In-Reply-To: <20190624212318.25494-1-stamatis.iliass@gmail.com> References: <20190624212318.25494-1-stamatis.iliass@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.28]); Mon, 24 Jun 2019 21:23:47 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 24 Jun 2019 21:23:47 +0000 (UTC) for IP:'209.85.128.65' DOMAIN:'mail-wm1-f65.google.com' HELO:'mail-wm1-f65.google.com' FROM:'stamatis.iliass@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.11 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_PASS) 209.85.128.65 mail-wm1-f65.google.com 209.85.128.65 mail-wm1-f65.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/2] test_driver: use addr_offset for non-network infs too X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 24 Jun 2019 21:24:43 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The addr_offset can be used even for the hard-coded addresses in an attempt to always return unique ips. Signed-off-by: Ilias Stamatis --- src/test/test_driver.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 4b1f2724a0..d3bc6e7bce 100755 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -3508,6 +3508,8 @@ testDomainInterfaceAddresses(virDomainPtr dom, goto cleanup; for (i =3D 0; i < vm->def->nnets; i++) { + /* try using different addresses per different inf and domain */ + const size_t addr_offset =3D 20 * (vm->def->id - 1) + i + 1; const virDomainNetDef *net =3D vm->def->nets[i]; if (VIR_ALLOC(iface) < 0) @@ -3525,18 +3527,14 @@ testDomainInterfaceAddresses(virDomainPtr dom, iface->naddrs =3D 1; if (net->type =3D=3D VIR_DOMAIN_NET_TYPE_NETWORK) { - /* try using different addresses per different inf and domain = */ - const size_t addr_offset =3D 20 * (vm->def->id - 1) + i + 1; - if (testDomainInterfaceAddressFromNet(dom->conn->privateData, net, addr_offset, iface)= < 0) goto cleanup; } else { iface->addrs[0].type =3D VIR_IP_ADDR_TYPE_IPV4; iface->addrs[0].prefix =3D 24; - if (virAsprintf(&iface->addrs[0].addr, "192.168.0.%zu", 1 + i)= < 0) + if (virAsprintf(&iface->addrs[0].addr, "192.168.0.%zu", addr_o= ffset) < 0) goto cleanup; - } VIR_APPEND_ELEMENT_INPLACE(ifaces_ret, ifaces_count, iface); -- 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list