From nobody Thu May 15 04:03:54 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1516872272070669.9576017523063; Thu, 25 Jan 2018 01:24:32 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 219F9A8AA; Thu, 25 Jan 2018 09:24:31 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D66A62A2C4; Thu, 25 Jan 2018 09:24:30 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8B6CD410B7; Thu, 25 Jan 2018 09:24:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w0P9ORqM032691 for ; Thu, 25 Jan 2018 04:24:27 -0500 Received: by smtp.corp.redhat.com (Postfix) id 03D102C30F; Thu, 25 Jan 2018 09:24:27 +0000 (UTC) Received: from beluga.usersys.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id 55FCD5D6A8; Thu, 25 Jan 2018 09:24:26 +0000 (UTC) From: Erik Skultety To: libvir-list@redhat.com Date: Thu, 25 Jan 2018 10:23:51 +0100 Message-Id: <8d84acd27ae698b2ea8bc2516f3a46d60a472e67.1516872173.git.eskultet@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Erik Skultety Subject: [libvirt] [PATCH 04/15] nodedev: Drop the nodeDeviceSysfsGetSCSIHostCaps wrapper X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 25 Jan 2018 09:24:31 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We can call directly the virNodeDeviceGetSCSIHostCaps helper instead. Signed-off-by: Erik Skultety --- src/conf/node_device_conf.c | 12 ++++++++++++ src/node_device/node_device_driver.c | 2 +- src/node_device/node_device_hal.c | 4 ++-- src/node_device/node_device_linux_sysfs.c | 12 ------------ src/node_device/node_device_linux_sysfs.h | 1 - src/node_device/node_device_udev.c | 2 +- 6 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c index bf84fd2b3..70a753ebf 100644 --- a/src/conf/node_device_conf.c +++ b/src/conf/node_device_conf.c @@ -2431,6 +2431,8 @@ virNodeDeviceDeleteVport(virConnectPtr conn, } =20 =20 +#ifdef __linux__ + int virNodeDeviceGetSCSIHostCaps(virNodeDevCapSCSIHostPtr scsi_host) { @@ -2511,3 +2513,13 @@ virNodeDeviceGetSCSIHostCaps(virNodeDevCapSCSIHostPt= r scsi_host) VIR_FREE(tmp); return ret; } + +#else + +int +virNodeDeviceGetSCSIHostCaps(virNodeDevCap) +{ + return -1; +} + +#endif /* __linux__ */ diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_de= vice_driver.c index 6216a6977..a2f687942 100644 --- a/src/node_device/node_device_driver.c +++ b/src/node_device/node_device_driver.c @@ -56,7 +56,7 @@ nodeDeviceUpdateCaps(virNodeDeviceDefPtr def) while (cap) { switch (cap->data.type) { case VIR_NODE_DEV_CAP_SCSI_HOST: - nodeDeviceSysfsGetSCSIHostCaps(&cap->data.scsi_host); + virNodeDeviceGetSCSIHostCaps(&cap->data.scsi_host); break; case VIR_NODE_DEV_CAP_SCSI_TARGET: nodeDeviceSysfsGetSCSITargetCaps(def->sysfs_path, diff --git a/src/node_device/node_device_hal.c b/src/node_device/node_devic= e_hal.c index c19e327c9..4c50f4613 100644 --- a/src/node_device/node_device_hal.c +++ b/src/node_device/node_device_hal.c @@ -151,7 +151,7 @@ gather_pci_cap(LibHalContext *ctx, const char *udi, ignore_value(virStrToLong_ui(p+1, &p, 16, &d->pci_dev.function= )); } =20 - if (nodeDeviceSysfsGetPCIRelatedDevCaps(sysfs_path, &d->pci_dev) <= 0) { + if (virNodeDeviceGetPCIDynamicCaps(sysfs_path, &d->pci_dev) < 0) { VIR_FREE(sysfs_path); return -1; } @@ -237,7 +237,7 @@ gather_scsi_host_cap(LibHalContext *ctx, const char *ud= i, =20 (void)get_int_prop(ctx, udi, "scsi_host.host", (int *)&d->scsi_host.ho= st); =20 - retval =3D nodeDeviceSysfsGetSCSIHostCaps(&d->scsi_host); + retval =3D virNodeDeviceGetSCSIHostCaps(&d->scsi_host); =20 if (retval =3D=3D -1) goto out; diff --git a/src/node_device/node_device_linux_sysfs.c b/src/node_device/no= de_device_linux_sysfs.c index 6f438e5f3..b3f80a555 100644 --- a/src/node_device/node_device_linux_sysfs.c +++ b/src/node_device/node_device_linux_sysfs.c @@ -45,12 +45,6 @@ =20 VIR_LOG_INIT("node_device.node_device_linux_sysfs"); =20 -int -nodeDeviceSysfsGetSCSIHostCaps(virNodeDevCapSCSIHostPtr scsi_host) -{ - return virNodeDeviceGetSCSIHostCaps(scsi_host); -} - =20 int nodeDeviceSysfsGetSCSITargetCaps(const char *sysfsPath, @@ -196,12 +190,6 @@ nodeDeviceSysfsGetPCIRelatedDevCaps(const char *sysfsP= ath, =20 #else =20 -int -nodeDeviceSysfsGetSCSIHostCaps(virNodeDevCapSCSIHostPtr scsi_host ATTRIBUT= E_UNUSED) -{ - return -1; -} - int nodeDeviceSysfsGetSCSITargetCaps(const char *sysfsPath ATTRIBUTE_UNUSE= D, virNodeDevCapSCSITargetPtr scsi_targe= t ATTRIBUTE_UNUSED) { diff --git a/src/node_device/node_device_linux_sysfs.h b/src/node_device/no= de_device_linux_sysfs.h index 12cfe6341..9392d6934 100644 --- a/src/node_device/node_device_linux_sysfs.h +++ b/src/node_device/node_device_linux_sysfs.h @@ -25,7 +25,6 @@ =20 # include "node_device_conf.h" =20 -int nodeDeviceSysfsGetSCSIHostCaps(virNodeDevCapSCSIHostPtr scsi_host); int nodeDeviceSysfsGetSCSITargetCaps(const char *sysfsPath, virNodeDevCapSCSITargetPtr scsi_targe= t); int nodeDeviceSysfsGetPCIRelatedDevCaps(const char *sysfsPath, diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_devi= ce_udev.c index e0fca6159..4cc531d2c 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -781,7 +781,7 @@ udevProcessSCSIHost(struct udev_device *device ATTRIBUT= E_UNUSED, return -1; } =20 - nodeDeviceSysfsGetSCSIHostCaps(&def->caps->data.scsi_host); + virNodeDeviceGetSCSIHostCaps(&def->caps->data.scsi_host); =20 if (udevGenerateDeviceName(device, def, NULL) !=3D 0) return -1; --=20 2.13.6 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list