From nobody Thu May 2 13:16:13 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1555412175; cv=none; d=zoho.com; s=zohoarc; b=e0ownLsmvUmOhvYBXLjVjpLFUeFjMbDolsCXWtass3i+0keNTTY4rvYtS3mYka0kJ/Dh3Uz0WHmQRp3hjRcHu717k4ybp2CA8yS6PKW9DnCPddRDDg/TY4cRda7nBLXakVL+d4bKoa7X6hu37mP6mtp72JeZWA6y1ZbMVXMdfdQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555412175; 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=xaiFkBi/TLpTtLFMi+7fm9/jB29ewoQGoKDVi99/wYk=; b=NcyPZi2yNdkZ9Mi5DDOmEZ+aKnjrlWhI9VwwsQac9MhUm1N07UjGsOwJVNtUglIZCEFC63PdWwpTCIHnZm9NQ/gViDP72jaaz8Y34nxe19nFq748JL6EDW7tqSU2s9naDBa604XZd2iuRKbsd6g7bLK8BT3kIHwIwuAF9Vrpja4= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass 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 1555412175695347.616429884627; Tue, 16 Apr 2019 03:56:15 -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 AF38E4E92B; Tue, 16 Apr 2019 10:56:13 +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 855D360C4E; Tue, 16 Apr 2019 10:56:13 +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 46C103FAF4; Tue, 16 Apr 2019 10:56:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x3GAu8he016076 for ; Tue, 16 Apr 2019 06:56:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id 60F7D608C1; Tue, 16 Apr 2019 10:56:08 +0000 (UTC) Received: from kinshicho.redhat.com (ovpn-204-253.brq.redhat.com [10.40.204.253]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 71F4F608A4 for ; Tue, 16 Apr 2019 10:56:07 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 16 Apr 2019 12:55:57 +0200 Message-Id: <20190416105600.1534-2-abologna@redhat.com> In-Reply-To: <20190416105600.1534-1-abologna@redhat.com> References: <20190416105600.1534-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/4] tests: Make TEST_QEMU_CAPS_PATH public 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.38]); Tue, 16 Apr 2019 10:56:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The value (with a slightly different name) is currently private to testutilsqemu, but since we use this path all over the place it makes sense to define it publicly and avoid repetition. Signed-off-by: Andrea Bolognani Reviewed-by: Cole Robinson --- tests/testutilsqemu.c | 4 +--- tests/testutilsqemu.h | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index 763f511bcf..0f295dc9a9 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -957,8 +957,6 @@ testQemuCapsIterate(const char *dirname, } =20 =20 -#define TEST_CAPS_PATH abs_srcdir "/qemucapabilitiesdata" - int testQemuInfoSetArgs(struct testQemuInfo *info, virHashTablePtr capslatest, ...) @@ -1059,7 +1057,7 @@ testQemuInfoSetArgs(struct testQemuInfo *info, goto cleanup; stripmachinealiases =3D true; } else if (virAsprintf(&capsfile, "%s/caps_%s.%s.xml", - TEST_CAPS_PATH, capsver, capsarch) < 0) { + TEST_QEMU_CAPS_PATH, capsver, capsarch) < 0= ) { goto cleanup; } =20 diff --git a/tests/testutilsqemu.h b/tests/testutilsqemu.h index 9ff34841ff..9ed633f8c0 100644 --- a/tests/testutilsqemu.h +++ b/tests/testutilsqemu.h @@ -25,6 +25,8 @@ # include "qemu/qemu_capabilities.h" # include "qemu/qemu_conf.h" =20 +# define TEST_QEMU_CAPS_PATH abs_srcdir "/qemucapabilitiesdata" + enum { GIC_NONE =3D 0, GIC_V2, --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 13:16:13 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1555412174; cv=none; d=zoho.com; s=zohoarc; b=nayQub68hqjghlPR4E0vY3AXTkSMFEFivVvOCqBgvkmaXYBQxvey1oXFDjdbnXieojGzVBTNuNrSMBU5hfxyB9vc/s9D8GK6pa014JF7R3ycq6quF0g3r3xs7K1cCZcDUTaN5l0yiTUIvs58cBCG0+avaGJMahof8FJW7dWZADI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555412174; 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=AR45CI43AfYte8h8S5jEF6mLbF2mCqf5SDRi6cHd2M0=; b=cwi05NJvhjG6cmKdyt2Suc4WQ31ZJ1bCjKkgQplckOcoJxPR3SFME1z2o04BjmfB5aZ+cX+bSxxQDqIinJtez/HMDx2/cmxkTX/djlm/09tkvFFX3RceOqTy1gqYwgK7wBTG1gm0/Fjz3o62LYt9BhufaRbxIOuSjeyZ1kgnr4k= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass 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 1555412174134487.24707188989794; Tue, 16 Apr 2019 03:56:14 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4F4D1308A951; Tue, 16 Apr 2019 10:56:12 +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 2A1385D9CA; Tue, 16 Apr 2019 10:56:12 +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 D8C003FB13; Tue, 16 Apr 2019 10:56:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x3GAu9wX016086 for ; Tue, 16 Apr 2019 06:56:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id D35BC608C1; Tue, 16 Apr 2019 10:56:09 +0000 (UTC) Received: from kinshicho.redhat.com (ovpn-204-253.brq.redhat.com [10.40.204.253]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 009CF608A4 for ; Tue, 16 Apr 2019 10:56:08 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 16 Apr 2019 12:55:58 +0200 Message-Id: <20190416105600.1534-3-abologna@redhat.com> In-Reply-To: <20190416105600.1534-1-abologna@redhat.com> References: <20190416105600.1534-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/4] tests: Drop dirname argument from testQemuGetLatestCapsForArch() 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Tue, 16 Apr 2019 10:56:12 +0000 (UTC) Content-Type: text/plain; charset="utf-8" As evidenced by all existing callers, the only directory it makes sense to use is TEST_QEMU_CAPS_PATH, so let's just bake that into the function. Signed-off-by: Andrea Bolognani Reviewed-by: Cole Robinson --- tests/qemublocktest.c | 3 +-- tests/testutilsqemu.c | 14 ++++++-------- tests/testutilsqemu.h | 3 +-- tests/testutilsqemuschema.c | 3 +-- 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 1a365a411c..c221b8af30 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -327,8 +327,7 @@ mymain(void) =20 diskxmljsondata.driver =3D &driver; =20 - if (!(capslatest_x86_64 =3D testQemuGetLatestCapsForArch(abs_srcdir "/= qemucapabilitiesdata", - "x86_64", "xml"= ))) + if (!(capslatest_x86_64 =3D testQemuGetLatestCapsForArch("x86_64", "xm= l"))) return EXIT_FAILURE; =20 VIR_TEST_VERBOSE("\nlatest caps x86_64: %s\n", capslatest_x86_64); diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index 0f295dc9a9..ccc05233db 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -805,8 +805,7 @@ testQemuCapsSetGIC(virQEMUCapsPtr qemuCaps, =20 =20 char * -testQemuGetLatestCapsForArch(const char *dirname, - const char *arch, +testQemuGetLatestCapsForArch(const char *arch, const char *suffix) { struct dirent *ent; @@ -822,10 +821,10 @@ testQemuGetLatestCapsForArch(const char *dirname, if (virAsprintf(&fullsuffix, "%s.%s", arch, suffix) < 0) goto cleanup; =20 - if (virDirOpen(&dir, dirname) < 0) + if (virDirOpen(&dir, TEST_QEMU_CAPS_PATH) < 0) goto cleanup; =20 - while ((rc =3D virDirRead(dir, &ent, dirname)) > 0) { + while ((rc =3D virDirRead(dir, &ent, TEST_QEMU_CAPS_PATH)) > 0) { VIR_FREE(tmp); =20 if ((rc =3D VIR_STRDUP(tmp, STRSKIP(ent->d_name, "caps_"))) < 0) @@ -853,11 +852,11 @@ testQemuGetLatestCapsForArch(const char *dirname, =20 if (!maxname) { VIR_TEST_VERBOSE("failed to find capabilities for '%s' in '%s'\n", - arch, dirname); + arch, TEST_QEMU_CAPS_PATH); goto cleanup; } =20 - ignore_value(virAsprintf(&ret, "%s/%s", dirname, maxname)); + ignore_value(virAsprintf(&ret, "%s/%s", TEST_QEMU_CAPS_PATH, maxname)); =20 cleanup: VIR_FREE(tmp); @@ -886,8 +885,7 @@ testQemuGetLatestCaps(void) VIR_TEST_VERBOSE("\n"); =20 for (i =3D 0; i < ARRAY_CARDINALITY(archs); ++i) { - char *cap =3D testQemuGetLatestCapsForArch(abs_srcdir "/qemucapabi= litiesdata", - archs[i], "xml"); + char *cap =3D testQemuGetLatestCapsForArch(archs[i], "xml"); =20 if (!cap || virHashAddEntry(capslatest, archs[i], cap) < 0) goto error; diff --git a/tests/testutilsqemu.h b/tests/testutilsqemu.h index 9ed633f8c0..949e98f591 100644 --- a/tests/testutilsqemu.h +++ b/tests/testutilsqemu.h @@ -92,8 +92,7 @@ int qemuTestCapsCacheInsert(virFileCachePtr cache, int testQemuCapsSetGIC(virQEMUCapsPtr qemuCaps, int gic); =20 -char *testQemuGetLatestCapsForArch(const char *dirname, - const char *arch, +char *testQemuGetLatestCapsForArch(const char *arch, const char *suffix); virHashTablePtr testQemuGetLatestCaps(void); =20 diff --git a/tests/testutilsqemuschema.c b/tests/testutilsqemuschema.c index aa846e1e79..f1365e8846 100644 --- a/tests/testutilsqemuschema.c +++ b/tests/testutilsqemuschema.c @@ -533,8 +533,7 @@ testQEMUSchemaGetLatest(void) virJSONValuePtr reply =3D NULL; virJSONValuePtr schema =3D NULL; =20 - if (!(capsLatestFile =3D testQemuGetLatestCapsForArch(abs_srcdir "/qem= ucapabilitiesdata", - "x86_64", "replies= "))) { + if (!(capsLatestFile =3D testQemuGetLatestCapsForArch("x86_64", "repli= es"))) { VIR_TEST_VERBOSE("failed to find latest caps replies\n"); return NULL; } --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 13:16:13 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1555412174; cv=none; d=zoho.com; s=zohoarc; b=I7csqivc/zDQHRoC21cretil8NrPZbZPTSFWgebAvImqw2gur5+QPxRgkQ36ecF/j6giGW5MZ8JE8FB6qmOlScviGckt/4f9MYGchexxEfWJUFjw6UCvBeTlOq2viiwyKI+MrCqeQtfAjplqM7MZHq5YjO0JYpoF1R8ur71a7ow= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555412174; 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=Ad+EnH7mRIKCuXwPvzVms0iZzV/FqSjerFdK4pnBo9I=; b=NtP2tnVMzHBBaU78+/DUN1rgPCJD+0IA0UTiGbxqvjv5ivwUrH5T8jK9y1CM8KuRdOwGGnmdzQbiukH8Ao3OMl9/XfDrVj0d67Nn9ecOS+ExryTUipHlKZfXMUv2jkVBVGA4WL6pMNtqMwHGEHTEY0rSYAtIhpAn2Etv/idyreQ= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass 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 155541217462743.79177662191876; Tue, 16 Apr 2019 03:56:14 -0700 (PDT) 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 E387280462; Tue, 16 Apr 2019 10:56:12 +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 B786F19C6A; Tue, 16 Apr 2019 10:56:12 +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 7972D3FB15; Tue, 16 Apr 2019 10:56:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x3GAuB6X016094 for ; Tue, 16 Apr 2019 06:56:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2886C608A4; Tue, 16 Apr 2019 10:56:11 +0000 (UTC) Received: from kinshicho.redhat.com (ovpn-204-253.brq.redhat.com [10.40.204.253]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 736B0608F2 for ; Tue, 16 Apr 2019 10:56:10 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 16 Apr 2019 12:55:59 +0200 Message-Id: <20190416105600.1534-4-abologna@redhat.com> In-Reply-To: <20190416105600.1534-1-abologna@redhat.com> References: <20190416105600.1534-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/4] tests: Drop dirname argument from testQemuCapsIterate() 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.28]); Tue, 16 Apr 2019 10:56:13 +0000 (UTC) Content-Type: text/plain; charset="utf-8" As evidenced by all existing callers, the only directory it makes sense to use is TEST_QEMU_CAPS_PATH, so let's just bake that into the function. Signed-off-by: Andrea Bolognani Reviewed-by: Cole Robinson --- tests/qemucapabilitiestest.c | 2 +- tests/qemucaps2xmltest.c | 2 +- tests/testutilsqemu.c | 7 +++---- tests/testutilsqemu.h | 3 +-- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c index 4c9b7c5322..5477740339 100644 --- a/tests/qemucapabilitiestest.c +++ b/tests/qemucapabilitiestest.c @@ -221,7 +221,7 @@ mymain(void) if (testQemuDataInit(&data) < 0) return EXIT_FAILURE; =20 - if (testQemuCapsIterate(data.dataDir, ".replies", doCapsTest, &data) <= 0) + if (testQemuCapsIterate(".replies", doCapsTest, &data) < 0) return EXIT_FAILURE; =20 /* diff --git a/tests/qemucaps2xmltest.c b/tests/qemucaps2xmltest.c index 7d3c768bfd..59f676ede1 100644 --- a/tests/qemucaps2xmltest.c +++ b/tests/qemucaps2xmltest.c @@ -212,7 +212,7 @@ mymain(void) if (testQemuDataInit(&data) < 0) return EXIT_FAILURE; =20 - if (testQemuCapsIterate(data.inputDir, ".xml", doCapsTest, &data) < 0) + if (testQemuCapsIterate(".xml", doCapsTest, &data) < 0) return EXIT_FAILURE; =20 return (data.ret =3D=3D 0) ? EXIT_SUCCESS : EXIT_FAILURE; diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index ccc05233db..bce847ce5e 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -903,8 +903,7 @@ testQemuGetLatestCaps(void) =20 =20 int -testQemuCapsIterate(const char *dirname, - const char *suffix, +testQemuCapsIterate(const char *suffix, testQemuCapsIterateCallback callback, void *opaque) { @@ -916,10 +915,10 @@ testQemuCapsIterate(const char *dirname, if (!callback) return 0; =20 - if (virDirOpen(&dir, dirname) < 0) + if (virDirOpen(&dir, TEST_QEMU_CAPS_PATH) < 0) goto cleanup; =20 - while ((rc =3D virDirRead(dir, &ent, dirname) > 0)) { + while ((rc =3D virDirRead(dir, &ent, TEST_QEMU_CAPS_PATH) > 0)) { char *tmp =3D ent->d_name; char *base =3D NULL; char *archName =3D NULL; diff --git a/tests/testutilsqemu.h b/tests/testutilsqemu.h index 949e98f591..25dedb5edd 100644 --- a/tests/testutilsqemu.h +++ b/tests/testutilsqemu.h @@ -99,8 +99,7 @@ virHashTablePtr testQemuGetLatestCaps(void); typedef int (*testQemuCapsIterateCallback)(const char *base, const char *archName, void *opaque); -int testQemuCapsIterate(const char *dirname, - const char *suffix, +int testQemuCapsIterate(const char *suffix, testQemuCapsIterateCallback callback, void *opaque); =20 --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 13:16:13 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1555412178; cv=none; d=zoho.com; s=zohoarc; b=JDABcerxjwzoACQqAXHDaK4QE5luOI8dt8fSfIZK0R6MErXWEDbpiutRFPED8ReS8nmwXQL58ept5UGJRiIks/fx5QVX9yPnVA5bmJ1c0JfocPDlF2xbKMYi57Aal9y0VhrCAKUHT4v9dvRZWC51jEH+E9+yDPaJ49EKjnOnrSc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555412178; 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=Atf7614co8XG/2n1zahnvfxoeWxdrICr8yRVd0oKvAQ=; b=VUFoEwNW12G714GpZLo1GJaS7W6Wcg/WB7MydamcxXoLRDjwR5iCD2h7eeNU0u6OwU8KytoB1BnQEq3BF92XDl71ahIsC4A/mF81koKqZ4CEh8PuVCpcrxryeKufsH0RrYBIMCOQ0qGPp2/sP/Zz5aqQO4y2GRBha9blRchfWvY= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass 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 155541217882727.86555731265844; Tue, 16 Apr 2019 03:56:18 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3305E804F2; Tue, 16 Apr 2019 10:56:17 +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 090365D9D5; Tue, 16 Apr 2019 10:56:17 +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 B9B38181AC46; Tue, 16 Apr 2019 10:56:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x3GAuC74016104 for ; Tue, 16 Apr 2019 06:56:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id 92135608C7; Tue, 16 Apr 2019 10:56:12 +0000 (UTC) Received: from kinshicho.redhat.com (ovpn-204-253.brq.redhat.com [10.40.204.253]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A3388608A4 for ; Tue, 16 Apr 2019 10:56:11 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 16 Apr 2019 12:56:00 +0200 Message-Id: <20190416105600.1534-5-abologna@redhat.com> In-Reply-To: <20190416105600.1534-1-abologna@redhat.com> References: <20190416105600.1534-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/4] tests: Use TEST_QEMU_CAPS_PATH wherever possible 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 16 Apr 2019 10:56:17 +0000 (UTC) Content-Type: text/plain; charset="utf-8" After the recent changes, there are only a few places left where we use the explicit path instead of taking advantage of the publicly available define; let's get rid of those too. Signed-off-by: Andrea Bolognani Reviewed-by: Cole Robinson --- tests/domaincapstest.c | 4 ++-- tests/qemuargv2xmltest.c | 2 +- tests/qemucapabilitiestest.c | 2 +- tests/qemucaps2xmltest.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c index a9922e1edb..f87a1d63fb 100644 --- a/tests/domaincapstest.c +++ b/tests/domaincapstest.c @@ -88,8 +88,8 @@ fillQemuCaps(virDomainCapsPtr domCaps, fakeHostCPU(caps, domCaps->arch) < 0) goto cleanup; =20 - if (virAsprintf(&path, "%s/qemucapabilitiesdata/%s.%s.xml", - abs_srcdir, name, arch) < 0 || + if (virAsprintf(&path, "%s/%s.%s.xml", + TEST_QEMU_CAPS_PATH, name, arch) < 0 || !(qemuCaps =3D qemuTestParseCapabilities(caps, path))) goto cleanup; =20 diff --git a/tests/qemuargv2xmltest.c b/tests/qemuargv2xmltest.c index 29c80a0471..2a51e22318 100644 --- a/tests/qemuargv2xmltest.c +++ b/tests/qemuargv2xmltest.c @@ -156,7 +156,7 @@ mymain(void) do { \ virQEMUCapsPtr qemuCaps; \ qemuCaps =3D qemuTestParseCapabilitiesArch(VIR_ARCH_X86_64, \ - abs_srcdir "/qemucapabili= tiesdata/caps_2.12.0." arch ".xml"); \ + TEST_QEMU_CAPS_PATH "/cap= s_2.12.0." arch ".xml"); \ if (virFileCacheInsertData(driver.qemuCapsCache, \ "/usr/bin/qemu-system-" arch, \ qemuCaps) < 0) \ diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c index 5477740339..ac9ab6bfce 100644 --- a/tests/qemucapabilitiestest.c +++ b/tests/qemucapabilitiestest.c @@ -48,7 +48,7 @@ testQemuDataInit(testQemuDataPtr data) if (qemuTestDriverInit(&data->driver) < 0) return -1; =20 - data->dataDir =3D abs_srcdir "/qemucapabilitiesdata"; + data->dataDir =3D TEST_QEMU_CAPS_PATH; =20 data->ret =3D 0; =20 diff --git a/tests/qemucaps2xmltest.c b/tests/qemucaps2xmltest.c index 59f676ede1..d107b32221 100644 --- a/tests/qemucaps2xmltest.c +++ b/tests/qemucaps2xmltest.c @@ -39,7 +39,7 @@ struct _testQemuData { static int testQemuDataInit(testQemuDataPtr data) { - data->inputDir =3D abs_srcdir "/qemucapabilitiesdata"; + data->inputDir =3D TEST_QEMU_CAPS_PATH; data->outputDir =3D abs_srcdir "/qemucaps2xmloutdata"; =20 data->ret =3D 0; --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list