From nobody Sun Feb 8 00:18:57 2026 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; dkim=pass; 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=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1687517015; cv=none; d=zohomail.com; s=zohoarc; b=nVS+JC/476Ufc6O9BW2DkqOKSNXNHUsJnCFBbleDGWtHQgEYrFMG7TSlvZKO9iKPbRiU3G8EjsHYrxHpNOVKEl7Iov7y9lU41yyIy21+lgu2VhVoyGOs9lFFa9BEmNsUw2ZYYQ1mUCsXr+uZYU7gzE3XM0wDP1d6C2G1iAGMssc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1687517015; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=hGQTfMaKX13pY5husz3P1OCIO8CtJKLy3OAVYozOYTk=; b=QlfoyigJOGppBFjGJlH2IK8nsbAXSrSc9s/P0/Tg0GBF+CojKmklhTYNs+/Gfi5TQk+Qro+/yONWvhggRJiQIy/Psz11pwxKpEIXRKPgiKetXnfUjhf8ydoXDoRAPfxEnq4IfMq9ThnrE1RltlcM/LFoYa1FUHMnMU+yNxmjSBo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 header.from= (p=reject dis=none) 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 1687517015079730.930606653804; Fri, 23 Jun 2023 03:43:35 -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-556-HaQdoRhiOqGStphjae2eAQ-1; Fri, 23 Jun 2023 06:43:32 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 68E6E1C05ED2; Fri, 23 Jun 2023 10:43:29 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id E3CF040C2063; Fri, 23 Jun 2023 10:43:27 +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 878651946588; Fri, 23 Jun 2023 10:43:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 004711946587 for ; Fri, 23 Jun 2023 10:43:26 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 810BCC1ED97; Fri, 23 Jun 2023 10:43:26 +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 79972C00049 for ; Fri, 23 Jun 2023 10:43: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-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5BA2E8E44ED for ; Fri, 23 Jun 2023 10:43:26 +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-121-ASDcSyDDMkS8SyFdKtDZ6g-1; Fri, 23 Jun 2023 06:43:22 -0400 Received: from pps.filterd (m0353726.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35NAgINe017184; Fri, 23 Jun 2023 10:43:21 GMT Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rd9v900cg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 Jun 2023 10:43:20 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 35N70ftD018034; Fri, 23 Jun 2023 10:43:18 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma03ams.nl.ibm.com (PPS) with ESMTPS id 3r94f543jm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 Jun 2023 10:43:18 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 35NAhFps40567296 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 23 Jun 2023 10:43:16 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DD5F420043; Fri, 23 Jun 2023 10:43:15 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BBFE920040; Fri, 23 Jun 2023 10:43:15 +0000 (GMT) Received: from fiuczyvm.. (unknown [9.171.130.52]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 23 Jun 2023 10:43:15 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687517013; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=hGQTfMaKX13pY5husz3P1OCIO8CtJKLy3OAVYozOYTk=; b=hL7spOi1fUrixBRUxg6MvBIHf6dmE3CuW3b9ysfJQcGPn3bWJzWLb5j/qXLbuUnBZa49dk eqUVDZt4N7Ro3W41RltdmuSS/rEydsUNy+tz3FHSANuedj0OadqtAUND3WY13mPPhXXzcY kvLIUkbA/nn75e+p74sSzGInYaOYwLs= X-MC-Unique: HaQdoRhiOqGStphjae2eAQ-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: ASDcSyDDMkS8SyFdKtDZ6g-1 From: Boris Fiuczynski To: libvir-list@redhat.com, jjongsma@redhat.com Subject: [PATCH] nodedev: transient mdev update on nodeDeviceCreateXML Date: Fri, 23 Jun 2023 12:43:15 +0200 Message-Id: <20230623104315.11792-1-fiuczy@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-GUID: HFNoF2NYrRGmtJt-NrYx1vYL8qsDZcH8 X-Proofpoint-ORIG-GUID: HFNoF2NYrRGmtJt-NrYx1vYL8qsDZcH8 X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-23_04,2023-06-22_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 phishscore=0 clxscore=1011 suspectscore=0 spamscore=0 lowpriorityscore=0 mlxscore=0 mlxlogscore=874 malwarescore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306230095 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 3.1 on 10.11.54.8 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: jdenemar@redhat.com, thuth@redhat.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linux.ibm.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1687517016253100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Update the optional mdev attributes on the new created nodedev object as they otherwise would not get set until the next mdevctl update cycle. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D2143158 Signed-off-by: Boris Fiuczynski --- src/node_device/node_device_driver.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_de= vice_driver.c index a2d0600560..5134d246f3 100644 --- a/src/node_device/node_device_driver.c +++ b/src/node_device/node_device_driver.c @@ -847,6 +847,9 @@ static virNodeDevicePtr nodeDeviceCreateXMLMdev(virConnectPtr conn, virNodeDeviceDef *def) { + virNodeDeviceObj *obj; + virNodeDeviceDef *new_def; + virNodeDevicePtr device; g_autofree char *uuid =3D NULL; =20 if (!def->parent) { @@ -864,8 +867,19 @@ nodeDeviceCreateXMLMdev(virConnectPtr conn, def->caps->data.mdev.uuid =3D g_steal_pointer(&uuid); } =20 - return nodeDeviceFindNewMediatedDevice(conn, def->caps->data.mdev.uuid, - def->caps->data.mdev.parent_add= r); + device =3D nodeDeviceFindNewMediatedDevice(conn, def->caps->data.mdev.= uuid, + def->caps->data.mdev.parent_a= ddr); + /* check on def for attributes and try update */ + if (def->caps->data.mdev.nattributes > 0) { + /* ignore failures as mdevctl updates will recover later */ + if (!(obj =3D nodeDeviceObjFindByName(device->name))) + return device; + new_def =3D virNodeDeviceObjGetDef(obj); + nodeDeviceDefCopyFromMdevctl(new_def, def); + virNodeDeviceObjEndAPI(&obj); + } + + return device; } =20 =20 --=20 2.41.0