ddde1bd
From e186e959ddc2a47e7cfe1f5a8ea4d3fa8248a478 Mon Sep 17 00:00:00 2001
54e364e
From: rpm-build <rpm-build>
54e364e
Date: Wed, 30 May 2018 16:08:30 -0700
bda814b
Subject: [PATCH] use /var/lib/iscsi in libopeniscsiusr
54e364e
54e364e
---
54e364e
 libopeniscsiusr/idbm.h                                  | 3 ++-
54e364e
 libopeniscsiusr/iface.c                                 | 2 +-
54e364e
 libopeniscsiusr/libopeniscsiusr/libopeniscsiusr.h       | 8 ++++----
54e364e
 libopeniscsiusr/libopeniscsiusr/libopeniscsiusr_iface.h | 2 +-
54e364e
 libopeniscsiusr/node.h                                  | 2 +-
54e364e
 5 files changed, 9 insertions(+), 8 deletions(-)
54e364e
54e364e
diff --git a/libopeniscsiusr/idbm.h b/libopeniscsiusr/idbm.h
ddde1bd
index cc90388..5a4d2fa 100644
54e364e
--- a/libopeniscsiusr/idbm.h
54e364e
+++ b/libopeniscsiusr/idbm.h
54e364e
@@ -31,7 +31,8 @@
54e364e
 #include "libopeniscsiusr/libopeniscsiusr_common.h"
54e364e
 
54e364e
 #define ISCSI_CONFIG_ROOT	"/etc/iscsi/"
54e364e
-#define IFACE_CONFIG_DIR	ISCSI_CONFIG_ROOT"ifaces"
54e364e
+#define ISCSI_VAR_LIB		"/var/lib/iscsi/"
54e364e
+#define IFACE_CONFIG_DIR	ISCSI_VAR_LIB"ifaces"
54e364e
 #define AUTH_STR_MAX_LEN	256
54e364e
 #define BOOT_NAME_MAXLEN	256
54e364e
 #define IDBM_DUMP_SIZE		8192
54e364e
diff --git a/libopeniscsiusr/iface.c b/libopeniscsiusr/iface.c
bda814b
index e7938a5..99ab7b5 100644
54e364e
--- a/libopeniscsiusr/iface.c
54e364e
+++ b/libopeniscsiusr/iface.c
bda814b
@@ -381,7 +381,7 @@ int iscsi_default_iface_setup(struct iscsi_context *ctx)
54e364e
 
54e364e
 	_good(_iscsi_hids_get(ctx, &hids, &hid_count), rc, out);
