]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blob - iscsi-initiator-utils/patches/0052-use-var-for-config.patch
grep: Update to 2.17.
[people/ms/ipfire-3.x.git] / iscsi-initiator-utils / patches / 0052-use-var-for-config.patch
1 From aaf2b26eae472e5fd596f9bd23f9bf5886b1eb98 Mon Sep 17 00:00:00 2001
2 From: Chris Leech <cleech@redhat.com>
3 Date: Mon, 19 Nov 2012 16:38:45 -0800
4 Subject: use var for config
5
6 ---
7 README | 33 ++++++++++++++++-----------------
8 doc/iscsiadm.8 | 8 ++++----
9 usr/idbm.c | 6 +++---
10 usr/idbm.h | 15 +++++++++------
11 usr/iface.h | 4 +++-
12 5 files changed, 35 insertions(+), 31 deletions(-)
13
14 diff --git a/README b/README
15 index 2a8319a..e5ae2c1 100644
16 --- a/README
17 +++ b/README
18 @@ -156,8 +156,7 @@ Usage: iscsid [OPTION]
19
20 Open-iSCSI persistent configuration is stored in a number of
21 directories under a configuration root directory, using a flat-file
22 -format. This configuration root directory is /etc/iscsi by default,
23 -but may also commonly be in /var/lib/iscsi.
24 +format. This configuration root directory is /var/lib/iscsi by default.
25
26 Configuration is contained in directories for:
27
28 @@ -444,7 +443,7 @@ a scsi_host per HBA port).
29 To manage both types of initiator stacks, iscsiadm uses the interface (iface)
30 structure. For each HBA port or for software iscsi for each network
31 device (ethX) or NIC, that you wish to bind sessions to you must create
32 -a iface config /etc/iscsi/ifaces.
33 +a iface config /var/lib/iscsi/ifaces.
34
35 Prep:
36
37 @@ -478,29 +477,29 @@ Running:
38 iface0 qla4xxx,00:c0:dd:08:63:e8,20.15.0.7,default,iqn.2005-06.com.redhat:madmax
39 iface1 qla4xxx,00:c0:dd:08:63:ea,20.15.0.9,default,iqn.2005-06.com.redhat:madmax
40
41 -Will report iface configurations that are setup in /etc/iscsi/ifaces.
42 +Will report iface configurations that are setup in /var/lib/iscsi/ifaces.
43 The format is:
44
45 iface_name transport_name,hwaddress,ipaddress,net_ifacename,initiatorname
46
47 For software iscsi, you can create the iface configs by hand, but it is
48 reccomended that you use iscsiadm's iface mode. There is a iface.example in
49 -/etc/iscsi/ifaces which can be used as a template for the daring.
50 +/var/lib/iscsi/ifaces which can be used as a template for the daring.
51
52 For each network object you wish to bind a session to you must create
53 -a seperate iface config in /etc/iscsi/ifaces and each iface config file
54 +a seperate iface config in /var/lib/iscsi/ifaces and each iface config file
55 must have a unique name which is less than or equal to 64 characters.
56
57 Example:
58
59 If you have NIC1 with MAC address 00:0F:1F:92:6B:BF and NIC2 with
60 MAC address 00:C0:DD:08:63:E7 and you wanted to do software iscsi over
61 -TCP/IP. Then in /etc/iscsi/ifaces/iface0 you would enter:
62 +TCP/IP. Then in /var/lib/iscsi/ifaces/iface0 you would enter:
63
64 iface.transport_name = tcp
65 iface.hwaddress = 00:0F:1F:92:6B:BF
66
67 -and in /etc/iscsi/ifaces/iface1 you would enter:
68 +and in /var/lib/iscsi/ifaces/iface1 you would enter:
69
70 iface.transport_name = tcp
71 iface.hwaddress = 00:C0:DD:08:63:E7
72 @@ -550,7 +549,7 @@ cxgb3i.00:07:43:05:97:07 cxgb3i,00:07:43:05:97:07,<empty>,<empty>,<empty>
73 qla4xxx.00:0e:1e:04:8b:2e qla4xxx,00:0e:1e:04:8b:2e,<empty>,<empty>,<empty>
74
75
76 -Will report iface configurations that are setup in /etc/iscsi/ifaces.
77 +Will report iface configurations that are setup in /var/lib/iscsi/ifaces.
78 The format is:
79
80 iface_name transport_name,hwaddress,ipaddress,net_ifacename,initiatorname
81 @@ -636,7 +635,7 @@ need a seperate network connection to the target for discovery purposes.
82 *This will be fixed in the next version of open-iscsi*
83
84 For compatibility reasons, when you run iscsiadm to do discovery, it
85 -will check for interfaces in /etc/iscsi/iscsi/ifaces that are using
86 +will check for interfaces in /var/lib/iscsi/ifaces that are using
87 tcp for the iface.transport and it will bind the portals that are discovered
88 so that they will be logged in through those ifaces. This behavior can also
89 be overriden by passing in the interfaces you want to use. For the case
90 @@ -654,7 +653,7 @@ we do not bind a session to a iface, then you can use the special iface
91
92 iscsiadm -m discoverydb -t st -p ip:port -I default --discover -P 1
93
94 -And if you did not define any interfaces in /etc/iscsi/ifaces and do
95 +And if you did not define any interfaces in /var/lib/iscsi/ifaces and do
96 not pass anything into iscsiadm, running iscsiadm will do the default
97 behavior, where we allow the network subsystem to decide which
98 device to use.
99 @@ -696,7 +695,7 @@ To now log into targets it is the same as with sofware iscsi. See section
100
101 ./iscsiadm -m discoverydb -t st -p 192.168.1.1:3260 --discover
102
103 - This will search /etc/iscsi/send_targets for a record with the
104 + This will search /var/lib/iscsi/send_targets for a record with the
105 ID [portal = 192.168.1.1:3260 and type = sendtargets. If found it
106 will perform discovery using the settings stored in the record.
107 If a record does not exist, it will be created using the iscsid.conf
108 @@ -705,7 +704,7 @@ To now log into targets it is the same as with sofware iscsi. See section
109 The argument to -p may also be a hostname instead of an address.
110 ./iscsiadm -m discoverydb -t st -p smoehost --discover
111
112 - For the ifaces, iscsiadm will first search /etc/iscsi/ifaces for
113 + For the ifaces, iscsiadm will first search /var/lib/iscsi/ifaces for
114 interfaces using software iscsi. If any are found then nodes found
115 during discovery will be setup so that they can logged in through
116 those interfaces. To specify a specific iface, pass the
117 @@ -761,7 +760,7 @@ To now log into targets it is the same as with sofware iscsi. See section
118 This command will perform discovery, but not manipulate the node DB.
119
120 - SendTargets iSCSI Discovery with a specific interface. If you
121 - wish to only use a subset of the interfaces in /etc/iscsi/ifaces
122 + wish to only use a subset of the interfaces in /var/lib/iscsi/ifaces
123 then you can pass them in during discovery:
124
125 ./iscsiadm -m discoverydb -t sendtargets -p 192.168.1.1:3260 \
126 @@ -1072,8 +1071,8 @@ where targetname is the name of the target and ip_address:port is the address
127 and port of the portal. tpgt, is the portal group tag of
128 the portal, and is not used in iscsiadm commands except for static
129 record creation. And iface name is the name of the iscsi interface
130 -defined in /etc/iscsi/ifaces. If no interface was defined in
131 -/etc/iscsi/ifaces or passed in, the default behavior is used.
132 +defined in /var/lib/iscsi/ifaces. If no interface was defined in
133 +/var/lib/iscsi/ifaces or passed in, the default behavior is used.
134 Default here is iscsi_tcp/tcp to be used over which ever NIC the
135 network layer decides is best.
136
137 @@ -1188,7 +1187,7 @@ If set, iscsid will perform discovery to the address every
138 discovery.isns.discoveryd_poll_inval or
139 discovery.sendtargets.discoveryd_poll_inval seconds,
140 and it will log into any portals found from the discovery source using
141 -the ifaces in /etc/iscsi/ifaces.
142 +the ifaces in /var/lib/iscsi/ifaces.
143
144 Note that for iSNS the poll_interval does not have to be set. If not set,
145 iscsid will only perform rediscovery when it gets a SCN from the server.
146 diff --git a/doc/iscsiadm.8 b/doc/iscsiadm.8
147 index 7c209f6..e94cca0 100644
148 --- a/doc/iscsiadm.8
149 +++ b/doc/iscsiadm.8
150 @@ -89,7 +89,7 @@ This option is only valid for ping submode.
151 .TP
152 \fB\-I\fR, \fB\-\-interface=\fI[iface]\fR
153 The interface argument specifies the iSCSI interface to use for the operation.
154 -iSCSI interfaces (iface) are defined in /etc/iscsi/ifaces. For hardware
155 +iSCSI interfaces (iface) are defined in /var/lib/iscsi/ifaces. For hardware
156 iSCSI (qla4xxx) the iface config must have the hardware address
157 (iface.hwaddress = port's MAC address)
158 and the driver/transport_name (iface.transport_name). The iface's name is
159 @@ -166,7 +166,7 @@ If no other options are specified: for \fIdiscoverydb\fR and \fInode\fR, all
160 of their respective records are displayed; for \fIsession\fR, all active
161 sessions and connections are displayed; for \fIfw\fR, all boot firmware
162 values are displayed; for \fIhost\fR, all iSCSI hosts are displayed; and
163 -for \fIiface\fR, all ifaces setup in /etc/iscsi/ifaces are displayed.
164 +for \fIiface\fR, all ifaces setup in /var/lib/iscsi/ifaces are displayed.
165
166 .TP
167 \fB\-n\fR, \fB\-\-name=\fIname\fR
168 @@ -535,10 +535,10 @@ The configuration file read by \fBiscsid\fR and \fBiscsiadm\fR on startup.
169 The file containing the iSCSI InitiatorName and InitiatorAlias read by
170 \fBiscsid\fR and \fBiscsiadm\fR on startup.
171 .TP
172 -/etc/iscsi/nodes/
173 +/var/lib/iscsi/nodes/
174 This directory contains the nodes with their targets.
175 .TP
176 -/etc/iscsi/send_targets
177 +/var/lib/iscsi/send_targets
178 This directory contains the portals.
179
180 .SH "SEE ALSO"
181 diff --git a/usr/idbm.c b/usr/idbm.c
182 index a1d7d37..806d90e 100644
183 --- a/usr/idbm.c
184 +++ b/usr/idbm.c
185 @@ -2472,9 +2472,9 @@ free_info:
186 int idbm_init(idbm_get_config_file_fn *fn)
187 {
188 /* make sure root db dir is there */
189 - if (access(ISCSI_CONFIG_ROOT, F_OK) != 0) {
190 - if (mkdir(ISCSI_CONFIG_ROOT, 0660) != 0) {
191 - log_error("Could not make %s %d\n", ISCSI_CONFIG_ROOT,
192 + if (access(ISCSIVAR, F_OK) != 0) {
193 + if (mkdir(ISCSIVAR, 0660) != 0) {
194 + log_error("Could not make %s %d\n", ISCSIVAR,
195 errno);
196 return errno;
197 }
198 diff --git a/usr/idbm.h b/usr/idbm.h
199 index 245f046..5d81df7 100644
200 --- a/usr/idbm.h
201 +++ b/usr/idbm.h
202 @@ -28,12 +28,15 @@
203 #include "config.h"
204 #include "list.h"
205
206 -#define NODE_CONFIG_DIR ISCSI_CONFIG_ROOT"nodes"
207 -#define SLP_CONFIG_DIR ISCSI_CONFIG_ROOT"slp"
208 -#define ISNS_CONFIG_DIR ISCSI_CONFIG_ROOT"isns"
209 -#define STATIC_CONFIG_DIR ISCSI_CONFIG_ROOT"static"
210 -#define FW_CONFIG_DIR ISCSI_CONFIG_ROOT"fw"
211 -#define ST_CONFIG_DIR ISCSI_CONFIG_ROOT"send_targets"
212 +#define ISCSIVAR "/var/lib/iscsi/"
213 +
214 +#define NODE_CONFIG_DIR ISCSIVAR"nodes"
215 +#define SLP_CONFIG_DIR ISCSIVAR"slp"
216 +#define ISNS_CONFIG_DIR ISCSIVAR"isns"
217 +#define STATIC_CONFIG_DIR ISCSIVAR"static"
218 +#define ST_CONFIG_DIR ISCSIVAR"send_targets"
219 +#define FW_CONFIG_DIR ISCSIVAR"fw"
220 +
221 #define ST_CONFIG_NAME "st_config"
222 #define ISNS_CONFIG_NAME "isns_config"
223
224 diff --git a/usr/iface.h b/usr/iface.h
225 index 01f7074..f396918 100644
226 --- a/usr/iface.h
227 +++ b/usr/iface.h
228 @@ -20,7 +20,9 @@
229 #ifndef ISCSI_IFACE_H
230 #define ISCSI_IFACE_H
231
232 -#define IFACE_CONFIG_DIR ISCSI_CONFIG_ROOT"ifaces"
233 +#include "idbm.h"
234 +
235 +#define IFACE_CONFIG_DIR ISCSIVAR"ifaces"
236
237 struct iface_rec;
238 struct list_head;
239 --
240 1.7.11.7
241