## Process this file with automake to produce Makefile.in
-## Copyright (C) 2005-2014 Red Hat, Inc.
+## Copyright (C) 2005-2015 Red Hat, Inc.
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
NODE_DEVICE_DRIVER_SOURCES = \
node_device/node_device_driver.c \
node_device/node_device_driver.h \
- node_device/node_device_linux_sysfs.c
+ node_device/node_device_linux_sysfs.c \
+ node_device/node_device_linux_sysfs.h
NODE_DEVICE_DRIVER_HAL_SOURCES = \
node_device/node_device_hal.c \
#include "virfile.h"
#include "virstring.h"
#include "node_device_conf.h"
-#include "node_device_hal.h"
#include "node_device_driver.h"
+#include "node_device_hal.h"
+#include "node_device_linux_sysfs.h"
#include "virutil.h"
#include "viraccessapicheck.h"
#include "virnetdev.h"
while (cap) {
switch (cap->data.type) {
case VIR_NODE_DEV_CAP_SCSI_HOST:
- detect_scsi_host_caps(&dev->def->caps->data);
+ nodeDeviceSysfsGetSCSIHostCaps(&dev->def->caps->data);
break;
case VIR_NODE_DEV_CAP_NET:
if (virNetDevGetLinkInfo(cap->data.net.ifname, &cap->data.net.lnk) < 0)
while (cap) {
if (cap->data.type == VIR_NODE_DEV_CAP_SCSI_HOST) {
- detect_scsi_host_caps(&cap->data);
+ nodeDeviceSysfsGetSCSIHostCaps(&cap->data);
if (cap->data.scsi_host.flags &
VIR_NODE_DEV_CAP_FLAG_HBA_FC_HOST) {
if (STREQ(cap->data.scsi_host.wwnn, wwnn) &&
int nodedevRegister(void);
-int detect_scsi_host_caps(virNodeDevCapDataPtr d);
-
int nodeNumOfDevices(virConnectPtr conn, const char *cap, unsigned int flags);
int nodeListDevices(virConnectPtr conn, const char *cap, char **const names,
int maxnames, unsigned int flags);
/*
* node_device_hal.c: node device enumeration - HAL-based implementation
*
- * Copyright (C) 2011-2014 Red Hat, Inc.
+ * Copyright (C) 2011-2015 Red Hat, Inc.
* Copyright (C) 2008 Virtual Iron Software, Inc.
* Copyright (C) 2008 David F. Lively
*
#include <libhal.h>
#include "node_device_conf.h"
+#include "node_device_driver.h"
#include "node_device_hal.h"
+#include "node_device_linux_sysfs.h"
#include "virerror.h"
#include "driver.h"
#include "datatypes.h"
#include "viruuid.h"
#include "virpci.h"
#include "virlog.h"
-#include "node_device_driver.h"
#include "virdbus.h"
#include "virstring.h"
(void)get_int_prop(ctx, udi, "scsi_host.host", (int *)&d->scsi_host.host);
- retval = detect_scsi_host_caps(d);
+ retval = nodeDeviceSysfsGetSCSIHostCaps(d);
if (retval == -1)
goto out;
/*
* node_device_linux_sysfs.c: Linux specific code to gather device data
- * not available through HAL.
+ * that is available from sysfs (but not from UDEV or HAL).
*
* Copyright (C) 2009-2015 Red Hat, Inc.
*
#include "node_device_driver.h"
#include "node_device_hal.h"
+#include "node_device_linux_sysfs.h"
#include "virerror.h"
#include "viralloc.h"
#include "virlog.h"
VIR_LOG_INIT("node_device.node_device_linux_sysfs");
int
-detect_scsi_host_caps(virNodeDevCapDataPtr d)
+nodeDeviceSysfsGetSCSIHostCaps(virNodeDevCapDataPtr d)
{
char *max_vports = NULL;
char *vports = NULL;
#else
int
-detect_scsi_host_caps(virNodeDevCapDataPtr d ATTRIBUTE_UNUSED)
+nodeDeviceSysfsGetSCSIHostCaps(virNodeDevCapDataPtr d ATTRIBUTE_UNUSED)
{
return -1;
}
--- /dev/null
+/*
+ * node_device_linux_sysfs.h: Linux specific code to gather device data
+ * that is available from sysfs (but not from UDEV or HAL).
+ *
+ * Copyright (C) 2015 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef __VIR_NODE_DEVICE_LINUX_SYSFS_H__
+# define __VIR_NODE_DEVICE_LINUX_SYSFS_H__
+
+# include "node_device_conf.h"
+
+int nodeDeviceSysfsGetSCSIHostCaps(virNodeDevCapDataPtr d);
+
+#endif /* __VIR_NODE_DEVICE_LINUX_SYSFS_H__ */
/*
* node_device_udev.c: node device enumeration - libudev implementation
*
- * Copyright (C) 2009-2014 Red Hat, Inc.
+ * Copyright (C) 2009-2015 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
#include <c-ctype.h>
#include "dirname.h"
-#include "node_device_udev.h"
-#include "virerror.h"
#include "node_device_conf.h"
#include "node_device_driver.h"
+#include "node_device_linux_sysfs.h"
+#include "node_device_udev.h"
+#include "virerror.h"
#include "driver.h"
#include "datatypes.h"
#include "virlog.h"
goto out;
}
- detect_scsi_host_caps(&def->caps->data);
+ nodeDeviceSysfsGetSCSIHostCaps(&def->caps->data);
if (udevGenerateDeviceName(device, def, NULL) != 0)
goto out;