From nobody Mon Feb 9 07:42:20 2026 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 1738689297237890.294279995455; Tue, 4 Feb 2025 09:14:57 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 3433318A5; Tue, 4 Feb 2025 12:14:56 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id B3ABB1D3C; Tue, 4 Feb 2025 12:12:06 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 1EB281A8E; Tue, 4 Feb 2025 12:11:51 -0500 (EST) 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 870911B57 for ; Tue, 4 Feb 2025 12:11:50 -0500 (EST) Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 514GEoHs023089 for ; Tue, 4 Feb 2025 17:11:49 GMT Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 44kcq7ucv8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 04 Feb 2025 17:11:49 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 514G2CaF007130 for ; Tue, 4 Feb 2025 17:11:48 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 44hxaymnas-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 04 Feb 2025 17:11:48 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 514HBiDI42598744 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 4 Feb 2025 17:11:44 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6C0AA200BB; Tue, 4 Feb 2025 17:11:44 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6490E200B9; Tue, 4 Feb 2025 17:11:44 +0000 (GMT) Received: from fiuczyvm.. (unknown [9.152.222.247]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 4 Feb 2025 17:11:44 +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.4 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,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=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=xF6JGHOXPXorHHzcS 1lNTgi5Ft6oUNHQAwubad0PfQg=; b=omYrhrZbFzaXBtjgBjiiEZ8B7VoPFD7lv AXlilQ1q6N0veY1uyzEYflOl52C+AWgRgE1sB6Agl7XcOEDXASGFeSkxm7CCJLOF C2detiKTrJ67DnPKpjX7RmGPnA1BlVnGSMLTxNo8dWrYJrYeT93qhFhK60wrIv++ W7gLjM+BB8zzUXlxqK0AfrFXHlXSXg2WHlCwNcx/BG9GUSxyRpx3Hd9AYZzbAr0u jY39VTxr7TkIh89lRz4pd9N8fhw7xN6E353S9td2QypxwjWJhEqRpdzg3RL8f9DR YV8rQXXh+H+7cUQi6nzIMT3H0y4axTH4EXK/eEwhjkcFM9t/leeew== From: Boris Fiuczynski To: devel@lists.libvirt.org Subject: [PATCH 5/8] nodedev: refactor udevCCWGetState Date: Tue, 4 Feb 2025 18:11:40 +0100 Message-ID: <20250204171143.93141-6-fiuczy@linux.ibm.com> X-Mailer: git-send-email 2.48.0 In-Reply-To: <20250204171143.93141-1-fiuczy@linux.ibm.com> References: <20250204171143.93141-1-fiuczy@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 236VvlMQO3RnUVf1xzDhHZmgX9th9QoY X-Proofpoint-ORIG-GUID: 236VvlMQO3RnUVf1xzDhHZmgX9th9QoY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-02-04_08,2025-02-04_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 phishscore=0 suspectscore=0 mlxlogscore=950 spamscore=0 priorityscore=1501 malwarescore=0 impostorscore=0 bulkscore=0 adultscore=0 clxscore=1015 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2501170000 definitions=main-2502040131 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 4LLTNUNRJW7RC42EOS6XCPBUBOVMWV5R X-Message-ID-Hash: 4LLTNUNRJW7RC42EOS6XCPBUBOVMWV5R 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 CC: Boris Fiuczynski 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: 1738689301003019100 Content-Type: text/plain; charset="utf-8" Refactor method to be only ccw state type depended to allow reuse in a later patch. Reviewed-by: Marc Hartmayer Signed-off-by: Boris Fiuczynski --- src/node_device/node_device_udev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_devi= ce_udev.c index 97fbe95ac7..6b362625f7 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -1205,7 +1205,7 @@ udevGetCCWAddress(const char *sysfs_path, =20 static int udevCCWGetState(struct udev_device *device, - virNodeDevCapData *data) + virNodeDevCCWStateType *state) { int online =3D 0; =20 @@ -1215,10 +1215,10 @@ udevCCWGetState(struct udev_device *device, switch (online) { case VIR_NODE_DEV_CCW_STATE_OFFLINE: case VIR_NODE_DEV_CCW_STATE_ONLINE: - data->ccw_dev.state =3D online; + *state =3D online; break; default: - data->ccw_dev.state =3D VIR_NODE_DEV_CCW_STATE_LAST; + *state =3D VIR_NODE_DEV_CCW_STATE_LAST; break; } =20 @@ -1231,7 +1231,7 @@ udevProcessCCW(struct udev_device *device, virNodeDeviceDef *def) { /* process only online devices to keep the list sane */ - if (udevCCWGetState(device, &def->caps->data) < 0) + if (udevCCWGetState(device, &def->caps->data.ccw_dev.state) < 0) return -1; =20 if (udevGetCCWAddress(def->sysfs_path, &def->caps->data) < 0) --=20 2.47.0