iscsi-initiator-utils/SOURCES/0028-use-var-lib-iscsi-in-libopeniscsiusr.patch

110 lines
4.8 KiB
Diff
Raw Normal View History

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