From nobody Tue Sep 9 19:12:41 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=reject dis=none) header.from=linux.ibm.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1749201402168188.4329841370186; Fri, 6 Jun 2025 02:16:42 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 0A83B14AA; Fri, 6 Jun 2025 05:16:40 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id BA5791481; Fri, 6 Jun 2025 05:16:16 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 815CD13A5; Fri, 6 Jun 2025 05:16:13 -0400 (EDT) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id E4AF6137F for ; Fri, 6 Jun 2025 05:16:12 -0400 (EDT) Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5563h3FO019392 for ; Fri, 6 Jun 2025 09:16:12 GMT Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 471gf05jjc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 06 Jun 2025 09:16:11 +0000 (GMT) Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 5567K0LB019851 for ; Fri, 6 Jun 2025 09:16:10 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 470d3p8rwp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 06 Jun 2025 09:16:10 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 5569G62x58392896 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 6 Jun 2025 09:16:06 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7374C2004D; Fri, 6 Jun 2025 09:16:06 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5903020040; Fri, 6 Jun 2025 09:16:06 +0000 (GMT) Received: from fiuczyvm.. (unknown [9.111.217.163]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 6 Jun 2025 09:16:06 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h= content-transfer-encoding:date:from:message-id:mime-version :subject:to; s=pp1; bh=8H1Fg/B1pAMwNxU9c2tGOqNbi+vCFcNyGUn9YJlw/ L8=; b=Rlu2hAk1tcV8Zn+I/lGlz5Yey8b8rqIF9ZEcFDD3WR/0LiLkSUt1vSJM2 fI+dIKQVb3KCg0ZVIdhV833plJa4yaJqJqXtAYBWpp7Yv4n3xWQkN0NFoggsG+Pz fN465braD8ur+ISb8/5S1hrrSeiBXBbBfUpY9rbalxXTWufWOCI7DPLq3g/RJCyg NCDd1G582hmxE2GQTvSq/8KUDVMWlKwQ89kjgXyjPn/F3U7WYkMOu9WT/O1BNXVC JlyRhHNBEPVBoOzT/j/WXGYDKWuNIlnH0Y/oyB+QvYrR/dOk3k6R9nm0qFX3PJKJ zs0sU0pC+YXANM7GEEW2xktO7IGFg== From: Boris Fiuczynski To: devel@lists.libvirt.org Subject: [PATCH] nodedev: add nodedev name to mdevctl unsupport msg Date: Fri, 6 Jun 2025 11:16:06 +0200 Message-ID: <20250606091606.64254-1-fiuczy@linux.ibm.com> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: NoBGXhjU4um5jXoF2RGT96Z42bZq-wth X-Authority-Analysis: v=2.4 cv=DYMXqutW c=1 sm=1 tr=0 ts=6842b1db cx=c_pps a=GFwsV6G8L6GxiO2Y/PsHdQ==:117 a=GFwsV6G8L6GxiO2Y/PsHdQ==:17 a=6IFa9wvqVegA:10 a=VnNF1IyMAAAA:8 a=9ibFoIIjOqB2RUYdoAEA:9 X-Proofpoint-GUID: NoBGXhjU4um5jXoF2RGT96Z42bZq-wth X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjA2MDA3OCBTYWx0ZWRfX/L+tejTCO7dD hIoQPykw1mTS2rBrqYJj5KX5z4SigBkO4CUoFgQXvLGe5BOGXBwmYrZj2zqCoWywEh+NJZoTbGe CD97LpBHxmJJK6SjBUdcVLXg23KKPoiMa3ourFvzwJe0fLI9PZQexccYl3H5ws/wLCrJHyDRaYs HpiC14aWd5EVKrCRkH6R00UatJtpFX0x2OCi6LJ8vNAoPh/1EB3lfVJswJO1Yy1nkYcfNwsURSi ZXeXT7NDCsKi46TvGBYJhOMO22oI+eNjxriEIY4M6XpQU6SYNrQ/d8IdXHJk5vqi7ziBdq2/Ctn 8VIAsulZGP15m5oI20CrEAlI0vaIAHxuRgmvgUBICdGeLrCnGvZm1rPhpB/evnITvPb8N82yjDA LosgPAL05s2UGoJJge80HtxjaXk2LOPbYNkMQ57rMKruW22i9II3gnyV2nNfqKuKdx3XcuBk X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-06-06_02,2025-06-05_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 lowpriorityscore=0 suspectscore=0 spamscore=0 mlxscore=0 priorityscore=1501 clxscore=1015 phishscore=0 mlxlogscore=880 adultscore=0 malwarescore=0 bulkscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2506060078 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 3GUAMQXD53YQ3QRXPCNDQNPA6Z7D24RZ X-Message-ID-Hash: 3GUAMQXD53YQ3QRXPCNDQNPA6Z7D24RZ X-MailFrom: fiuczy@linux.ibm.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1749201403885116600 Content-Type: text/plain; charset="utf-8" Let's add the nodedev name to improve the error message for the user. Signed-off-by: Boris Fiuczynski Reviewed-by: Michal Privoznik --- src/node_device/node_device_driver.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_de= vice_driver.c index 2c9e749495..de103d1967 100644 --- a/src/node_device/node_device_driver.c +++ b/src/node_device/node_device_driver.c @@ -927,6 +927,7 @@ nodeDeviceGetMdevctlModifySupportCheck(void) =20 static int virMdevctlModify(virNodeDeviceDef *def, + const char *def_name, bool defined, bool live) { @@ -942,8 +943,9 @@ virMdevctlModify(virNodeDeviceDef *def, =20 if (nodeDeviceGetMdevctlModifySupportCheck() < 0) { VIR_WARN("Installed mdevctl version does not support modify with o= ptions jsonfile, defined and live"); - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", - _("Unable to modify mediated device: modify unsuppo= rted")); + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, + _("Unable to modify mediated device '%1$s': modify = unsupported"), + def_name); return -1; } =20 @@ -952,8 +954,8 @@ virMdevctlModify(virNodeDeviceDef *def, =20 if (status !=3D 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to modify mediated device: %1$s"), - MDEVCTL_ERROR(errmsg)); + _("Unable to modify mediated device '%1$s': %2$s"), + def_name, MDEVCTL_ERROR(errmsg)); return -1; } =20 @@ -1608,8 +1610,9 @@ nodeDeviceDefineXML(virConnect *conn, * nodeDeviceDefValidateUpdate() is not required as uuid and * parent are matching if def was found and changing the type in * the persistent config is allowed. */ - VIR_DEBUG("Update node device '%s' with mdevctl", def->name); - modify_failed =3D (virMdevctlModify(def, true, false) < 0); + virNodeDeviceDef *olddef =3D virNodeDeviceObjGetDef(persistent_obj= ); + VIR_DEBUG("Update node device '%s' with mdevctl", olddef->name); + modify_failed =3D (virMdevctlModify(def, olddef->name, true, false= ) < 0); virNodeDeviceObjEndAPI(&persistent_obj); if (modify_failed) return NULL; @@ -2357,6 +2360,7 @@ nodeDeviceUpdate(virNodeDevice *device, /* Update now. */ VIR_DEBUG("Update node device '%s' with mdevctl", def->name); if (virMdevctlModify(new_def, + def->name, (flags & VIR_NODE_DEVICE_UPDATE_AFFECT_CONFIG= ), (flags & VIR_NODE_DEVICE_UPDATE_AFFECT_LIVE))= < 0) { goto cleanup; --=20 2.49.0