From nobody Fri Apr 26 04:00:06 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=1600110754; cv=none; d=zohomail.com; s=zohoarc; b=Y71E+U0zQwz9G+mYNHpyFtpULDejW/1BG8g4VfEGSUkESf9SHouakUxWj6AEzKko3YF8sMC2NvYgCiUHMvkzA2+7+U7vM9Un0i3eGWS2aE3k4CbZZb8lRCsqU3mv0OrR59RbubjO2KMdBSvRs2HSwWP+r74ODr/UIwqTp9id2Rs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600110754; 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=7tcDFNe6leYUlLHbVArdBmI42Ofdym+8rvIYoLdzntw=; b=HH7IC4byEeUXFD6okHOF2bOwFaDtQFsl8A78olPn5XtSRu0awNZEfvN2NFDwOANtfRJdJQICshRPNvkF1mUPWXmBeRyxA+3ITCnQBi+QBgEqsEp9QWbBy4mVWS4NeUMN/ifeBE75F4nmRKBOC7tbiw3zVTgfZMPHytIHhv2YXfA= 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 160011075411869.93858913876477; Mon, 14 Sep 2020 12:12:34 -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-449-1zXmqK67OsaUB-DG5mbhOA-1; Mon, 14 Sep 2020 15:12:30 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 58439801ADE; Mon, 14 Sep 2020 19:12:24 +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 34DCA5DA60; Mon, 14 Sep 2020 19:12:24 +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 0261B8C7D8; Mon, 14 Sep 2020 19:12:24 +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 08EJC8Cr027589 for ; Mon, 14 Sep 2020 15:12:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id 15355AB40A; Mon, 14 Sep 2020 19:12:08 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0FAD0AB594 for ; Mon, 14 Sep 2020 19:12:04 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (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 04E1F830D3F for ; Mon, 14 Sep 2020 19:12:04 +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-511-KRxfXmM1NBG_w2WFLdWUIw-1; Mon, 14 Sep 2020 15:11:59 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 08EJ1djs190021; Mon, 14 Sep 2020 15:11:58 -0400 Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0b-001b2d01.pphosted.com with ESMTP id 33jd63j574-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Sep 2020 15:11:58 -0400 Received: from pps.filterd (ppma06fra.de.ibm.com [127.0.0.1]) by ppma06fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 08EJ6qkl015619; Mon, 14 Sep 2020 19:11:56 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma06fra.de.ibm.com with ESMTP id 33hjgdrptg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Sep 2020 19:11:56 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 08EJBrCK24510886 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 Sep 2020 19:11:53 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C8E0A4C04E; Mon, 14 Sep 2020 19:11:53 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9C9EE4C058; Mon, 14 Sep 2020 19:11:53 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.25.78]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 14 Sep 2020 19:11:53 +0000 (GMT) X-MC-Unique: 1zXmqK67OsaUB-DG5mbhOA-1 X-MC-Unique: KRxfXmM1NBG_w2WFLdWUIw-1 From: Boris Fiuczynski To: libvir-list@redhat.com Subject: [PATCH v2 1/5] node_device: refactor udevProcessCCW Date: Mon, 14 Sep 2020 21:11:43 +0200 Message-Id: <20200914191147.15713-2-fiuczy@linux.ibm.com> In-Reply-To: <20200914191147.15713-1-fiuczy@linux.ibm.com> References: <20200914191147.15713-1-fiuczy@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-09-14_07:2020-09-14, 2020-09-14 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 lowpriorityscore=0 bulkscore=0 suspectscore=1 adultscore=0 priorityscore=1501 phishscore=0 clxscore=1015 impostorscore=0 mlxlogscore=999 spamscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009140146 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: bwalk@linux.ibm.com, cohuck@redhat.com, eskultet@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.14 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" Refactor out CCW address parsing for later reuse. Reviewed-by: Erik Skultety Reviewed-by: Bjoern Walk Signed-off-by: Boris Fiuczynski --- 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 ff558efb83..d478a673fd 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.25.1 From nobody Fri Apr 26 04:00:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1600110739; cv=none; d=zohomail.com; s=zohoarc; b=Tt4rPz8j4JQ+lxwZgUQlIiDYRGuQFbJnfRRBBi0ZwXr55jTSoH57xBaiYtku5UV49fIdNVmBlK0Hf0rcH+OcHiKERVVopzLm8kmvo7PWtwS6ZwiojlZenAVgMT2wWe2AY5tHWCVsJNYyKCKVvqd4j2rMGAryCeSWzS9szgZTNEY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600110739; 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=RmZPaELQD4rpSx1fPxXo2ogpbl/Y5epakU3Y5MxCGUU=; b=a2/8ks9xfZtrUOd7Gt55javDCaoQyligG68PJSYDTatyoT2duR/b2/zANQF98ooxdphkv631o4ZRFhxXNy+UoI+ElVMZlyRtjTpoO2gkYBmrTvr8cqmtVugiao8p1LnBiUaCAVrjP/agvzHn9ogFo1Zkt9ipGgYBBMxNLY68GlE= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1600110739316318.9321998970271; Mon, 14 Sep 2020 12:12:19 -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-F07yhfTeMPO4iUex4cP8sQ-1; Mon, 14 Sep 2020 15:12:15 -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 3DE04800402; Mon, 14 Sep 2020 19:12:10 +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 77B907B7B6; Mon, 14 Sep 2020 19:12:09 +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 806BD1832FE6; Mon, 14 Sep 2020 19:12:06 +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 08EJC4is027504 for ; Mon, 14 Sep 2020 15:12:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id 42985100402E; Mon, 14 Sep 2020 19:12:04 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3CBA71004146 for ; Mon, 14 Sep 2020 19:12:01 +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 756BE18AE948 for ; Mon, 14 Sep 2020 19:12:01 +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-454-CPGb-HmBMeetkcqfYsFH7w-1; Mon, 14 Sep 2020 15:11:59 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 08EJ1I25055563; Mon, 14 Sep 2020 15:11:58 -0400 Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0b-001b2d01.pphosted.com with ESMTP id 33jdrus59a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Sep 2020 15:11:58 -0400 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 08EJ6XIs028968; Mon, 14 Sep 2020 19:11:56 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma01fra.de.ibm.com with ESMTP id 33hkfagp9k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Sep 2020 19:11:56 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 08EJBsLU18678082 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 Sep 2020 19:11:54 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0F20D4C05C; Mon, 14 Sep 2020 19:11:54 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D55DC4C05A; Mon, 14 Sep 2020 19:11:53 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.25.78]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 14 Sep 2020 19:11:53 +0000 (GMT) X-MC-Unique: F07yhfTeMPO4iUex4cP8sQ-1 X-MC-Unique: CPGb-HmBMeetkcqfYsFH7w-1 From: Boris Fiuczynski To: libvir-list@redhat.com Subject: [PATCH v2 2/5] node_device: detect CSS devices Date: Mon, 14 Sep 2020 21:11:44 +0200 Message-Id: <20200914191147.15713-3-fiuczy@linux.ibm.com> In-Reply-To: <20200914191147.15713-1-fiuczy@linux.ibm.com> References: <20200914191147.15713-1-fiuczy@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-09-14_07:2020-09-14, 2020-09-14 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 priorityscore=1501 clxscore=1015 malwarescore=0 phishscore=0 impostorscore=0 suspectscore=3 adultscore=0 bulkscore=0 mlxscore=0 spamscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009140146 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: bwalk@linux.ibm.com, cohuck@redhat.com, eskultet@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.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" 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 Reviewed-by: Erik Skultety --- 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 4b2b350fd8..f7f517b548 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 f6a91165c9..a9a03ad6c2 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 9b8c7aadea..47669d4294 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 bfd524121c..e234432b6f 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 d478a673fd..38906f5f96 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) +{ + /* only process IO subchannel and vfio-ccw devices to keep the list sa= ne */ + if (STRNEQ(def->driver, "io_subchannel") && + STRNEQ(def->driver, "vfio_ccw")) + 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 d840555c09..f3cf0c1c66 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 5ecd0b0aae..3b8ea46e37 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 0000000000..312e07fe65 --- /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 6168c29c70..3cb23b1df4 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 e9414f429f..d497fa9797 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.25.1 From nobody Fri Apr 26 04:00:06 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=1600110754; cv=none; d=zohomail.com; s=zohoarc; b=HCORlXKx/7nT+tFITH7Bywo5nhS2ZPthSq4KfUFNidE9GZ0AzSPyYYG0QVsBjqphCQe07Hw7wMZKDCaJ3LiJsOEzszGADtKoiwCYBmkrJiMVDcQWH9COrWoQYgfiUx7wfNhmpnTKH/A0pIyfFmvvD/gcOof0PJmV1njO7Py3TQo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600110754; 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=eTFcWGiQ3dNBB37HYByTSfzCowFP1HYdwg3ZZjjz8GY=; b=n3rAroWBm4hKxMk4YfB0zoR9Kx/GKc7LbhQPqkS2VkafuxNOhfqV+bZuTkifWHVXOYCnZ/lmifz9ZA/NepRTYOeal/3LCfTDNLRTfevJX1K1dPrU2fJvYp2f1I1YxLVxc73dts9Uiulq4xD+GFEn/XCwhdSTTEqZZ2VDCpsj6IM= 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 1600110754798466.46319478667317; Mon, 14 Sep 2020 12:12:34 -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-451-Ia014_S5PvKyd1S-kyMVog-1; Mon, 14 Sep 2020 15:12:31 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5FE2EAD682; Mon, 14 Sep 2020 19:12:24 +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 3915427CC3; Mon, 14 Sep 2020 19:12:24 +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 00C771832FF5; Mon, 14 Sep 2020 19:12:23 +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 08EJC6gO027550 for ; Mon, 14 Sep 2020 15:12:06 -0400 Received: by smtp.corp.redhat.com (Postfix) id 86CEA2166B28; Mon, 14 Sep 2020 19:12:06 +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 817952157F23 for ; Mon, 14 Sep 2020 19:12:05 +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 C4C39858282 for ; Mon, 14 Sep 2020 19:12:05 +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-290-gXMno9LpMBCX0H7QzNxv4A-1; Mon, 14 Sep 2020 15:12:01 -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 08EIgsUF172037; Mon, 14 Sep 2020 15:11:59 -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 33je1h0r93-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Sep 2020 15:11:59 -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 08EJ8Ewt007388; Mon, 14 Sep 2020 19:11:57 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma03ams.nl.ibm.com with ESMTP id 33gny8amaj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Sep 2020 19:11:56 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 08EJBs1c19136930 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 Sep 2020 19:11:54 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 539994C05C; Mon, 14 Sep 2020 19:11:54 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 26B384C044; Mon, 14 Sep 2020 19:11:54 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.25.78]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 14 Sep 2020 19:11:54 +0000 (GMT) X-MC-Unique: Ia014_S5PvKyd1S-kyMVog-1 X-MC-Unique: gXMno9LpMBCX0H7QzNxv4A-1 From: Boris Fiuczynski To: libvir-list@redhat.com Subject: [PATCH v2 3/5] virsh: nodedev: ability to filter CSS capabilities Date: Mon, 14 Sep 2020 21:11:45 +0200 Message-Id: <20200914191147.15713-4-fiuczy@linux.ibm.com> In-Reply-To: <20200914191147.15713-1-fiuczy@linux.ibm.com> References: <20200914191147.15713-1-fiuczy@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-09-14_07:2020-09-14, 2020-09-14 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 mlxlogscore=896 bulkscore=0 clxscore=1015 mlxscore=0 suspectscore=15 spamscore=0 malwarescore=0 phishscore=0 lowpriorityscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009140144 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: bwalk@linux.ibm.com, cohuck@redhat.com, eskultet@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.23 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" Allow to filter for CSS devices. Reviewed-by: Bjoern Walk Reviewed-by: Erik Skultety Signed-off-by: Boris Fiuczynski --- 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 8a51c4da80..4c7de50a0b 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 dde572ac79..9fd5efed0f 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -4964,7 +4964,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 a2ad61ac6d..dd2ffd5782 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 47669d4294..5484bc340f 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 e234432b6f..8aefd15e94 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 ca6c2bb057..28765b9c30 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 d497fa9797..2edd403a64 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.25.1 From nobody Fri Apr 26 04:00:06 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=1600110738; cv=none; d=zohomail.com; s=zohoarc; b=CDEcNg1/D48LR9y2UHb2tr/lS8/XIwJbLv2/kDWOmPDxMlewOI35gxDSSPjVmPAWb2WD1K9m9NN8Ns9IWZtpV0dwkslVJIDUfVUsP7Q7I++GZwb5sGmd+TD8Kn8ZJUU9Mjh6dr51Z5cdsvcyQ1Ib7VqXn8m+KYwaWwgBbdkLiMQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600110738; 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=cpSJy1AbF/wwqwuxxFnx8k1ahYUOk8SndoZcXJT6nqw=; b=AgE0UFi2X9b6dd8PVHj8R5k2rSfZVWkBNjN+kVAaBi05wB0U57KuEqs47x9IRzQii26/YIQutbZ7d5ohb/EnVN3sTWjS6jOgDehphp1qMKiR5zFwhtzJvd+MDpDhy7KppqhwPGdEXjylXK/ZKYerdvj9RFda9rWLdW8VJ92tMPE= 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 1600110738512198.09961487509952; Mon, 14 Sep 2020 12:12:18 -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-408-LEjDugccOdWY2mN9TdwaBg-1; Mon, 14 Sep 2020 15:12:15 -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 3407A100670B; Mon, 14 Sep 2020 19:12:10 +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 8127A5F9D4; Mon, 14 Sep 2020 19:12:09 +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 4BE098C7C7; Mon, 14 Sep 2020 19:12:06 +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 08EJC4So027503 for ; Mon, 14 Sep 2020 15:12:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id 42C03100405C; Mon, 14 Sep 2020 19:12:04 +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 3CE191004157 for ; Mon, 14 Sep 2020 19:12:04 +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 0B90E801213 for ; Mon, 14 Sep 2020 19:12:04 +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-497-yb_b1ee8MgSiJWoRJB17-Q-1; Mon, 14 Sep 2020 15:11:59 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 08EJ18Ds002697; Mon, 14 Sep 2020 15:11:58 -0400 Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0b-001b2d01.pphosted.com with ESMTP id 33jcs6tm98-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Sep 2020 15:11:58 -0400 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 08EJ6m5r010995; Mon, 14 Sep 2020 19:11:57 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma04fra.de.ibm.com with ESMTP id 33guvm17ad-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Sep 2020 19:11:56 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 08EJBssP20447602 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 Sep 2020 19:11:54 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8ECF04C046; Mon, 14 Sep 2020 19:11:54 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 618EA4C059; Mon, 14 Sep 2020 19:11:54 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.25.78]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 14 Sep 2020 19:11:54 +0000 (GMT) X-MC-Unique: LEjDugccOdWY2mN9TdwaBg-1 X-MC-Unique: yb_b1ee8MgSiJWoRJB17-Q-1 From: Boris Fiuczynski To: libvir-list@redhat.com Subject: [PATCH v2 4/5] node_device: detect DASD devices Date: Mon, 14 Sep 2020 21:11:46 +0200 Message-Id: <20200914191147.15713-5-fiuczy@linux.ibm.com> In-Reply-To: <20200914191147.15713-1-fiuczy@linux.ibm.com> References: <20200914191147.15713-1-fiuczy@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-09-14_07:2020-09-14, 2020-09-14 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 lowpriorityscore=0 clxscore=1015 spamscore=0 suspectscore=1 mlxscore=0 bulkscore=0 phishscore=0 impostorscore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009140146 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: bwalk@linux.ibm.com, cohuck@redhat.com, eskultet@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.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" Make Direct Access Storage Devices (DASDs) available in the node_device dri= ver. Reviewed-by: Bjoern Walk Reviewed-by: Erik Skultety Signed-off-by: Boris Fiuczynski --- src/node_device/node_device_udev.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_devi= ce_udev.c index 38906f5f96..023377fc01 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,18 @@ udevKludgeStorageType(virNodeDeviceDefPtr def) def->sysfs_path); return 0; } + /* For Direct Access Storage Devices (DASDs) there are + * currently no identifies in udev besides ID_PATH. Since + * ID_TYPE=3Ddisk does not exist on DASDs they fall through + * the udevProcessStorage detection logic. */ + 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 +1003,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.25.1 From nobody Fri Apr 26 04:00:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1600110742; cv=none; d=zohomail.com; s=zohoarc; b=SIdpcr1X/R+4UB1YlTLgwy3n6KRIa7szb9b+PrRr03/Hcd8idpFVm+ZDwdHhSbIL+I/hf87JUdlPnluPQbqKYbh+sj1MhM4DBSMpGw3dRIy9vriUMymD9TivKeGO4Z9tTeecRGY+EoMcJLhjUkOh/Vim61h92bGt5VkAh7z0QsM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600110742; 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=ZxxXPbO77uBJhIDbLwmioMbYqzZwxf3562Xx84jxcc4=; b=CdJv3csoHe1ymg7T43mDFYbTGD3xAO6WISRQ8Ugz7r7ONqnLV8UONBuriygbFs77F3sUoCStcRtEDcgVx0ddDiINq6Hc2/Ly2mXN4KoDjromThhXIMoqyttEHrHRAMnbRzX5Qg6i2lQQbgaxeNFBkyM3tiK6OZB75wmmDUR7H/M= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1600110742184951.6173371029074; Mon, 14 Sep 2020 12:12:22 -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-395-fAYmfG7COUOIfuQsxnYQ7A-1; Mon, 14 Sep 2020 15:12:18 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id E140B85C707; Mon, 14 Sep 2020 19:12: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 BDE2F5DA84; Mon, 14 Sep 2020 19:12: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 85C718C7CB; Mon, 14 Sep 2020 19:12:12 +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 08EJC6lS027538 for ; Mon, 14 Sep 2020 15:12:06 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2097FAB41D; Mon, 14 Sep 2020 19:12:06 +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 1B975AB596 for ; Mon, 14 Sep 2020 19:12:05 +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 741DC801226 for ; Mon, 14 Sep 2020 19:12:05 +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-121-G9y-Om2YM6WXci3kiql03g-1; Mon, 14 Sep 2020 15:12:01 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 08EJ6wTn039599; Mon, 14 Sep 2020 15:11:59 -0400 Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0a-001b2d01.pphosted.com with ESMTP id 33jb7b5tnx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Sep 2020 15:11:59 -0400 Received: from pps.filterd (ppma06fra.de.ibm.com [127.0.0.1]) by ppma06fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 08EJ88v6016479; Mon, 14 Sep 2020 19:11:57 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma06fra.de.ibm.com with ESMTP id 33hjgdrpth-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Sep 2020 19:11:57 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 08EJBsGY20578770 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 Sep 2020 19:11:55 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C834E4C040; Mon, 14 Sep 2020 19:11:54 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9ACD64C05E; Mon, 14 Sep 2020 19:11:54 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.25.78]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 14 Sep 2020 19:11:54 +0000 (GMT) X-MC-Unique: fAYmfG7COUOIfuQsxnYQ7A-1 X-MC-Unique: G9y-Om2YM6WXci3kiql03g-1 From: Boris Fiuczynski To: libvir-list@redhat.com Subject: [PATCH v2 5/5] node_device: mdev vfio-ccw support Date: Mon, 14 Sep 2020 21:11:47 +0200 Message-Id: <20200914191147.15713-6-fiuczy@linux.ibm.com> In-Reply-To: <20200914191147.15713-1-fiuczy@linux.ibm.com> References: <20200914191147.15713-1-fiuczy@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-09-14_07:2020-09-14, 2020-09-14 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=1 bulkscore=0 lowpriorityscore=0 phishscore=0 impostorscore=0 mlxscore=0 adultscore=0 malwarescore=0 priorityscore=1501 spamscore=0 mlxlogscore=973 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009140147 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: bwalk@linux.ibm.com, cohuck@redhat.com, eskultet@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.14 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" Allow vfio-ccw mdev devices to be created besides vfio-pci mdev devices as well. Reviewed-by: Bjoern Walk Signed-off-by: Boris Fiuczynski Reviewed-by: Erik Skultety --- src/conf/domain_addr.c | 2 +- src/conf/domain_addr.h | 3 +++ src/libvirt_private.syms | 1 + src/node_device/node_device_driver.c | 26 ++++++++++++++++++-------- 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c index 1068cbf1d2..1bfa164a47 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 c1363c1490..a0460b4030 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 5f1aea3694..5842b8d23d 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 e89c8b0ee5..375c1fff32 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) { @@ -640,21 +641,30 @@ nodeDeviceFindAddressByName(const char *name) 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 { + 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; + } else if (caps->data.type =3D=3D 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; } } =20 virNodeDeviceObjEndAPI(&dev); =20 - return pci_addr; + return addr; } =20 =20 @@ -664,11 +674,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 parent device '%s'"), def->parent= ); return NULL; } =20 @@ -679,7 +689,7 @@ nodeDeviceGetMdevctlStartCommand(virNodeDeviceDefPtr de= f, } =20 cmd =3D virCommandNewArgList(MDEVCTL, "start", - "-p", parent_pci, + "-p", parent_addr, "--jsonfile", "/dev/stdin", NULL); =20 --=20 2.25.1