From nobody Mon Feb 9 16:02:34 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; 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 --- 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