From nobody Fri May 3 17:53:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1598270444; cv=none; d=zohomail.com; s=zohoarc; b=OvBjcG6H8uT80TpJDapztkKGycftoyEGORNmi6N5EiJa220gD5LcWVgonHxcbwg1b69TZGT3MgGqhdlHEs6DDnHdD9SoVQjK2AZ38HCtU7pACUg8xQ27dFkbO3J0LHsXo/paJCBSKbU+ltgdBesYJCb+0i47GaM0yXIwFOT/BRA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598270444; h=Content-Type:Content-Transfer-Encoding:Cc: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; bh=Hjgwo1WrY9GGx7zHqDXxHXykPz+YenHCCSyPRlIHLAQ=; b=jhh9zGkPzxHPScveaXnrSHX9EKosqGM8bseJubGvpIuu7CN6R1e5b9D8SN7PYcAZ2qXQq1aQhMjByNrpHNB9NZSTc/Qlqg+XWw0hpf2B0ZGgoWVpkKCLgiHxPJdQ72Rnwz0eGKEBbFJqHzhU+q+KhytgsvtFeo9joZua4facDUI= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1598270444956655.086721094801; Mon, 24 Aug 2020 05:00:44 -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-491-vwixLVkGOuq0edCu29PTkQ-1; Mon, 24 Aug 2020 08:00:16 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4349381F012; Mon, 24 Aug 2020 12:00:11 +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 1F7745F707; Mon, 24 Aug 2020 12:00: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 DD971EC23; Mon, 24 Aug 2020 12:00:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 07OBxSPY029259 for ; Mon, 24 Aug 2020 07:59:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id A54602022792; Mon, 24 Aug 2020 11:59:28 +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 9F9AB20227B0 for ; Mon, 24 Aug 2020 11:59:26 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C00AE888BE4 for ; Mon, 24 Aug 2020 11:59:26 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-3-nlLCvRUuOi-wdyFo6Tww3w-1; Mon, 24 Aug 2020 07:59:24 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07OBWLvj099466 for ; Mon, 24 Aug 2020 07:59:23 -0400 Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 334bc73cjt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 24 Aug 2020 07:59:23 -0400 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07OBwH2G002855 for ; Mon, 24 Aug 2020 11:59:21 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma03ams.nl.ibm.com with ESMTP id 332ujktahr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 24 Aug 2020 11:59:20 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07OBvmpw53805312 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Aug 2020 11:57:48 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EC472A405C; Mon, 24 Aug 2020 11:59:17 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C3F2AA4054; Mon, 24 Aug 2020 11:59:17 +0000 (GMT) Received: from m46lp64.lnxne.boe (unknown [9.152.108.100]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 24 Aug 2020 11:59:17 +0000 (GMT) X-MC-Unique: vwixLVkGOuq0edCu29PTkQ-1 X-MC-Unique: nlLCvRUuOi-wdyFo6Tww3w-1 From: Bjoern Walk To: libvir-list@redhat.com Subject: [PATCH 1/5] node_device: refactor udevProcessCCW Date: Mon, 24 Aug 2020 13:59:11 +0200 Message-Id: <20200824115915.345646-2-bwalk@linux.ibm.com> In-Reply-To: <20200824115915.345646-1-bwalk@linux.ibm.com> References: <20200824115915.345646-1-bwalk@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-08-24_08:2020-08-24, 2020-08-24 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 spamscore=0 mlxscore=0 adultscore=0 lowpriorityscore=0 clxscore=1015 malwarescore=0 suspectscore=1 phishscore=0 mlxlogscore=999 priorityscore=1501 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008240087 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.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Cc: Bjoern Walk , Boris Fiuczynski 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.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Boris Fiuczynski Refactor out CCW address parsing for later reuse. Reviewed-by: Bjoern Walk Signed-off-by: Boris Fiuczynski Reviewed-by: Erik Skultety --- src/node_device/node_device_udev.c | 31 ++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_devi= ce_udev.c index ff558efb..d478a673 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -1058,27 +1058,38 @@ udevProcessMediatedDevice(struct udev_device *dev, =20 =20 static int -udevProcessCCW(struct udev_device *device, - virNodeDeviceDefPtr def) +udevGetCCWAddress(const char *sysfs_path, + virNodeDevCapDataPtr data) { - int online; char *p; - virNodeDevCapDataPtr data =3D &def->caps->data; - - /* process only online devices to keep the list sane */ - if (udevGetIntSysfsAttr(device, "online", &online, 0) < 0 || online != =3D 1) - return -1; =20 - if ((p =3D strrchr(def->sysfs_path, '/')) =3D=3D NULL || + if ((p =3D strrchr(sysfs_path, '/')) =3D=3D NULL || virStrToLong_ui(p + 1, &p, 16, &data->ccw_dev.cssid) < 0 || p =3D= =3D NULL || virStrToLong_ui(p + 1, &p, 16, &data->ccw_dev.ssid) < 0 || p =3D= =3D NULL || virStrToLong_ui(p + 1, &p, 16, &data->ccw_dev.devno) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("failed to parse the CCW address from sysfs path:= '%s'"), - def->sysfs_path); + sysfs_path); return -1; } =20 + return 0; +} + + +static int +udevProcessCCW(struct udev_device *device, + virNodeDeviceDefPtr def) +{ + int online; + + /* process only online devices to keep the list sane */ + if (udevGetIntSysfsAttr(device, "online", &online, 0) < 0 || online != =3D 1) + return -1; + + if (udevGetCCWAddress(def->sysfs_path, &def->caps->data) < 0) + return -1; + if (udevGenerateDeviceName(device, def, NULL) !=3D 0) return -1; =20 --=20 2.24.1 From nobody Fri May 3 17:53:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1598270400; cv=none; d=zohomail.com; s=zohoarc; b=fw265bJbP5MXsCf9DI+7Kqy1r0iSEpTHZtr8nH8vLSuY8h3BU5LOSW58zQmWJT65YZ4AlKU4uiKfN6D4bZexwRzCdUfwaT2pvcir0/xBjhAE2COm8+3CpS1PVzrLfrIAml9f2zbPW21MubFcLuGSBHGwtTu5U1N0XBMMCap0xxQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598270400; h=Content-Type:Content-Transfer-Encoding:Cc: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; bh=rsz1ib7FbNzmH46canPOkhN14GVAOujhgyx5WDbTG9U=; b=n25mpzhb0KGY9XlJg2irZBRZB+FbfVJKEobg5Yaoaq8xLJQn4hW+1D+b63QwrInHOCDcPYvSxCOVbJzA+6DLHbbgC1i/df817UldwA2l4swgUAeOQf1wz6j75buKLB+wmKY1CblxcCk0R/J1Ay0ZZ19uuXx9/lc6ytD15txjKh0= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1598270400961263.2808083885292; Mon, 24 Aug 2020 05:00:00 -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-149--bBjq_mtMXW6qvHTtWaQ9g-1; Mon, 24 Aug 2020 07:59:56 -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 A848F1008559; Mon, 24 Aug 2020 11:59:50 +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 8444110027AB; Mon, 24 Aug 2020 11:59:50 +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 54F64EC16; Mon, 24 Aug 2020 11:59:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 07OBxSuh029253 for ; Mon, 24 Aug 2020 07:59:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id 990E82166B44; Mon, 24 Aug 2020 11:59:28 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 921282166BDD for ; Mon, 24 Aug 2020 11:59:27 +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-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 52C118EE64A for ; Mon, 24 Aug 2020 11:59:27 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-108-HHTMwIV-NBic5LoaAlCclg-1; Mon, 24 Aug 2020 07:59:24 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07OBVsQV038432 for ; Mon, 24 Aug 2020 07:59:24 -0400 Received: from ppma05fra.de.ibm.com (6c.4a.5195.ip4.static.sl-reverse.com [149.81.74.108]) by mx0a-001b2d01.pphosted.com with ESMTP id 334b5c3p18-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 24 Aug 2020 07:59:23 -0400 Received: from pps.filterd (ppma05fra.de.ibm.com [127.0.0.1]) by ppma05fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07OBwFTL011340 for ; Mon, 24 Aug 2020 11:59:21 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma05fra.de.ibm.com with ESMTP id 332uk8hdjg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 24 Aug 2020 11:59:21 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07OBvmuK63832434 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Aug 2020 11:57:48 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 30FFFA405B; Mon, 24 Aug 2020 11:59:18 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 03909A4062; Mon, 24 Aug 2020 11:59:18 +0000 (GMT) Received: from m46lp64.lnxne.boe (unknown [9.152.108.100]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 24 Aug 2020 11:59:17 +0000 (GMT) X-MC-Unique: -bBjq_mtMXW6qvHTtWaQ9g-1 X-MC-Unique: HHTMwIV-NBic5LoaAlCclg-1 From: Bjoern Walk To: libvir-list@redhat.com Subject: [PATCH 2/5] node_device: detect CSS devices Date: Mon, 24 Aug 2020 13:59:12 +0200 Message-Id: <20200824115915.345646-3-bwalk@linux.ibm.com> In-Reply-To: <20200824115915.345646-1-bwalk@linux.ibm.com> References: <20200824115915.345646-1-bwalk@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-08-24_08:2020-08-24, 2020-08-24 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 bulkscore=0 adultscore=0 spamscore=0 impostorscore=0 suspectscore=3 clxscore=1015 phishscore=0 malwarescore=0 lowpriorityscore=0 mlxlogscore=999 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008240087 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.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Cc: Bjoern Walk , Boris Fiuczynski 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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Boris Fiuczynski Make channel subsystem (CSS) devices available in the node_device driver. The CCS devices reside in the computer system and provide CCW devices, e.g.: +- css_0_0_003a | +- ccw_0_0_1a2b | +- scsi_host0 | +- scsi_target0_0_0 | +- scsi_0_0_0_0 Reviewed-by: Bjoern Walk Signed-off-by: Boris Fiuczynski --- docs/schemas/nodedev.rng | 16 ++++++++++++++ src/conf/node_device_conf.c | 5 +++++ src/conf/node_device_conf.h | 1 + src/conf/virnodedeviceobj.c | 1 + src/node_device/node_device_udev.c | 22 +++++++++++++++++++ .../ccw_0_0_10000-invalid.xml | 4 ++-- tests/nodedevschemadata/ccw_0_0_ffff.xml | 4 ++-- tests/nodedevschemadata/css_0_0_ffff.xml | 10 +++++++++ tests/nodedevxml2xmltest.c | 1 + tools/virsh-nodedev.c | 1 + 10 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 tests/nodedevschemadata/css_0_0_ffff.xml diff --git a/docs/schemas/nodedev.rng b/docs/schemas/nodedev.rng index 4b2b350f..f7f517b5 100644 --- a/docs/schemas/nodedev.rng +++ b/docs/schemas/nodedev.rng @@ -85,6 +85,7 @@ + @@ -659,6 +660,21 @@ =20 + + + css + + + + + + + + + + + + diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c index 851ef0a8..8694df4b 100644 --- a/src/conf/node_device_conf.c +++ b/src/conf/node_device_conf.c @@ -65,6 +65,7 @@ VIR_ENUM_IMPL(virNodeDevCap, "mdev_types", "mdev", "ccw", + "css", ); =20 VIR_ENUM_IMPL(virNodeDevNetCap, @@ -602,6 +603,7 @@ virNodeDeviceDefFormat(const virNodeDeviceDef *def) virNodeDeviceCapMdevDefFormat(&buf, data); break; case VIR_NODE_DEV_CAP_CCW_DEV: + case VIR_NODE_DEV_CAP_CSS_DEV: virBufferAsprintf(&buf, "0x%x\n", data->ccw_dev.cssid); virBufferAsprintf(&buf, "0x%x\n", @@ -1904,6 +1906,7 @@ virNodeDevCapsDefParseXML(xmlXPathContextPtr ctxt, ret =3D virNodeDevCapMdevParseXML(ctxt, def, node, &caps->data.mde= v); break; case VIR_NODE_DEV_CAP_CCW_DEV: + case VIR_NODE_DEV_CAP_CSS_DEV: ret =3D virNodeDevCapCCWParseXML(ctxt, def, node, &caps->data.ccw_= dev); break; case VIR_NODE_DEV_CAP_MDEV_TYPES: @@ -2228,6 +2231,7 @@ virNodeDevCapsDefFree(virNodeDevCapsDefPtr caps) case VIR_NODE_DEV_CAP_FC_HOST: case VIR_NODE_DEV_CAP_VPORTS: case VIR_NODE_DEV_CAP_CCW_DEV: + case VIR_NODE_DEV_CAP_CSS_DEV: case VIR_NODE_DEV_CAP_LAST: /* This case is here to shutup the compiler */ break; @@ -2281,6 +2285,7 @@ virNodeDeviceUpdateCaps(virNodeDeviceDefPtr def) case VIR_NODE_DEV_CAP_MDEV_TYPES: case VIR_NODE_DEV_CAP_MDEV: case VIR_NODE_DEV_CAP_CCW_DEV: + case VIR_NODE_DEV_CAP_CSS_DEV: case VIR_NODE_DEV_CAP_LAST: break; } diff --git a/src/conf/node_device_conf.h b/src/conf/node_device_conf.h index 9b8c7aad..47669d42 100644 --- a/src/conf/node_device_conf.h +++ b/src/conf/node_device_conf.h @@ -64,6 +64,7 @@ typedef enum { VIR_NODE_DEV_CAP_MDEV_TYPES, /* Device capable of mediated devi= ces */ VIR_NODE_DEV_CAP_MDEV, /* Mediated device */ VIR_NODE_DEV_CAP_CCW_DEV, /* s390 CCW device */ + VIR_NODE_DEV_CAP_CSS_DEV, /* s390 channel subsystem device */ =20 VIR_NODE_DEV_CAP_LAST } virNodeDevCapType; diff --git a/src/conf/virnodedeviceobj.c b/src/conf/virnodedeviceobj.c index bfd52412..e234432b 100644 --- a/src/conf/virnodedeviceobj.c +++ b/src/conf/virnodedeviceobj.c @@ -710,6 +710,7 @@ virNodeDeviceObjHasCap(const virNodeDeviceObj *obj, case VIR_NODE_DEV_CAP_MDEV_TYPES: case VIR_NODE_DEV_CAP_MDEV: case VIR_NODE_DEV_CAP_CCW_DEV: + case VIR_NODE_DEV_CAP_CSS_DEV: case VIR_NODE_DEV_CAP_LAST: break; } diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_devi= ce_udev.c index d478a673..1c4df709 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -1097,6 +1097,24 @@ udevProcessCCW(struct udev_device *device, } =20 =20 +static int +udevProcessCSS(struct udev_device *device, + virNodeDeviceDefPtr def) +{ + /* do not process EADM and CHSC devices to keep the list sane */ + if (STREQ(def->driver, "eadm_subchannel") || + STREQ(def->driver, "chsc_subchannel")) + return -1; + + if (udevGetCCWAddress(def->sysfs_path, &def->caps->data) < 0) + return -1; + + if (udevGenerateDeviceName(device, def, NULL) !=3D 0) + return -1; + + return 0; +} + static int udevGetDeviceNodes(struct udev_device *device, virNodeDeviceDefPtr def) @@ -1175,6 +1193,8 @@ udevGetDeviceType(struct udev_device *device, *type =3D VIR_NODE_DEV_CAP_MDEV; else if (STREQ_NULLABLE(subsystem, "ccw")) *type =3D VIR_NODE_DEV_CAP_CCW_DEV; + else if (STREQ_NULLABLE(subsystem, "css")) + *type =3D VIR_NODE_DEV_CAP_CSS_DEV; =20 VIR_FREE(subsystem); } @@ -1219,6 +1239,8 @@ udevGetDeviceDetails(struct udev_device *device, return udevProcessMediatedDevice(device, def); case VIR_NODE_DEV_CAP_CCW_DEV: return udevProcessCCW(device, def); + case VIR_NODE_DEV_CAP_CSS_DEV: + return udevProcessCSS(device, def); case VIR_NODE_DEV_CAP_MDEV_TYPES: case VIR_NODE_DEV_CAP_SYSTEM: case VIR_NODE_DEV_CAP_FC_HOST: diff --git a/tests/nodedevschemadata/ccw_0_0_10000-invalid.xml b/tests/node= devschemadata/ccw_0_0_10000-invalid.xml index d840555c..f3cf0c1c 100644 --- a/tests/nodedevschemadata/ccw_0_0_10000-invalid.xml +++ b/tests/nodedevschemadata/ccw_0_0_10000-invalid.xml @@ -1,7 +1,7 @@ ccw_0_0_10000 - /sys/devices/css0/0.0.0000/0.0.10000 - computer + /sys/devices/css0/0.0.0070/0.0.10000 + css_0_0_0070 0x0 0x0 diff --git a/tests/nodedevschemadata/ccw_0_0_ffff.xml b/tests/nodedevschema= data/ccw_0_0_ffff.xml index 5ecd0b0a..3b8ea46e 100644 --- a/tests/nodedevschemadata/ccw_0_0_ffff.xml +++ b/tests/nodedevschemadata/ccw_0_0_ffff.xml @@ -1,7 +1,7 @@ ccw_0_0_ffff - /sys/devices/css0/0.0.0000/0.0.ffff - computer + /sys/devices/css0/0.0.0070/0.0.ffff + css_0_0_0070 0x0 0x0 diff --git a/tests/nodedevschemadata/css_0_0_ffff.xml b/tests/nodedevschema= data/css_0_0_ffff.xml new file mode 100644 index 00000000..312e07fe --- /dev/null +++ b/tests/nodedevschemadata/css_0_0_ffff.xml @@ -0,0 +1,10 @@ + + css_0_0_ffff + /sys/devices/css0/0.0.ffff + computer + + 0x0 + 0x0 + 0xffff + + diff --git a/tests/nodedevxml2xmltest.c b/tests/nodedevxml2xmltest.c index 6168c29c..3cb23b1d 100644 --- a/tests/nodedevxml2xmltest.c +++ b/tests/nodedevxml2xmltest.c @@ -123,6 +123,7 @@ mymain(void) DO_TEST("pci_0000_02_10_7_mdev_types"); DO_TEST("mdev_3627463d_b7f0_4fea_b468_f1da537d301b"); DO_TEST("ccw_0_0_ffff"); + DO_TEST("css_0_0_ffff"); =20 return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } diff --git a/tools/virsh-nodedev.c b/tools/virsh-nodedev.c index e576b3c8..ff4b7441 100644 --- a/tools/virsh-nodedev.c +++ b/tools/virsh-nodedev.c @@ -461,6 +461,7 @@ cmdNodeListDevices(vshControl *ctl, const vshCmd *cmd G= _GNUC_UNUSED) case VIR_NODE_DEV_CAP_CCW_DEV: flags |=3D VIR_CONNECT_LIST_NODE_DEVICES_CAP_CCW_DEV; break; + case VIR_NODE_DEV_CAP_CSS_DEV: case VIR_NODE_DEV_CAP_LAST: break; } --=20 2.24.1 From nobody Fri May 3 17:53:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1598270406; cv=none; d=zohomail.com; s=zohoarc; b=bpSXoO8OKS7xtYxsPp3YPwGFlebG3l1Pn0gkqSX+aJDsqpQ1+Aat2v9KrzmsBxeSMWSmlV9hFhYfyf+GoTADHTyDyAnb1mJhSxXoqX2LkOcWsCbgD0vAKk7549g72GSvTGCMeRW7to8x+QfazDskz8+RSuxj97cGggqLufPR4MY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598270406; h=Content-Type:Content-Transfer-Encoding:Cc: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; bh=OZkGTd1Ojz0GgaBgtR3P/gioRiQKv6MbvPjmw0AEwkA=; b=BFLvpBTLBJujVU7zvPdeNDke9u0IZ7Vm4lzG4zbuqgLg6sh5VPhRFGDKcMPQv567G6xNmdelU7Wgu9cDk6Q+0p7KKr12mjXhlGlHY3OzmsZvPSLenkOrZFE7uG0sYBPfdzOWYJWXkys6BYLg91gdZb9aI6PF7EoLkUHkNTTxjzY= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1598270406788358.09499170424556; Mon, 24 Aug 2020 05:00:06 -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-513-o3wrv8Y7NVCWbo15o4kegw-1; Mon, 24 Aug 2020 08:00:02 -0400 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 BCF30195D563; Mon, 24 Aug 2020 11:59:56 +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 99243808AD; Mon, 24 Aug 2020 11:59: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 6403E1832FC5; Mon, 24 Aug 2020 11:59:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 07OBxSoc029255 for ; Mon, 24 Aug 2020 07:59:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9B1352157F4A; Mon, 24 Aug 2020 11:59:28 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 93EFF2157F24 for ; Mon, 24 Aug 2020 11:59:26 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C94C2101AA44 for ; Mon, 24 Aug 2020 11:59:26 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-139-AcQwLjaVNnqFF1glkQ6B2A-1; Mon, 24 Aug 2020 07:59:24 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07OBW9Ng120717 for ; Mon, 24 Aug 2020 07:59:23 -0400 Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 334c7dsrew-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 24 Aug 2020 07:59:23 -0400 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07OBwGmw016126 for ; Mon, 24 Aug 2020 11:59:21 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma03fra.de.ibm.com with ESMTP id 332utq1d5m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 24 Aug 2020 11:59:21 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07OBvm3666584838 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Aug 2020 11:57:48 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5C18CA4062; Mon, 24 Aug 2020 11:59:18 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3CB4AA405C; Mon, 24 Aug 2020 11:59:18 +0000 (GMT) Received: from m46lp64.lnxne.boe (unknown [9.152.108.100]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 24 Aug 2020 11:59:18 +0000 (GMT) X-MC-Unique: o3wrv8Y7NVCWbo15o4kegw-1 X-MC-Unique: AcQwLjaVNnqFF1glkQ6B2A-1 From: Bjoern Walk To: libvir-list@redhat.com Subject: [PATCH 3/5] virsh: nodedev: ability to filter CSS capabilities Date: Mon, 24 Aug 2020 13:59:13 +0200 Message-Id: <20200824115915.345646-4-bwalk@linux.ibm.com> In-Reply-To: <20200824115915.345646-1-bwalk@linux.ibm.com> References: <20200824115915.345646-1-bwalk@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-08-24_08:2020-08-24, 2020-08-24 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 suspectscore=15 mlxlogscore=813 malwarescore=0 phishscore=0 spamscore=0 lowpriorityscore=0 adultscore=0 bulkscore=0 priorityscore=1501 clxscore=1015 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008240087 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.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Cc: Bjoern Walk , Boris Fiuczynski 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.002 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Boris Fiuczynski Allow to filter for CSS devices. Reviewed-by: Bjoern Walk Signed-off-by: Boris Fiuczynski Reviewed-by: Erik Skultety --- docs/formatnode.html.in | 12 ++++++++++++ docs/manpages/virsh.rst | 2 +- include/libvirt/libvirt-nodedev.h | 1 + src/conf/node_device_conf.h | 3 ++- src/conf/virnodedeviceobj.c | 3 ++- src/libvirt-nodedev.c | 1 + tools/virsh-nodedev.c | 2 ++ 7 files changed, 21 insertions(+), 3 deletions(-) diff --git a/docs/formatnode.html.in b/docs/formatnode.html.in index 8a51c4da..4c7de50a 100644 --- a/docs/formatnode.html.in +++ b/docs/formatnode.html.in @@ -420,6 +420,18 @@
The device number.
+
css
+
Describes a Channel SubSystem (CSS) device commonly found on + the S390 architecture. Sub-elements include: +
+
cssid
+
The channel subsystem identifier.
+
ssid
+
The subchannel-set identifier.
+
devno
+
The device number.
+
+
diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index 5731656b..ee287ac5 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -4908,7 +4908,7 @@ List all of the devices available on the node that ar= e known by libvirt. separated by comma, e.g. --cap pci,scsi. Valid capability types include 'system', 'pci', 'usb_device', 'usb', 'net', 'scsi_host', 'scsi_target', 'scsi', 'storage', 'fc_host', 'vports', 'scsi_generic', 'drm', 'mdev', -'mdev_types', 'ccw'. +'mdev_types', 'ccw', 'css'. If *--tree* is used, the output is formatted in a tree representing parent= s of each node. *cap* and *--tree* are mutually exclusive. =20 diff --git a/include/libvirt/libvirt-nodedev.h b/include/libvirt/libvirt-no= dedev.h index a2ad61ac..dd2ffd57 100644 --- a/include/libvirt/libvirt-nodedev.h +++ b/include/libvirt/libvirt-nodedev.h @@ -81,6 +81,7 @@ typedef enum { VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV_TYPES =3D 1 << 13, /* Capabl= e of mediated devices */ VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV =3D 1 << 14, /* Mediat= ed device */ VIR_CONNECT_LIST_NODE_DEVICES_CAP_CCW_DEV =3D 1 << 15, /* CCW de= vice */ + VIR_CONNECT_LIST_NODE_DEVICES_CAP_CSS_DEV =3D 1 << 16, /* CSS de= vice */ } virConnectListAllNodeDeviceFlags; =20 int virConnectListAllNodeDevices (virConnectPtr conn, diff --git a/src/conf/node_device_conf.h b/src/conf/node_device_conf.h index 47669d42..5484bc34 100644 --- a/src/conf/node_device_conf.h +++ b/src/conf/node_device_conf.h @@ -368,7 +368,8 @@ virNodeDevCapsDefFree(virNodeDevCapsDefPtr caps); VIR_CONNECT_LIST_NODE_DEVICES_CAP_DRM | \ VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV_TYPES | \ VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV | \ - VIR_CONNECT_LIST_NODE_DEVICES_CAP_CCW_DEV) + VIR_CONNECT_LIST_NODE_DEVICES_CAP_CCW_DEV | \ + VIR_CONNECT_LIST_NODE_DEVICES_CAP_CSS_DEV) =20 int virNodeDeviceGetSCSIHostCaps(virNodeDevCapSCSIHostPtr scsi_host); diff --git a/src/conf/virnodedeviceobj.c b/src/conf/virnodedeviceobj.c index e234432b..8aefd15e 100644 --- a/src/conf/virnodedeviceobj.c +++ b/src/conf/virnodedeviceobj.c @@ -861,7 +861,8 @@ virNodeDeviceObjMatch(virNodeDeviceObjPtr obj, MATCH(DRM) || MATCH(MDEV_TYPES) || MATCH(MDEV) || - MATCH(CCW_DEV))) + MATCH(CCW_DEV) || + MATCH(CSS_DEV))) return false; } =20 diff --git a/src/libvirt-nodedev.c b/src/libvirt-nodedev.c index ca6c2bb0..28765b9c 100644 --- a/src/libvirt-nodedev.c +++ b/src/libvirt-nodedev.c @@ -101,6 +101,7 @@ virNodeNumOfDevices(virConnectPtr conn, const char *cap= , unsigned int flags) * VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV_TYPES * VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV * VIR_CONNECT_LIST_NODE_DEVICES_CAP_CCW_DEV + * VIR_CONNECT_LIST_NODE_DEVICES_CAP_CSS_DEV * * Returns the number of node devices found or -1 and sets @devices to NUL= L in * case of error. On success, the array stored into @devices is guarantee= d to diff --git a/tools/virsh-nodedev.c b/tools/virsh-nodedev.c index ff4b7441..9f29181a 100644 --- a/tools/virsh-nodedev.c +++ b/tools/virsh-nodedev.c @@ -462,6 +462,8 @@ cmdNodeListDevices(vshControl *ctl, const vshCmd *cmd G= _GNUC_UNUSED) flags |=3D VIR_CONNECT_LIST_NODE_DEVICES_CAP_CCW_DEV; break; case VIR_NODE_DEV_CAP_CSS_DEV: + flags |=3D VIR_CONNECT_LIST_NODE_DEVICES_CAP_CSS_DEV; + break; case VIR_NODE_DEV_CAP_LAST: break; } --=20 2.24.1 From nobody Fri May 3 17:53:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1598270381; cv=none; d=zohomail.com; s=zohoarc; b=HEklfu/2siY+vjAMHaTiD8ngoYclqp9SaFPfVdv1ERGjodjjfWfV1hh2gwtomI/j0Qgx4sTUYCNsEx7rGP2OL7U3JItEsnp5BIcZbdaUUdmf1p0NTNqXf//EWJYsIijtWi98+0PxUBeZA7/X2M8tS+aSG/erYSpsawABmtpAPnk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598270381; h=Content-Type:Content-Transfer-Encoding:Cc: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; bh=Rdvw12ZC+PQ6OHP4Ruir1fJBgPdWSkGUnRkp3IQ496Q=; b=mrHuF7xUdJQ7lFM/qxgsf+k6Miy9KF3upjd24qakkA1K9PgjVXhmygf8ICNyGbcpWn5pDj6ALYWg6LPZuVLc17Ewo8+mwET5meGy2F3Ace2pq+NnPTIhvwcDDGJTAHFatmhXBXYOQtnByMa5+scOqOvQyeftVaZdbxwfPg9dlO4= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1598270381438258.0205690212981; Mon, 24 Aug 2020 04:59:41 -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-496-PfEBOfmoPI6yHHpwZlZWnQ-1; Mon, 24 Aug 2020 07:59:36 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 48E1C81F013; Mon, 24 Aug 2020 11:59:30 +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 2086378DC0; Mon, 24 Aug 2020 11:59:30 +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 D27CAEC14; Mon, 24 Aug 2020 11:59:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 07OBxSKE029254 for ; Mon, 24 Aug 2020 07:59:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id 995932157F45; Mon, 24 Aug 2020 11:59:28 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 91F5A2166BD9 for ; Mon, 24 Aug 2020 11:59:26 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 47A4090185A for ; Mon, 24 Aug 2020 11:59:26 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-46-aMCIZe-SNbaiTwhVd1FnPg-1; Mon, 24 Aug 2020 07:59:23 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07OBWXis131419 for ; Mon, 24 Aug 2020 07:59:23 -0400 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 334b5cuccm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 24 Aug 2020 07:59:23 -0400 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07OBwMD7023458 for ; Mon, 24 Aug 2020 11:59:21 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma06ams.nl.ibm.com with ESMTP id 332uk6aamk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 24 Aug 2020 11:59:21 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07OBvm9w64225720 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Aug 2020 11:57:48 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8FD72A405C; Mon, 24 Aug 2020 11:59:18 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 71330A405B; Mon, 24 Aug 2020 11:59:18 +0000 (GMT) Received: from m46lp64.lnxne.boe (unknown [9.152.108.100]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 24 Aug 2020 11:59:18 +0000 (GMT) X-MC-Unique: PfEBOfmoPI6yHHpwZlZWnQ-1 X-MC-Unique: aMCIZe-SNbaiTwhVd1FnPg-1 From: Bjoern Walk To: libvir-list@redhat.com Subject: [PATCH 4/5] node_device: detect DASD devices Date: Mon, 24 Aug 2020 13:59:14 +0200 Message-Id: <20200824115915.345646-5-bwalk@linux.ibm.com> In-Reply-To: <20200824115915.345646-1-bwalk@linux.ibm.com> References: <20200824115915.345646-1-bwalk@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-08-24_08:2020-08-24, 2020-08-24 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 mlxlogscore=999 impostorscore=0 priorityscore=1501 mlxscore=0 malwarescore=0 adultscore=0 suspectscore=1 bulkscore=0 phishscore=0 spamscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008240087 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.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Cc: Bjoern Walk , Boris Fiuczynski 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.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Boris Fiuczynski Make Direct Access Storage Devices (DASDs) available in the node_device dri= ver. Reviewed-by: Bjoern Walk Signed-off-by: Boris Fiuczynski Reviewed-by: Erik Skultety --- src/node_device/node_device_udev.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_devi= ce_udev.c index 1c4df709..5f9d67cc 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -871,6 +871,19 @@ udevProcessSD(struct udev_device *device, } =20 =20 +static int +udevProcessDasd(struct udev_device *device, + virNodeDeviceDefPtr def) +{ + virNodeDevCapStoragePtr storage =3D &def->caps->data.storage; + + if (udevGetStringSysfsAttr(device, "device/uid", &storage->serial) < 0) + return -1; + + return udevProcessDisk(device, def); +} + + /* This function exists to deal with the case in which a driver does * not provide a device type in the usual place, but udev told us it's * a storage device, and we can make a good guess at what kind of @@ -891,6 +904,15 @@ udevKludgeStorageType(virNodeDeviceDefPtr def) def->sysfs_path); return 0; } + /* dasd disk */ + if (STRPREFIX(def->caps->data.storage.block, "/dev/dasd")) { + def->caps->data.storage.drive_type =3D g_strdup("dasd"); + VIR_DEBUG("Found storage type '%s' for device " + "with sysfs path '%s'", + def->caps->data.storage.drive_type, + def->sysfs_path); + return 0; + } VIR_DEBUG("Could not determine storage type " "for device with sysfs path '%s'", def->sysfs_path); return -1; @@ -978,6 +1000,8 @@ udevProcessStorage(struct udev_device *device, ret =3D udevProcessFloppy(device, def); } else if (STREQ(def->caps->data.storage.drive_type, "sd")) { ret =3D udevProcessSD(device, def); + } else if (STREQ(def->caps->data.storage.drive_type, "dasd")) { + ret =3D udevProcessDasd(device, def); } else { VIR_DEBUG("Unsupported storage type '%s'", def->caps->data.storage.drive_type); --=20 2.24.1 From nobody Fri May 3 17:53:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1598270433; cv=none; d=zohomail.com; s=zohoarc; b=lnex1W7sGqXVvWl1S8pPJSNNVC04UKVC+SzC9J0fe1hXYo2d+QzxtINCz2Mwj67NBmYQdaExFUSBomhmBnPucXydIc0TPQ6Gk7us4LoF/ycyIlydLFQ6XejdfQ5cR7AeJLSBKMhNGxGr44w1pOHdLKp3CWeaYs7iXMkTAwePoNo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598270433; h=Content-Type:Content-Transfer-Encoding:Cc: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; bh=YXygsfQfcsoUFaC1OSoIDVet/FId8oFtwHzdlJM5lbc=; b=AyBj0o7QUj3fAq220/kxDN9SF8YomoXKQS8GfcptWK9vutpaC6+reMWy1n/mCshNhSOC4whNZXjYpjmkfvYplQMU0uugPSWlXpH8zleMox7Hz7IP0Ttq+8LRDFKY0EUzJYcMWvaTwxxuhtRYiNHtrEAfxfexpZVN5zQMB1JaztQ= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 15982704329791016.4707516411528; Mon, 24 Aug 2020 05:00:32 -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-540-jRp9dlF2N_uLZJONFToKnQ-1; Mon, 24 Aug 2020 08:00:24 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 535FF801AB3; Mon, 24 Aug 2020 12:00:18 +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 2F5B47C675; Mon, 24 Aug 2020 12:00:18 +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 E9E2C1832FE2; Mon, 24 Aug 2020 12:00:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 07OBxTbr029285 for ; Mon, 24 Aug 2020 07:59:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id C50D11110285; Mon, 24 Aug 2020 11:59:29 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C05161110284 for ; Mon, 24 Aug 2020 11:59:27 +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-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 847EF80088F for ; Mon, 24 Aug 2020 11:59:27 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-344-gMHTkeaZO5ycc0kBDNs1uw-1; Mon, 24 Aug 2020 07:59:25 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07OBWMaM099512 for ; Mon, 24 Aug 2020 07:59:24 -0400 Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 334bc73ck6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 24 Aug 2020 07:59:23 -0400 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07OBvnPV002808 for ; Mon, 24 Aug 2020 11:59:21 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma03ams.nl.ibm.com with ESMTP id 332ujktahs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 24 Aug 2020 11:59:21 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07OBvmGX59572536 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Aug 2020 11:57:49 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C4B5BA4065; Mon, 24 Aug 2020 11:59:18 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A5765A4062; Mon, 24 Aug 2020 11:59:18 +0000 (GMT) Received: from m46lp64.lnxne.boe (unknown [9.152.108.100]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 24 Aug 2020 11:59:18 +0000 (GMT) X-MC-Unique: jRp9dlF2N_uLZJONFToKnQ-1 X-MC-Unique: gMHTkeaZO5ycc0kBDNs1uw-1 From: Bjoern Walk To: libvir-list@redhat.com Subject: [PATCH 5/5] node_device: mdev vfio-ccw support Date: Mon, 24 Aug 2020 13:59:15 +0200 Message-Id: <20200824115915.345646-6-bwalk@linux.ibm.com> In-Reply-To: <20200824115915.345646-1-bwalk@linux.ibm.com> References: <20200824115915.345646-1-bwalk@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-08-24_08:2020-08-24, 2020-08-24 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 spamscore=0 mlxscore=0 adultscore=0 lowpriorityscore=0 clxscore=1015 malwarescore=0 suspectscore=1 phishscore=0 mlxlogscore=799 priorityscore=1501 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008240087 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.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: Bjoern Walk , Boris Fiuczynski 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.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Boris Fiuczynski Allow vfio-ccw mdev devices to be created besides vfio-pci mdev devices as well. Reviewed-by: Bjoern Walk Signed-off-by: Boris Fiuczynski --- src/conf/domain_addr.c | 2 +- src/conf/domain_addr.h | 3 ++ src/libvirt_private.syms | 1 + src/node_device/node_device_driver.c | 49 +++++++++++++++++++++++----- 4 files changed, 45 insertions(+), 10 deletions(-) diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c index 1068cbf1..1bfa164a 100644 --- a/src/conf/domain_addr.c +++ b/src/conf/domain_addr.c @@ -1365,7 +1365,7 @@ virDomainPCIAddressSetAllMulti(virDomainDefPtr def) } =20 =20 -static char* +char* virDomainCCWAddressAsString(virDomainDeviceCCWAddressPtr addr) { return g_strdup_printf("%x.%x.%04x", addr->cssid, addr->ssid, addr->de= vno); diff --git a/src/conf/domain_addr.h b/src/conf/domain_addr.h index c1363c14..a0460b40 100644 --- a/src/conf/domain_addr.h +++ b/src/conf/domain_addr.h @@ -208,6 +208,9 @@ int virDomainCCWAddressAssign(virDomainDeviceInfoPtr de= v, ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); void virDomainCCWAddressSetFree(virDomainCCWAddressSetPtr addrs); =20 +char* virDomainCCWAddressAsString(virDomainDeviceCCWAddressPtr addr) + ATTRIBUTE_NONNULL(1); + virDomainCCWAddressSetPtr virDomainCCWAddressSetCreateFromDomain(virDomainDefPtr def) ATTRIBUTE_NONNULL(1); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 01c2e710..e1342569 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -143,6 +143,7 @@ virPCIDeviceAddressParseXML; =20 # conf/domain_addr.h virDomainCCWAddressAssign; +virDomainCCWAddressAsString; virDomainCCWAddressSetCreateFromDomain; virDomainCCWAddressSetFree; virDomainPCIAddressBusIsFullyReserved; diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_de= vice_driver.c index e89c8b0e..bee2ef93 100644 --- a/src/node_device/node_device_driver.c +++ b/src/node_device/node_device_driver.c @@ -28,6 +28,7 @@ =20 #include "virerror.h" #include "datatypes.h" +#include "domain_addr.h" #include "viralloc.h" #include "virfile.h" #include "virjson.h" @@ -628,7 +629,7 @@ nodeDeviceFindAddressByName(const char *name) { virNodeDeviceDefPtr def =3D NULL; virNodeDevCapsDefPtr caps =3D NULL; - char *pci_addr =3D NULL; + char *addr =3D NULL; virNodeDeviceObjPtr dev =3D virNodeDeviceObjListFindByName(driver->dev= s, name); =20 if (!dev) { @@ -639,22 +640,52 @@ nodeDeviceFindAddressByName(const char *name) =20 def =3D virNodeDeviceObjGetDef(dev); for (caps =3D def->caps; caps !=3D NULL; caps =3D caps->next) { - if (caps->data.type =3D=3D VIR_NODE_DEV_CAP_PCI_DEV) { - virPCIDeviceAddress addr =3D { + switch ((virNodeDevCapType) caps->data.type) { + case VIR_NODE_DEV_CAP_PCI_DEV: { + virPCIDeviceAddress pci_addr =3D { .domain =3D caps->data.pci_dev.domain, .bus =3D caps->data.pci_dev.bus, .slot =3D caps->data.pci_dev.slot, .function =3D caps->data.pci_dev.function }; =20 - pci_addr =3D virPCIDeviceAddressAsString(&addr); + addr =3D virPCIDeviceAddressAsString(&pci_addr); break; } + case VIR_NODE_DEV_CAP_CSS_DEV: { + virDomainDeviceCCWAddress ccw_addr =3D { + .cssid =3D caps->data.ccw_dev.cssid, + .ssid =3D caps->data.ccw_dev.ssid, + .devno =3D caps->data.ccw_dev.devno + }; + + addr =3D virDomainCCWAddressAsString(&ccw_addr); + break; + } + + case VIR_NODE_DEV_CAP_SYSTEM: + case VIR_NODE_DEV_CAP_USB_DEV: + case VIR_NODE_DEV_CAP_USB_INTERFACE: + case VIR_NODE_DEV_CAP_NET: + case VIR_NODE_DEV_CAP_SCSI_HOST: + case VIR_NODE_DEV_CAP_SCSI_TARGET: + case VIR_NODE_DEV_CAP_SCSI: + case VIR_NODE_DEV_CAP_STORAGE: + case VIR_NODE_DEV_CAP_FC_HOST: + case VIR_NODE_DEV_CAP_VPORTS: + case VIR_NODE_DEV_CAP_SCSI_GENERIC: + case VIR_NODE_DEV_CAP_DRM: + case VIR_NODE_DEV_CAP_MDEV_TYPES: + case VIR_NODE_DEV_CAP_MDEV: + case VIR_NODE_DEV_CAP_CCW_DEV: + case VIR_NODE_DEV_CAP_LAST: + continue; + } } =20 virNodeDeviceObjEndAPI(&dev); =20 - return pci_addr; + return addr; } =20 =20 @@ -664,11 +695,11 @@ nodeDeviceGetMdevctlStartCommand(virNodeDeviceDefPtr = def, { virCommandPtr cmd; g_autofree char *json =3D NULL; - g_autofree char *parent_pci =3D nodeDeviceFindAddressByName(def->paren= t); + g_autofree char *parent_addr =3D nodeDeviceFindAddressByName(def->pare= nt); =20 - if (!parent_pci) { + if (!parent_addr) { virReportError(VIR_ERR_NO_NODE_DEVICE, - _("unable to find PCI address for parent device '%s= '"), def->parent); + _("unable to find address for parent device '%s'"),= def->parent); return NULL; } =20 @@ -679,7 +710,7 @@ nodeDeviceGetMdevctlStartCommand(virNodeDeviceDefPtr de= f, } =20 cmd =3D virCommandNewArgList(MDEVCTL, "start", - "-p", parent_pci, + "-p", parent_addr, "--jsonfile", "/dev/stdin", NULL); =20 --=20 2.24.1