We can call directly the virNodeDeviceGetSCSIHostCaps helper instead.
Signed-off-by: Erik Skultety <eskultet@redhat.com>
}
+#ifdef __linux__
+
int
virNodeDeviceGetSCSIHostCaps(virNodeDevCapSCSIHostPtr scsi_host)
{
VIR_FREE(tmp);
return ret;
}
+
+#else
+
+int
+virNodeDeviceGetSCSIHostCaps(virNodeDevCapSCSIHostPtr scsi_host ATTRIBUTE_UNUSED)
+{
+ return -1;
+}
+
+#endif /* __linux__ */
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,
(void)get_int_prop(ctx, udi, "scsi_host.host", (int *)&d->scsi_host.host);
- retval = nodeDeviceSysfsGetSCSIHostCaps(&d->scsi_host);
+ retval = virNodeDeviceGetSCSIHostCaps(&d->scsi_host);
if (retval == -1)
goto out;
VIR_LOG_INIT("node_device.node_device_linux_sysfs");
-int
-nodeDeviceSysfsGetSCSIHostCaps(virNodeDevCapSCSIHostPtr scsi_host)
-{
- return virNodeDeviceGetSCSIHostCaps(scsi_host);
-}
-
int
nodeDeviceSysfsGetSCSITargetCaps(const char *sysfsPath,
#else
-int
-nodeDeviceSysfsGetSCSIHostCaps(virNodeDevCapSCSIHostPtr scsi_host ATTRIBUTE_UNUSED)
-{
- return -1;
-}
-
int nodeDeviceSysfsGetSCSITargetCaps(const char *sysfsPath ATTRIBUTE_UNUSED,
virNodeDevCapSCSITargetPtr scsi_target ATTRIBUTE_UNUSED)
{
# include "node_device_conf.h"
-int nodeDeviceSysfsGetSCSIHostCaps(virNodeDevCapSCSIHostPtr scsi_host);
int nodeDeviceSysfsGetSCSITargetCaps(const char *sysfsPath,
virNodeDevCapSCSITargetPtr scsi_target);
int nodeDeviceSysfsGetPCIRelatedDevCaps(const char *sysfsPath,
return -1;
}
- nodeDeviceSysfsGetSCSIHostCaps(&def->caps->data.scsi_host);
+ virNodeDeviceGetSCSIHostCaps(&def->caps->data.scsi_host);
if (udevGenerateDeviceName(device, def, NULL) != 0)
return -1;