From nobody Thu May 2 20:39:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1588758865; cv=none; d=zohomail.com; s=zohoarc; b=cLourTQ4+Pl0ZVXf5fy0qZgLX2XpZChj3BldSBH+Snn2Gp2n0HaMyWajbZhTyjjv+M/hfw2YuYve4eaMLbUXB71Xh8IzoB7b2XOsGbm/vGCFIevhVetX0aicgxeezV0PvEPs3BRdZVIIneBIwyRQCmTLKDJ/Sh7af1XK0IMkiq4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588758865; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=zW3ZEDSmB67g+H1QaayFILY+Rwqn4pRLBgaYMDF5Z9U=; b=ACngf3ZZQc/4UQCEDMzv4k6z6qFaIEtv8cSUcfjB5hBCGgNgpJ+xUw26fMuZjXO9E+uS8PibNHAt4D102nC0CELM1g9Ixbl2RpJS6NIFoH/p++3F0X2rOJIFJFmuGHgDSdNYZNrHhrwGxX6HIQ/yivWQLauljBmqrgodM8+/BRY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1588758865472234.78759631977493; Wed, 6 May 2020 02:54:25 -0700 (PDT) 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-454-SW62PQemPXeDb1G5gOKiEQ-1; Wed, 06 May 2020 05:54:21 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6463F802EB1; Wed, 6 May 2020 09:54:15 +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 139CE10013D9; Wed, 6 May 2020 09:54:15 +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 DE6381809542; Wed, 6 May 2020 09:54:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0469sB51018014 for ; Wed, 6 May 2020 05:54:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 981C16443E; Wed, 6 May 2020 09:54:11 +0000 (UTC) Received: from kinshicho.usersys.redhat.com (unknown [10.40.194.206]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7A3406443D for ; Wed, 6 May 2020 09:54:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588758864; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=zW3ZEDSmB67g+H1QaayFILY+Rwqn4pRLBgaYMDF5Z9U=; b=jCHeM/153LiGO+NoOvOC0PL5H5Z6ylRVYMMjGL+qKXD4RqutnI43N0Qj25ei/Yy9IG0e0Q 3lCK87BPq0W1439zm8/dZLj6iw6LoBKNr/LgSV0VhjOMDLxjHHFL+rg+BDHmdTda9L+Qrk 0rixo2R5wVG8p1eZ3ep8YvdLBFi2v+w= X-MC-Unique: SW62PQemPXeDb1G5gOKiEQ-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH] tests: Enable directory override for qemucapsprobe Date: Wed, 6 May 2020 11:54:04 +0200 Message-Id: <20200506095404.291022-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.84 on 10.5.11.22 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" Currently, qemucapsprobe fails when libvirt is not already installed on the system: $ ./tests/qemucapsprobe /path/to/qemu-system-ppc64 >/dev/null I/O warning : failed to load external entity "/usr/share/libvirt/cpu_map/= index.xml" 2020-05-06 09:49:59.136+0000: 269822: info : libvirt version: 6.4.0 2020-05-06 09:49:59.136+0000: 269822: info : hostname: [...] 2020-05-06 09:49:59.136+0000: 269822: warning : virQEMUCapsLogProbeFailur= e:5127 : Failed to probe capabilities for /path/to/qemu-system-ppc64: XML error: f= ailed to parse xml document '/usr/share/libvirt/cpu_map/index.xml' It would be great if the tool could work entirely out of the build directory, and this patch achieves just that. Suggested-by: Peter Krempa Signed-off-by: Andrea Bolognani Reviewed-by: Daniel P. Berrang=C3=A9 --- tests/qemucapsprobe.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/qemucapsprobe.c b/tests/qemucapsprobe.c index c7e8f3309d..ea88fd2e8a 100644 --- a/tests/qemucapsprobe.c +++ b/tests/qemucapsprobe.c @@ -55,6 +55,8 @@ main(int argc, char **argv) =20 VIR_TEST_PRELOAD(mock); =20 + virFileActivateDirOverrideForProg(argv[0]); + if (argc !=3D 2) { fprintf(stderr, "%s QEMU_binary\n", argv[0]); return EXIT_FAILURE; --=20 2.25.4