From nobody Thu May 16 02:26:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.ibm.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1647334627201643.0868616867812; Tue, 15 Mar 2022 01:57:07 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-649-djuVm4coMoSbCDx2tB0zbg-1; Tue, 15 Mar 2022 04:57:06 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 63C63805F0E; Tue, 15 Mar 2022 08:57:04 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id C862C7CB81A; Tue, 15 Mar 2022 08:57:03 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9F1021953550; Tue, 15 Mar 2022 08:57:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8BCCD194E021 for ; Tue, 15 Mar 2022 08:57:02 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 405F7401E6F; Tue, 15 Mar 2022 08:57:02 +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 3C166401E64 for ; Tue, 15 Mar 2022 08:57:02 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 22E1A803D65 for ; Tue, 15 Mar 2022 08:57:02 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-558-MwCv5jpoPbOFvc7zYq8Wxg-1; Tue, 15 Mar 2022 04:56:58 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 22F7WumZ013366; Tue, 15 Mar 2022 08:56:57 GMT 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 3etf5rry73-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 15 Mar 2022 08:56:56 +0000 Received: from pps.filterd (ppma05fra.de.ibm.com [127.0.0.1]) by ppma05fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 22F8rE4p006326; Tue, 15 Mar 2022 08:56:54 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma05fra.de.ibm.com with ESMTP id 3erk58n6kv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 15 Mar 2022 08:56:54 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 22F8uq6L45547820 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 15 Mar 2022 08:56:52 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0F612A405B; Tue, 15 Mar 2022 08:56:52 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E4889A405F; Tue, 15 Mar 2022 08:56:51 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.180.72]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 15 Mar 2022 08:56:51 +0000 (GMT) X-MC-Unique: djuVm4coMoSbCDx2tB0zbg-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: MwCv5jpoPbOFvc7zYq8Wxg-1 From: Boris Fiuczynski To: libvir-list@redhat.com Subject: [PATCH 1/3] virnodedeviceobj: export virNodeDeviceObjHasCap Date: Tue, 15 Mar 2022 09:56:44 +0100 Message-Id: <20220315085646.5963-2-fiuczy@linux.ibm.com> In-Reply-To: <20220315085646.5963-1-fiuczy@linux.ibm.com> References: <20220315085646.5963-1-fiuczy@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: oDdWdBPMV1nxIYL-wCrUDBr-yDHrBdAD X-Proofpoint-GUID: oDdWdBPMV1nxIYL-wCrUDBr-yDHrBdAD X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.850,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-03-14_14,2022-03-14_02,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 clxscore=1011 spamscore=0 phishscore=0 priorityscore=1501 adultscore=0 lowpriorityscore=0 bulkscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2203150055 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.85 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jjongsma@redhat.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1647334629531100001 Content-Type: text/plain; charset="utf-8" The function will be reused in the nodedev drivers udev handling. Signed-off-by: Boris Fiuczynski --- src/conf/virnodedeviceobj.c | 3 +-- src/conf/virnodedeviceobj.h | 4 ++++ src/libvirt_private.syms | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/conf/virnodedeviceobj.c b/src/conf/virnodedeviceobj.c index ba84dce82b..fc23e6ea01 100644 --- a/src/conf/virnodedeviceobj.c +++ b/src/conf/virnodedeviceobj.c @@ -58,7 +58,6 @@ static virClass *virNodeDeviceObjClass; static virClass *virNodeDeviceObjListClass; static void virNodeDeviceObjDispose(void *opaque); static void virNodeDeviceObjListDispose(void *opaque); -static bool virNodeDeviceObjHasCap(const virNodeDeviceObj *obj, int type); =20 static int virNodeDeviceObjOnceInit(void) @@ -684,7 +683,7 @@ virNodeDeviceObjListGetParentHost(virNodeDeviceObjList = *devs, } =20 =20 -static bool +bool virNodeDeviceObjHasCap(const virNodeDeviceObj *obj, int type) { diff --git a/src/conf/virnodedeviceobj.h b/src/conf/virnodedeviceobj.h index 5f6d22e1f6..ba2e424998 100644 --- a/src/conf/virnodedeviceobj.h +++ b/src/conf/virnodedeviceobj.h @@ -86,6 +86,10 @@ int virNodeDeviceObjListGetParentHost(virNodeDeviceObjList *devs, virNodeDeviceDef *def); =20 +bool +virNodeDeviceObjHasCap(const virNodeDeviceObj *obj, + int type); + virNodeDeviceObjList * virNodeDeviceObjListNew(void); =20 diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 6f0d72ca38..ef1c60d103 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1298,6 +1298,7 @@ virNetworkPortDefSaveStatus; # conf/virnodedeviceobj.h virNodeDeviceObjEndAPI; virNodeDeviceObjGetDef; +virNodeDeviceObjHasCap; virNodeDeviceObjIsActive; virNodeDeviceObjIsAutostart; virNodeDeviceObjIsPersistent; --=20 2.33.1 From nobody Thu May 16 02:26:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.ibm.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1647334629297670.7955378655059; Tue, 15 Mar 2022 01:57:09 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-542-y3hqcHaHN4SAzM5g4b8zLw-1; Tue, 15 Mar 2022 04:57:06 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 641413802ACB; Tue, 15 Mar 2022 08:57:04 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id DC1F54B8D49; Tue, 15 Mar 2022 08:57:01 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 840EF194E107; Tue, 15 Mar 2022 08:57:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8020C194E021 for ; Tue, 15 Mar 2022 08:57:00 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 5E9981400E74; Tue, 15 Mar 2022 08:57:00 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast10.extmail.prod.ext.rdu2.redhat.com [10.11.55.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5A535141ADA5 for ; Tue, 15 Mar 2022 08:57:00 +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-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4070E1C01E83 for ; Tue, 15 Mar 2022 08:57:00 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-661-vsAvamQ4MTOQRxuhi-v1Zw-1; Tue, 15 Mar 2022 04:56:58 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 22F6fnwr002808; Tue, 15 Mar 2022 08:56:57 GMT 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 3etnrhtc4t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 15 Mar 2022 08:56:56 +0000 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 22F8rPhf001152; Tue, 15 Mar 2022 08:56:54 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma03fra.de.ibm.com with ESMTP id 3erk58n6tg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 15 Mar 2022 08:56:54 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 22F8uqHA54329606 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 15 Mar 2022 08:56:52 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3A295A4054; Tue, 15 Mar 2022 08:56:52 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1C419A405F; Tue, 15 Mar 2022 08:56:52 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.180.72]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 15 Mar 2022 08:56:52 +0000 (GMT) X-MC-Unique: y3hqcHaHN4SAzM5g4b8zLw-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: vsAvamQ4MTOQRxuhi-v1Zw-1 From: Boris Fiuczynski To: libvir-list@redhat.com Subject: [PATCH 2/3] nodedev: update mdevs on parent change Date: Tue, 15 Mar 2022 09:56:45 +0100 Message-Id: <20220315085646.5963-3-fiuczy@linux.ibm.com> In-Reply-To: <20220315085646.5963-1-fiuczy@linux.ibm.com> References: <20220315085646.5963-1-fiuczy@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: MrnpueqHgtlYG0It_k2re6b-TJQw2x6X X-Proofpoint-GUID: MrnpueqHgtlYG0It_k2re6b-TJQw2x6X X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.850,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-03-14_14,2022-03-14_02,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 adultscore=0 impostorscore=0 priorityscore=1501 clxscore=1015 mlxscore=0 malwarescore=0 lowpriorityscore=0 spamscore=0 suspectscore=0 mlxlogscore=911 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2203150055 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.85 on 10.11.54.7 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jjongsma@redhat.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1647334631490100004 Content-Type: text/plain; charset="utf-8" The parent of the mdev definition can change due to the existance of the parent device. The parents existance can e.g. depend on the device driver load state. Signed-off-by: Boris Fiuczynski --- src/node_device/node_device_driver.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_de= vice_driver.c index 7b2fb3d953..84dde743df 100644 --- a/src/node_device/node_device_driver.c +++ b/src/node_device/node_device_driver.c @@ -1670,7 +1670,9 @@ removeMissingPersistentMdev(virNodeDeviceObj *obj, =20 for (i =3D 0; i < data->ndefs; i++) { /* OK, this mdev is still defined by mdevctl */ - if (STREQ(data->defs[i]->name, def->name)) + /* AND the parent object has not changed */ + if (STREQ(data->defs[i]->name, def->name) && + STREQ(data->defs[i]->parent, def->parent)) return false; } =20 --=20 2.33.1 From nobody Thu May 16 02:26:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.ibm.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1647334685427119.07068952534598; Tue, 15 Mar 2022 01:58:05 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-382-GNNyXt9jPKO8WpeYHwXS0g-1; Tue, 15 Mar 2022 04:57:09 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 376833C025DB; Tue, 15 Mar 2022 08:57:07 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E83FC33262; Tue, 15 Mar 2022 08:57:07 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id CBBED194E107; Tue, 15 Mar 2022 08:57:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E41A4194E021 for ; Tue, 15 Mar 2022 08:57:04 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id BFC912022EC4; Tue, 15 Mar 2022 08:57:04 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast10.extmail.prod.ext.rdu2.redhat.com [10.11.55.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BA59D2022EC9 for ; Tue, 15 Mar 2022 08:57:01 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 66D081C01E80 for ; Tue, 15 Mar 2022 08:57:01 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-595-FT1T6B7QNXOFu-RoV_N7Pg-1; Tue, 15 Mar 2022 04:56:57 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 22F8oN1r018755; Tue, 15 Mar 2022 08:56:56 GMT Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0b-001b2d01.pphosted.com with ESMTP id 3etqmr02vj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 15 Mar 2022 08:56:56 +0000 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 22F8rKuW013708; Tue, 15 Mar 2022 08:56:54 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma06ams.nl.ibm.com with ESMTP id 3erjshp405-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 15 Mar 2022 08:56:54 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 22F8uqph51184096 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 15 Mar 2022 08:56:52 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 64A6AA4054; Tue, 15 Mar 2022 08:56:52 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 46AF4A405B; Tue, 15 Mar 2022 08:56:52 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.180.72]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 15 Mar 2022 08:56:52 +0000 (GMT) X-MC-Unique: GNNyXt9jPKO8WpeYHwXS0g-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: FT1T6B7QNXOFu-RoV_N7Pg-1 From: Boris Fiuczynski To: libvir-list@redhat.com Subject: [PATCH 3/3] nodedev: trigger mdev device definition update on udev add and remove Date: Tue, 15 Mar 2022 09:56:46 +0100 Message-Id: <20220315085646.5963-4-fiuczy@linux.ibm.com> In-Reply-To: <20220315085646.5963-1-fiuczy@linux.ibm.com> References: <20220315085646.5963-1-fiuczy@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: DMuIa66KftI7itK694uhWUJo0e8P11Ds X-Proofpoint-ORIG-GUID: DMuIa66KftI7itK694uhWUJo0e8P11Ds X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.850,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-03-14_14,2022-03-14_02,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 impostorscore=0 phishscore=0 malwarescore=0 priorityscore=1501 lowpriorityscore=0 mlxlogscore=999 bulkscore=0 clxscore=1015 adultscore=0 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2203150055 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-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jjongsma@redhat.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1647334686187100001 Content-Type: text/plain; charset="utf-8" When nodedev objects are added and removed if possible check if mdev-types = is supported by the object and trigger a mdev device definition update to corr= ect the associated parent nodedevs. Signed-off-by: Boris Fiuczynski Reviewed-by: Jonathon Jongsma Reviewed-by: Michal Privoznik --- src/node_device/node_device_udev.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_devi= ce_udev.c index b0a5e6302c..e17373a0b0 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -1440,6 +1440,10 @@ udevRemoveOneDeviceSysPath(const char *path) } virNodeDeviceObjEndAPI(&obj); =20 + /* cannot check for mdev_types since they have already been removed */ + if (nodeDeviceUpdateMediatedDevices() < 0) + VIR_WARN("mdevctl failed to updated mediated devices"); + virObjectEventStateQueue(driver->nodeDeviceEventState, event); return 0; } @@ -1507,6 +1511,7 @@ udevAddOneDevice(struct udev_device *device) bool persistent =3D false; bool autostart =3D false; bool is_mdev; + bool is_mdev_types =3D false; =20 def =3D g_new0(virNodeDeviceDef, 1); =20 @@ -1562,8 +1567,12 @@ udevAddOneDevice(struct udev_device *device) event =3D virNodeDeviceEventUpdateNew(objdef->name); =20 virNodeDeviceObjSetActive(obj, true); + is_mdev_types =3D virNodeDeviceObjHasCap(obj, VIR_NODE_DEV_CAP_MDEV_TY= PES); virNodeDeviceObjEndAPI(&obj); =20 + if (is_mdev_types && nodeDeviceUpdateMediatedDevices() < 0) + VIR_WARN("mdevctl failed to updated mediated devices"); + ret =3D 0; =20 cleanup: --=20 2.33.1