From nobody Sat May 4 01:29:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.ibm.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1639754467475890.4120358456211; Fri, 17 Dec 2021 07:21:07 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-421-7qoGdoQ_N0eebkVHLBcYIQ-1; Fri, 17 Dec 2021 10:21:02 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0E35410144E3; Fri, 17 Dec 2021 15:20:57 +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 1BCDE5F4E9; Fri, 17 Dec 2021 15:20:56 +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 6E54B1806D03; Fri, 17 Dec 2021 15:20:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1BHFKr9i027157 for ; Fri, 17 Dec 2021 10:20:54 -0500 Received: by smtp.corp.redhat.com (Postfix) id C195176CC; Fri, 17 Dec 2021 15:20:53 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BC9F176C9 for ; Fri, 17 Dec 2021 15:20:49 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 35E1B800B21 for ; Fri, 17 Dec 2021 15:20:49 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-482-j4y3Y_boNcqCDd0NWNOrOQ-1; Fri, 17 Dec 2021 10:20:45 -0500 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1BHEkJMJ024586; Fri, 17 Dec 2021 15:20:44 GMT Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0b-001b2d01.pphosted.com with ESMTP id 3cyhymgq36-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Dec 2021 15:20:44 +0000 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 1BHEnhe3026679; Fri, 17 Dec 2021 15:20:42 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma06ams.nl.ibm.com with ESMTP id 3cy78etqek-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Dec 2021 15:20:42 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1BHFKeNb38339012 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 Dec 2021 15:20:40 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6673911C05B; Fri, 17 Dec 2021 15:20:40 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 358E511C058; Fri, 17 Dec 2021 15:20:40 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.95.8]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 17 Dec 2021 15:20:40 +0000 (GMT) X-MC-Unique: 7qoGdoQ_N0eebkVHLBcYIQ-1 X-MC-Unique: j4y3Y_boNcqCDd0NWNOrOQ-1 From: Boris Fiuczynski To: libvir-list@redhat.com Subject: [PATCH] virt-host-validate: Fix IOMMU output on S390 Date: Fri, 17 Dec 2021 16:20:37 +0100 Message-Id: <20211217152037.6480-1-fiuczy@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: Dt7L8D28IjyiarVecTSgQbVrVzlhMgdV X-Proofpoint-ORIG-GUID: Dt7L8D28IjyiarVecTSgQbVrVzlhMgdV X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205, Aquarius:18.0.790, Hydra:6.0.425, FMLib:17.11.62.513 definitions=2021-12-17_05,2021-12-16_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 bulkscore=0 mlxlogscore=999 mlxscore=0 phishscore=0 lowpriorityscore=0 adultscore=0 impostorscore=0 priorityscore=1501 suspectscore=0 spamscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112170088 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: mprivozn@redhat.com, thuth@redhat.com, fabiano@redhat.com, bfu@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.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1639754469178100004 Content-Type: text/plain; charset="utf-8" Commit 93e9e92c1e eliminated the option for skipping but left code in the s390 check which makes use of a skip. This leads to an output without result destroying the correct format. e.g. QEMU: Checking for hardware virtualization = : PASS QEMU: Checking if device /dev/kvm exists = : PASS QEMU: Checking if device /dev/kvm is accessible = : PASS QEMU: Checking if device /dev/vhost-net exists = : PASS QEMU: Checking if device /dev/net/tun exists = : PASS QEMU: Checking for cgroup 'cpu' controller support = : PASS QEMU: Checking for cgroup 'cpuacct' controller support = : PASS QEMU: Checking for cgroup 'cpuset' controller support = : PASS QEMU: Checking for cgroup 'memory' controller support = : PASS QEMU: Checking for cgroup 'devices' controller support = : PASS QEMU: Checking for cgroup 'blkio' controller support = : PASS QEMU: Checking for device assignment IOMMU support = : QEMU: Checking for secure guest support = : PASS Signed-off-by: Boris Fiuczynski Reviewed-by: Michal Privoznik --- tools/virt-host-validate-common.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tools/virt-host-validate-common.c b/tools/virt-host-validate-c= ommon.c index 647ed7b48b..1cb9d206b5 100644 --- a/tools/virt-host-validate-common.c +++ b/tools/virt-host-validate-common.c @@ -378,11 +378,17 @@ int virHostValidateIOMMU(const char *hvname, * devices (which is quite usual on s390x). If there are * no PCI devices the directory is still there but is * empty. */ - if (!virDirOpen(&dir, "/sys/bus/pci/devices")) - return 0; + if (!virDirOpen(&dir, "/sys/bus/pci/devices")) { + virHostMsgFail(VIR_HOST_VALIDATE_NOTE, + "Skipped - PCI support disabled"); + return VIR_HOST_VALIDATE_FAILURE(VIR_HOST_VALIDATE_NOTE); + } rc =3D virDirRead(dir, &dent, NULL); - if (rc <=3D 0) - return 0; + if (rc <=3D 0) { + virHostMsgFail(VIR_HOST_VALIDATE_NOTE, + "Skipped - No PCI devices are online"); + return VIR_HOST_VALIDATE_FAILURE(VIR_HOST_VALIDATE_NOTE); + } virHostMsgPass(); } else { virHostMsgFail(level, --=20 2.31.1