From nobody Sat Feb 7 18:20:23 2026 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; dkim=pass; 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=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1688124940; cv=none; d=zohomail.com; s=zohoarc; b=lk9De6uSAhEt3cYWIWK77YL04+3O5KH+ql+JhKE2u3lF9DhHkkwX8R4zBO4UQm73lI0HvOEVDVTkQOrL9JFnLUcMNbK1axBaZWmtsd4hc/CrgeFJeTLUERHmrTpW61Ygv/7AjPXt5ReIb+eiR+MBqNJKk3/I5ZSh6EmCJTaB1mc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688124940; 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=TyUjdESJX8adrfqdwKxVn1xMsu4uR1y+z6Vo5pWN2dI=; b=XP1nn8uEf8ebBjnTmgjNyvEKRSwexTYMno4yP9m5SA0LwuI+hEc5yJ5vG0CM1/aSrX/pKPRU+OQ+88RFSnp2BDRNQVMXJ0v7wqN9BDhsUtDh8k6Y5P6DBc5Ey444mY3EJ7nVv43o8bnPyfz/34DAhDuoBX0S3EGhyZA1pKh1NM8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 header.from= (p=reject dis=none) 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 1688124940695554.5462619314608; Fri, 30 Jun 2023 04:35:40 -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-369-42SdDpm8OMSCaxvBlE9e-Q-1; Fri, 30 Jun 2023 07:35:36 -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 0F9F9810BB4; Fri, 30 Jun 2023 11:35:34 +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 7BF144CD0C2; Fri, 30 Jun 2023 11:35:31 +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 2157B19465B3; Fri, 30 Jun 2023 11:35:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C52A51946595 for ; Fri, 30 Jun 2023 11:34:11 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 610BE2166B2D; Fri, 30 Jun 2023 11:34:11 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast09.extmail.prod.ext.rdu2.redhat.com [10.11.55.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 584092166B2E for ; Fri, 30 Jun 2023 11:34:11 +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-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3B2D729A9D3C for ; Fri, 30 Jun 2023 11:34:11 +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-373-5-jpaqJHNyKLtFFm1eOgYA-1; Fri, 30 Jun 2023 07:34:07 -0400 Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35UBGnwh017673; Fri, 30 Jun 2023 11:34:06 GMT Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rhx1q0ayw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Jun 2023 11:34:05 +0000 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 35UBSTpf015723; Fri, 30 Jun 2023 11:34:03 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma04fra.de.ibm.com (PPS) with ESMTPS id 3rdr4530r4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Jun 2023 11:34:02 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 35UBY0gO21758532 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Jun 2023 11:34:00 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 78C8520043; Fri, 30 Jun 2023 11:34:00 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 57A3F20040; Fri, 30 Jun 2023 11:34:00 +0000 (GMT) Received: from fiuczyvm.. (unknown [9.171.132.209]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 30 Jun 2023 11:34:00 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688124939; 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=TyUjdESJX8adrfqdwKxVn1xMsu4uR1y+z6Vo5pWN2dI=; b=dbTA7B/86AP8MVFlIO+Aooa6+IKrr1DnqxjfcXL3BLXJbpEWOCQmrBJMmXtTr+W9MT7cqp ebjF6AOGjpJ/fzcwXgRE7GpgutkY4JkcIbtaus69J9UP2Mpj4a82qRX7JccKNS30l1PRub ZDRsiPG5JIOx6VJ5ylfU5o0lB2Y5lus= X-MC-Unique: 42SdDpm8OMSCaxvBlE9e-Q-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: 5-jpaqJHNyKLtFFm1eOgYA-1 From: Boris Fiuczynski To: libvir-list@redhat.com, jjongsma@redhat.com Subject: [PATCH v2] nodedev: transient mdev update on nodeDeviceCreateXML Date: Fri, 30 Jun 2023 13:34:00 +0200 Message-Id: <20230630113400.22252-1-fiuczy@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: hjjvRUhVfhCD8kwmBr7xyZrp0eGywJyU X-Proofpoint-GUID: hjjvRUhVfhCD8kwmBr7xyZrp0eGywJyU 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-30_05,2023-06-30_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 spamscore=0 lowpriorityscore=0 priorityscore=1501 bulkscore=0 adultscore=0 impostorscore=0 malwarescore=0 phishscore=0 suspectscore=0 mlxscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306300099 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.6 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.10 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: 1688124942221100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Update the optional mdev attributes by running an mdevctl update on a new created nodedev object representing an mdev. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D2143158 Signed-off-by: Boris Fiuczynski --- src/node_device/node_device_udev.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_devi= ce_udev.c index 4c37ec3189..fce4212728 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -1757,12 +1757,20 @@ nodeStateCleanup(void) static int udevHandleOneDevice(struct udev_device *device) { + virNodeDevCapType dev_cap_type; const char *action =3D udev_device_get_action(device); =20 VIR_DEBUG("udev action: '%s': %s", action, udev_device_get_syspath(dev= ice)); =20 - if (STREQ(action, "add") || STREQ(action, "change")) - return udevAddOneDevice(device); + if (STREQ(action, "add") || STREQ(action, "change")) { + int ret =3D udevAddOneDevice(device); + if (ret =3D=3D 0 && + udevGetDeviceType(device, &dev_cap_type) =3D=3D 0 && + dev_cap_type =3D=3D VIR_NODE_DEV_CAP_MDEV) + if (nodeDeviceUpdateMediatedDevices() < 0) + VIR_WARN("mdevctl failed to update mediated devices"); + return ret; + } =20 if (STREQ(action, "remove")) return udevRemoveOneDevice(device); --=20 2.41.0