54e364e
 	for (i = 0; i < hid_count; ++i) {
54e364e
-		/* Create /etc/iscsi/ifaces/<iface_name> file if not found
54e364e
+		/* Create /var/lib/iscsi/ifaces/<iface_name> file if not found
54e364e
 		 */
54e364e
 		_good(_iscsi_ifaces_get_from_sysfs(ctx, hids[i], &ifaces, &iface_count),
54e364e
 			rc, out);
54e364e
diff --git a/libopeniscsiusr/libopeniscsiusr/libopeniscsiusr.h b/libopeniscsiusr/libopeniscsiusr/libopeniscsiusr.h
bda814b
index 4395902..81582da 100644
54e364e
--- a/libopeniscsiusr/libopeniscsiusr/libopeniscsiusr.h
54e364e
+++ b/libopeniscsiusr/libopeniscsiusr/libopeniscsiusr.h
54e364e
@@ -339,7 +339,7 @@ __DLL_EXPORT void iscsi_session_free(struct iscsi_session *se);
54e364e
  *	* bnx2i
54e364e
  *
54e364e
  * It will also create configuration files for iSCSI hardware offload cards in
54e364e
- * /etc/iscsi/ifaces/<iface_name>.
54e364e
+ * /var/lib/iscsi/ifaces/<iface_name>.
54e364e
  *
54e364e
  * @ctx:
54e364e
  *	Pointer of 'struct iscsi_context'.
54e364e
@@ -369,7 +369,7 @@ __DLL_EXPORT int iscsi_default_iface_setup(struct iscsi_context *ctx);
54e364e
  * Retrieves all iSCSI interfaces. For the properties of 'struct iscsi_iface',
54e364e
  * please refer to the functions defined in 'libopeniscsiusr_iface.h' file.
54e364e
  * The returned results contains default iSCSI interfaces(iser and iscsi_tcp)
54e364e
- * and iSCSI interfaces configured in "/etc/iscsi/ifaces/".
54e364e
+ * and iSCSI interfaces configured in "/var/lib/iscsi/ifaces/".
54e364e
  * Illegal configuration file will be skipped and warned.
54e364e
  * To generate iSCSI interface configuration when new card installed, please
54e364e
  * use iscsi_default_iface_setup().
54e364e
@@ -427,7 +427,7 @@ __DLL_EXPORT void iscsi_ifaces_free(struct iscsi_iface **ifaces,
54e364e
  * iscsi_iface_get() - Retrieve specified iSCSI interface.
54e364e
  *
54e364e
  * Retrieves specified iSCSI interfaces by reading configuration from
54e364e
- * "/etc/iscsi/iface/<iface_name>".
54e364e
+ * "/var/lib/iscsi/iface/<iface_name>".
54e364e
  * To generate iSCSI interface configuration when new card installed, please
54e364e
  * use iscsi_default_iface_setup().
54e364e
  * Illegal configuration file will be treated as error LIBISCSI_ERR_IDBM.
54e364e
@@ -438,7 +438,7 @@ __DLL_EXPORT void iscsi_ifaces_free(struct iscsi_iface **ifaces,
54e364e
  *	If this pointer is NULL, your program will be terminated by assert.
54e364e
  * @iface_name:
54e364e
  *	String. Name of iSCSI interface. Also the file name of configuration
54e364e
- *	file "/etc/iscsi/iface/<iface_name>".
54e364e
+ *	file "/var/lib/iscsi/iface/<iface_name>".
54e364e
  *	If this pointer is NULL or empty string, your program will be terminated
54e364e
  *	by assert.
54e364e
  * @iface:
54e364e
diff --git a/libopeniscsiusr/libopeniscsiusr/libopeniscsiusr_iface.h b/libopeniscsiusr/libopeniscsiusr/libopeniscsiusr_iface.h
bda814b
index a1a2552..95b0160 100644
54e364e
--- a/libopeniscsiusr/libopeniscsiusr/libopeniscsiusr_iface.h
54e364e
+++ b/libopeniscsiusr/libopeniscsiusr/libopeniscsiusr_iface.h
54e364e
@@ -182,7 +182,7 @@ __DLL_EXPORT const char *iscsi_iface_name_get(struct iscsi_iface *iface);
54e364e
  *
54e364e
  * Dump all configurations of specified iSCSI interface. Will skip empty
54e364e
  * configuration so that output string could be saved directly to
54e364e
- * /etc/iscsi/ifaces/<iface_name> file.
54e364e
+ * /var/lib/iscsi/ifaces/<iface_name> file.
54e364e
  *
54e364e
  * @iface:
54e364e
  *	Pointer of 'struct iscsi_iface'.
54e364e
diff --git a/libopeniscsiusr/node.h b/libopeniscsiusr/node.h
bda814b
index 39e07b3..9eba7fa 100644
54e364e
--- a/libopeniscsiusr/node.h
54e364e
+++ b/libopeniscsiusr/node.h
54e364e
@@ -44,7 +44,7 @@ struct iscsi_node {
54e364e
 	char					portal[NI_MAXHOST * 2];
54e364e
 };
54e364e
 
54e364e
-#define NODE_CONFIG_DIR		ISCSI_CONFIG_ROOT"nodes"
54e364e
+#define NODE_CONFIG_DIR		ISCSI_VAR_LIB"nodes"
54e364e
 
54e364e
 /* Might be public in the future */
54e364e
 __DLL_LOCAL void iscsi_node_free(struct iscsi_node *node);
54e364e
-- 
ddde1bd
2.26.2
54e364e