summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2010-07-11 03:45:50 -0500
committerMike Christie <michaelc@cs.wisc.edu>2010-07-11 03:45:50 -0500
commite7fdad8691ea61bfb1ea4cb78757aa62d8e2b300 (patch)
tree3ceeefb7ca4d721f42b65ae847a81743a8011308
parentfe5cca505d6509dd67cefe85a96e0a4db6cedb4d (diff)
downloadopen-iscsi-e7fdad8691ea61bfb1ea4cb78757aa62d8e2b300.tar.gz
iscsiadm: rename discovery2 mode as discoverydb
This renames discovery2 mode to discoverydb to reflect it works on the discovery db where discovery mode does not.
-rw-r--r--README222
-rw-r--r--doc/iscsiadm.815
-rw-r--r--usr/iscsiadm.c64
3 files changed, 131 insertions, 170 deletions
diff --git a/README b/README
index 2e09abb..824a6c4 100644
--- a/README
+++ b/README
@@ -178,24 +178,11 @@ For help, run:
Usage: iscsiadm [OPTION]
- -m, --mode <op> specify operational mode op = <discovery2|node>
- -m discovery2 --type=[type] --portal=[ip:port] --print=[N] \
- [ --op=[op]=[NEW | DELETE | NONPERSISTENT] |
- --op=UPDATE -n name -v value ]
+ -m, --mode <op> specify operational mode op =
+ <discovery|discoverydb|fw|iface|host|node>
- Perform DB operation specified by --op on
- the discovery record specified by
- type=type and portal=[ip:port].
-
- Note: op=NEW will create a new discovery record
- using the iscsid.conf discovery settings. If it
- already exists, it will be overwritten using
- iscsid.conf discovery settings.
-
- op=DELETE will delete the discovery record
- and records for the targets found through
- that discovery source.
- -m discovery --interface=[iface...] --portal=[ip:port] --print=[N] \
+ -m discoverydb --type=[type] --interface=[iface...] --portal=[ip:port] \
+ --print=[N] \
--op=[op]=[NEW | UPDATE | DELETE | NONPERSISTENT] \ --discover
This command will use the discovery record settings
@@ -212,7 +199,7 @@ Usage: iscsiadm [OPTION]
command line.
[op] can be passed in multiple times to this
- command, and it will alter the DB manipulation.
+ command, and it will alter the node DB manipulation.
If [op] is passed in and the value is
"new", iscsiadm will add records for portals that do
@@ -230,7 +217,8 @@ Usage: iscsiadm [OPTION]
If [op] is passed in and the value is
"nonpersistent" iscsiadm will not store
- the portals found in the node DB.
+ the portals found in the node DB. This
+ only useful with the --login command.
See the example section for more info.
@@ -245,24 +233,82 @@ Usage: iscsiadm [OPTION]
1 = The tree style with the inteface info is used.
If print is not used the old flay style is used.
- -m discovery --interface=[iface...] --portal=[ip:port] --print=[N] \
- --op=[op]=[NEW | UPDATE | DELETE | NONPERSISTENT] \ --discover --login
- perform discovery based on portal in database, and
- log into portals found during discovery. See
- above for info in the interface and op arguments.
-
- For the above commands "print" is optional. If
- used, N can be 0 or 1.
- 0 = The old flat style of output is used.
- 1 = The tree style with the inteface info is used.
-
- If print is not used the old flay style is used.
- -m discovery --portal=[ip:port] --op=[op] [--name=[name] --value=[value]]
- perform specific DB operation [op] for specific
+ -m discoverydb --interface=[iface...] --type=[type] --portal=[ip:port] \
+ --print=[N] \
+ --op=[op]=[NEW | UPDATE | DELETE | NONPERSISTENT] \
+ --discover --login
+
+ This works like the previous discoverydb command
+ with the --login argument passed in will also
+ log into the portals that are found.
+ -m discoverydb --portal=[ip:port] --type=[type] \
+ --op=[op] [--name=[name] --value=[value]]
+
+ Perform specific DB operation [op] for
discovery portal. It could be one of:
[new], [delete], [update] or [show]. In case of
[update], you have to provide [name] and [value]
you wish to update
+
+ op=NEW will create a new discovery record
+ using the iscsid.conf discovery settings. If it
+ already exists, it will be overwritten using
+ iscsid.conf discovery settings.
+
+ op=DELETE will delete the discovery record
+ and records for the targets found through
+ that discovery source.
+
+ op=SHOW will display the discovery record
+ values. The --show arguemnt can be used to
+ force the CHAP passwords to be displayed.
+ -m discovery --type=[type] --interface=iscsi_ifacename \
+ --portal=[ip:port] --login --print=[N] \
+ --op=[op]=[NEW | UPDATE | DELETE | NONPERSISTENT]
+ perform [type] discovery for target portal with
+ ip-address [ip] and port [port].
+
+ This command will not use the discovery record
+ settings. It will use the iscsid.conf discovery
+ settings and it will overwrite the discovery
+ record with iscsid.conf discovery settings if it
+ exists. By default, it will then remove records for
+ portals no longer returned. And,
+ if a portal is returned by the target, then the
+ discovery command will create a new record or modify
+ an existing one with values from iscsi.conf and the
+ command line.
+
+ [op] can be passed in multiple times to this
+ command, and it will alter the DB manipulation.
+
+ If [op] is passed in and the value is
+ "new", iscsiadm will add records for portals that do
+ not yet have records in the db.
+
+ If [op] is passed in and the value is
+ "update", iscsiadm will update node records using
+ info from iscsi.conf and the command line for portals
+ that are returned during discovery and have
+ a record in the db.
+
+ If [op] is passed in and the value is "delete",
+ iscsiadm will delete records for portals that
+ were not returned during discovery.
+
+ If [op] is passed in and the value is
+ "nonpersistent" iscsiadm will not store
+ the portals found in the node DB.
+
+ See the example section for more info.
+
+ See below for how to setup iscsi ifaces for
+ software iscsi or override the system defaults.
+
+ Multiple ifaces can be passed in during discovery.
+ -m discovery --print=[N] display all discovery records from internal
+ persistent discovery database.
+
-m node display all discovered nodes from internal
persistent discovery database
-m node --targetname=[name] --portal=[ip:port] \
@@ -342,64 +388,6 @@ Usage: iscsiadm [OPTION]
-h, --help display this help and exit
-Depreciated Commands:
----------------------
-
-***********************************************************
-** discovery mode has been replaced with discovery2 mode **
-***********************************************************
- -m discovery --type=[type] --interface=iscsi_ifacename \
- --portal=[ip:port] --login --print=[N] \
- --op=[op]=[NEW | UPDATE | DELETE | NONPERSISTENT]
- perform [type] discovery for target portal with
- ip-address [ip] and port [port].
-
- This command will not use the discovery record
- settings. It will use the iscsid.conf discovery
- settings and it will overwrite the discovery
- record with iscsid.conf discovery settings if it
- exists. By default, it will then remove records for
- portals no longer returned. And,
- if a portal is returned by the target, then the
- discovery command will create a new record or modify
- an existing one with values from iscsi.conf and the
- command line.
-
- [op] can be passed in multiple times to this
- command, and it will alter the DB manipulation.
-
- If [op] is passed in and the value is
- "new", iscsiadm will add records for portals that do
- not yet have records in the db.
-
- If [op] is passed in and the value is
- "update", iscsiadm will update node records using
- info from iscsi.conf and the command line for portals
- that are returned during discovery and have
- a record in the db.
-
- If [op] is passed in and the value is "delete",
- iscsiadm will delete records for portals that
- were not returned during discovery.
-
- If [op] is passed in and the value is
- "nonpersistent" iscsiadm will not store
- the portals found in the node DB.
-
- See the example section for more info.
-
- See below for how to setup iscsi ifaces for
- software iscsi or override the system defaults.
-
- Multiple ifaces can be passed in during discovery.
- -m discovery --print=[N] display all discovery records from internal
- persistent discovery database.
- -m discovery --interface --portal=[ip:port] --print=[N] --discover
- perform discovery based on portal in database. See
- above for info in the interface argument.
-
-
-
5.1 iSCSI iface setup
=====================
@@ -580,13 +568,13 @@ will not be tcp.
For example if you had defined two interface but only wanted to use one
you can use the --interface/-I argument:
-iscsiadm -m discovery2 -t st -p ip:port -I iface1 --discover -P 1
+iscsiadm -m discoverydb -t st -p ip:port -I iface1 --discover -P 1
If you had defined interfaces but wanted the old behavior, where
we do not bind a session to a iface, then you can use the special iface
"default":
-iscsiadm -m discovery2 -t st -p ip:port -I default --discover -P 1
+iscsiadm -m discoverydb -t st -p ip:port -I default --discover -P 1
And if you did not define any interfaces in /etc/iscsi/ifaces and do
not pass anything into iscsiadm, running iscsiadm will do the default
@@ -628,7 +616,7 @@ To now log into targets it is the same as with sofware iscsi. See section
using the discovery settings for the discovery record with the
ID [192.168.1.1:3260].
- ./iscsiadm -m discovery2 -t st -p 192.168.1.1:3260 --discover
+ ./iscsiadm -m discoverydb -t st -p 192.168.1.1:3260 --discover
This will search /etc/iscsi/send_targets for a record with the
ID [portal = 192.168.1.1:3260 and type = sendtargets. If found it
@@ -644,7 +632,7 @@ To now log into targets it is the same as with sofware iscsi. See section
- SendTargets iSCSI Discovery updating existing target records:
- ./iscsiadm -m discovery2 -t sendtargets -p 192.168.1.1:3260 \
+ ./iscsiadm -m discoverydb -t sendtargets -p 192.168.1.1:3260 \
-o update --discover
If there is a record for targetX and portalY exists in the DB, and
@@ -654,7 +642,7 @@ To now log into targets it is the same as with sofware iscsi. See section
- SendTargets iSCSI Discovery deleting existing target records:
- ./iscsiadm -m discovery2 -t sendtargets -p 192.168.1.1:3260 \
+ ./iscsiadm -m discoverydb -t sendtargets -p 192.168.1.1:3260 \
-o delete --discover
If there a record for targetX and portalY exists in the DB, but
@@ -668,7 +656,7 @@ To now log into targets it is the same as with sofware iscsi. See section
- SendTargets iSCSI Discovery adding new records:
- ./iscsiadm -m discovery2 -t sendtargets -p 192.168.1.1:3260 \
+ ./iscsiadm -m discoverydb -t sendtargets -p 192.168.1.1:3260 \
-o new --discover
If there targetX and portalY is returned during discovery and does
@@ -677,7 +665,7 @@ To now log into targets it is the same as with sofware iscsi. See section
- SendTargets iSCSI Discovery using multiple ops:
- ./iscsiadm -m discovery2 -t sendtargets -p 192.168.1.1:3260 \
+ ./iscsiadm -m discoverydb -t sendtargets -p 192.168.1.1:3260 \
-o new -o delete --discover
This command will add new portals and delete records for portals
@@ -686,7 +674,7 @@ To now log into targets it is the same as with sofware iscsi. See section
- SendTargets iSCSI Discovery in nonpersistent mode:
- ./iscsiadm -m discovery2 -t sendtargets -p 192.168.1.1:3260 \
+ ./iscsiadm -m discoverydb -t sendtargets -p 192.168.1.1:3260 \
-o nonpersistent --discover
This command will perform discovery, but not manipulate the node DB.
@@ -695,7 +683,7 @@ To now log into targets it is the same as with sofware iscsi. See section
wish to only use a subset of the interfaces in /etc/iscsi/ifaces
then you can pass them in during discovery:
- ./iscsiadm -m discovery2 -t sendtargets -p 192.168.1.1:3260 \
+ ./iscsiadm -m discoverydb -t sendtargets -p 192.168.1.1:3260 \
--interface=iface0 --interface=iface1 --discover
Note that for software iscsi, we let the network layer select
@@ -710,22 +698,22 @@ To now log into targets it is the same as with sofware iscsi. See section
Create new SendTargets discovery record or overwrite an existing
discovery record with iscsid.conf discovery settings.
- ./iscsiadm -m discovery2 -t sendtargets -p 192.168.1.1:3260 -o new
+ ./iscsiadm -m discoverydb -t sendtargets -p 192.168.1.1:3260 -o new
See discovery settings.
- ./iscsiadm -m discovery2 -t sendtargets -p 192.168.1.1:3260 -o show
+ ./iscsiadm -m discoverydb -t sendtargets -p 192.168.1.1:3260 -o show
See hidden discovery settings like CHAP passwords
- ./iscsiadm -m discovery2 -t sendtargets -p 192.168.1.1:3260 \
+ ./iscsiadm -m discoverydb -t sendtargets -p 192.168.1.1:3260 \
-o show --show
Set discovery setting.
- ./iscsiadm -m discovery2 -t sendtargets -p 192.168.1.1:3260 \
+ ./iscsiadm -m discoverydb -t sendtargets -p 192.168.1.1:3260 \
-o update -n name -v value
Delete discovery record. This will also delete the records for
the targets found through the discovery source.
- ./iscsiadm -m discovery2 -t sendtargets -p 192.168.1.1:3260 -o delete
+ ./iscsiadm -m discoverydb -t sendtargets -p 192.168.1.1:3260 -o delete
Node mode. In node mode you can specify which records you want to log
into by specifying the targetname, ip address, port or interface
@@ -1019,19 +1007,19 @@ In this example we would run
Once the iSCSI service is running, you can perform discovery using
SendTarget with:
-iscsiadm -m discovery2 -t sendtargets -p ip:port --discover
+iscsiadm -m discoverydb -t sendtargets -p ip:port --discover
where "ip" is the address of the portal and port is the port.
To use iSNS you can run the discovery command with the type as "isns"
and pass in the ip:port:
-iscsiadm -m discovery2 -t isns -p ip:port --discover
+iscsiadm -m discoverydb -t isns -p ip:port --discover
Both commands will print out the list of all discovered targets and their
portals:
-# iscsiadm -m discovery2 -t st -p 10.15.85.19:3260 --discover
+# iscsiadm -m discoverydb -t st -p 10.15.85.19:3260 --discover
10.15.84.19:3260,2 iqn.1992-08.com.netapp:sn.33615311
10.15.85.19:3260,3 iqn.1992-08.com.netapp:sn.33615311
@@ -1046,7 +1034,7 @@ is iqn.1992-08.com.netapp:sn.33615311.
If you would also like to see the iscsi inteface which will be used
for each session then use the --print[N] option.
-iscsiadm -m discovery2 -t sendtargets -p ip:port -P 1 --discover
+iscsiadm -m discoverydb -t sendtargets -p ip:port -P 1 --discover
will print:
Target: iqn.1992-08.com.netapp:sn.33615311
@@ -1134,15 +1122,15 @@ Example:
SendTargets:
------------
- Create a SendTargets record by passing iscsiadm the "-o new" argument in
- discovery2 mode.
-# iscsiadm -m discovery2 -t st -p 20.15.0.7:3260 -o new
+ discoverydb mode.
+# iscsiadm -m discoverydb -t st -p 20.15.0.7:3260 -o new
New discovery record for [20.15.0.7,3260] added.
- Set the use_discoveryd setting for the record.
-# iscsiadm -m discovery2 -t st -p 20.15.0.7:3260 -o update -n discovery.sendtargets.use_discoveryd -v Yes
+# iscsiadm -m discoverydb -t st -p 20.15.0.7:3260 -o update -n discovery.sendtargets.use_discoveryd -v Yes
- Set the polling interval.
-# iscsiadm -m discovery2 -t st -p 20.15.0.7:3260 -o update -n discovery.sendtargets.discoveryd_poll_inval -v 30
+# iscsiadm -m discoverydb -t st -p 20.15.0.7:3260 -o update -n discovery.sendtargets.discoveryd_poll_inval -v 30
To have the new settings take effect restart iscsid by restarting the
iscsi service.
@@ -1159,15 +1147,15 @@ commands.
iSNS:
----
- Create a iSNS record by passing iscsiadm the "-o new" argument in
- discovery2 mode.
-# iscsiadm -m discovery2 -t isns -p 20.15.0.7:3205 -o new
+ discoverydb mode.
+# iscsiadm -m discoverydb -t isns -p 20.15.0.7:3205 -o new
New discovery record for [20.15.0.7,3205] added.
- Set the use_discoveryd setting for the record.
-# iscsiadm -m discovery2 -t isns -p 20.15.0.7:3205 -o update -n discovery.isns.use_discoveryd -v Yes
+# iscsiadm -m discoverydb -t isns -p 20.15.0.7:3205 -o update -n discovery.isns.use_discoveryd -v Yes
- [OPTIONAL: see iSNS note above] Set the polling interval if needed.
-# iscsiadm -m discovery2 -t st -p 20.15.0.7:3205 -o update -n discovery.isns.discoveryd_poll_inval -v 30
+# iscsiadm -m discoverydb -t st -p 20.15.0.7:3205 -o update -n discovery.isns.discoveryd_poll_inval -v 30
To have the new settings take effect restart iscsid by restarting the
iscsi service.
diff --git a/doc/iscsiadm.8 b/doc/iscsiadm.8
index 106c5bc..7ff3d57 100644
--- a/doc/iscsiadm.8
+++ b/doc/iscsiadm.8
@@ -2,11 +2,10 @@
.SH NAME
iscsiadm \- open-iscsi administration utility
.SH SYNOPSIS
-\fBiscsiadm\fR \-m discovery2 [ \-hV ] [ \-d debug_level ] [ \-P printlevel ] [ \-I iface \-t type \-p ip:port [ \-lD ] ] | [ [ -p ip:port -t type ] \
+\fBiscsiadm\fR \-m discoverydb [ \-hV ] [ \-d debug_level ] [ \-P printlevel ] [ \-I iface \-t type \-p ip:port [ \-lD ] ] | [ [ -p ip:port -t type ] \
[ \-o operation ] [ \-n name ] [ \-v value ] [ \-lD ] ]
-\fBDEPRECIATED: iscsiadm\fR \-m discovery [ \-hV ] [ \-d debug_level ] [ \-P printlevel ] [ \-I iface \-t type \-p ip:port [ \-l ] ] | [ [ -p ip:port ] \
-[ \-o operation ] [ \-n name ] [ \-v value ] [ \-l | \-D ] ]
+\fBiscsiadm\fR \-m discovery [ \-hV ] [ \-d debug_level ] [ \-P printlevel ] [ \-I iface \-t type \-p ip:port [ \-l ] ] | [ [ -p ip:port ] [ \-l | \-D ] ]
\fBiscsiadm\fR \-m node [ \-hV ] [ \-d debug_level ] [ \-P printlevel ] [ \-L all,manual,automatic ] [ \-U all,manual,automatic ] [ \-S ] [ [ \-T targetname \-p ip:port \-I iface ] [ \-l | \-u | \-R | \-s] ]
[ [ \-o operation ] [ \-n name ] [ \-v value ] [ \-p ip:port ] ]
@@ -76,7 +75,7 @@ are experimental and the use is not supported as a stable interface yet.
In discovery mode multiple interfaces can be specified by passing in multiple
\-I/\-\-interface instances. For example,
-"iscsiadm \-m discovery2 \-t st \-p ip:port \-I iface0 \-I iface2 --discover"
+"iscsiadm \-m discoverydb \-t st \-p ip:port \-I iface0 \-I iface2 --discover"
Will direct iscsiadm to setup the node db to create records which will create
sessions though the two intefaces passed in.
@@ -99,7 +98,7 @@ This command and iscsid's SIGTERM handling are experimental.
Discover targets using the discovery record with the \fIrecid\fR matching
the the discovery type and portal passed in. If there is no matching record,
it will be created using the iscsid.conf discovery settings.
-This must be passed in \fIdiscovery2\fR mode to instruct iscsiadm to perform
+This must be passed in \fIdiscoverydb\fR mode to instruct iscsiadm to perform
discovery.
.IP
This option is only valid for SendTargets discovery mode.
@@ -123,9 +122,9 @@ for session mode).
.TP
\fB\-m, \-\-mode \fIop\fR
specify the mode. \fIop\fR
-must be one of \fIdiscovery2\fR, \fInode\fR, \fIfw\fR, \fIhost\fR \fIiface\fR or \fIsession\fR.
+must be one of \fIdiscoverydb\fR, \fInode\fR, \fIfw\fR, \fIhost\fR \fIiface\fR or \fIsession\fR.
.IP
-If no other options are specified: for \fIdiscovery2\fR and \fInode\fR, all
+If no other options are specified: for \fIdiscoverydb\fR and \fInode\fR, all
of their respective records are displayed; for \fIsession\fR, all active
sessions and connections are displayed; for \fIfw\fR, all boot firmware
values are displayed; for \fIhost\fR, all iSCSI hosts are displayed; and
@@ -301,7 +300,7 @@ discovery type. An SLP implementation is under development.
Discover targets at a given IP address:
.ft R
- iscsiadm \-\-mode discovery2 \-\-type sendtargets \-\-portal 192.168.1.10 \-\-discover
+ iscsiadm \-\-mode discoverydb \-\-type sendtargets \-\-portal 192.168.1.10 \-\-discover
.nf
Login, must use a node record id found by the discovery:
diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c
index 92f54dd..b7d11b5 100644
--- a/usr/iscsiadm.c
+++ b/usr/iscsiadm.c
@@ -55,7 +55,7 @@ static char config_file[TARGET_NAME_MAXLEN];
enum iscsiadm_mode {
MODE_DISCOVERY,
- MODE_DISCOVERY2,
+ MODE_DISCOVERYDB,
MODE_NODE,
MODE_SESSION,
MODE_HOST,
@@ -110,8 +110,7 @@ static void usage(int status)
printf("\
iscsiadm -m discovery2 [ -hV ] [ -d debug_level ] [-P printlevel] [ -t type -p ip:port -I ifaceN ... [ -Dl ] ] | [ [ -p ip:port -t type] \
[ -o operation ] [ -n name ] [ -v value ] [ -lD ] ] \n\
-DEPERCIATED: iscsiadm -m discovery [ -hV ] [ -d debug_level ] [-P printlevel] [ -t type -p ip:port -I ifaceN ... [ -l ] ] | [ [ -p ip:port ] \
-[ -o operation ] [ -n name ] [ -v value ] [ -l | -D ] ] \n\
+iscsiadm -m discovery [ -hV ] [ -d debug_level ] [-P printlevel] [ -t type -p ip:port -I ifaceN ... [ -l ] ] | [ [ -p ip:port ] [ -l | -D ] ] \n\
iiscsiadm -m node [ -hV ] [ -d debug_level ] [ -P printlevel ] [ -L all,manual,automatic ] [ -U all,manual,automatic ] [ -S ] [ [ -T targetname -p ip:port -I ifaceN ] [ -l | -u | -R | -s] ] \
[ [ -o operation ] [ -n name ] [ -v value ] ]\n\
iscsiadm -m session [ -hV ] [ -d debug_level ] [ -P printlevel] [ -r sessionid | sysfsdir [ -R | -u | -s ] [ -o operation ] [ -n name ] [ -v value ] ]\n\
@@ -151,8 +150,8 @@ str_to_mode(char *str)
if (!strcmp("discovery", str))
mode = MODE_DISCOVERY;
- else if (!strcmp("discovery2", str))
- mode = MODE_DISCOVERY2;
+ else if (!strcmp("discoverydb", str))
+ mode = MODE_DISCOVERYDB;
else if (!strcmp("node", str))
mode = MODE_NODE;
else if (!strcmp("session", str))
@@ -1735,10 +1734,12 @@ static int exec_disc_op(int disc_type, char *ip, int port,
default:
if (ip) {
/*
- * We only have disc recs for sendtargets, so we can
- * harcode the port check to the iscsi default.
- * If we add isns or slp recs then we have to
- * fix this somehow.
+ * We only have sendtargets disc recs in discovery
+ * mode, so we can hardcode the port check to the
+ * iscsi default here.
+ *
+ * For isns or slp recs then discovery db mode
+ * must be used.
*/
if (port < 0)
port = ISCSI_LISTEN_PORT;
@@ -1755,18 +1756,6 @@ static int exec_disc_op(int disc_type, char *ip, int port,
drec.type == DISCOVERY_TYPE_SENDTARGETS) {
do_sendtargets(&drec, ifaces, info_level,
do_login, op, 0);
- } else if (do_login &&
- drec.type == DISCOVERY_TYPE_SLP) {
- log_error("SLP discovery is not fully "
- "implemented yet.");
- rc = -1;
- goto done;
- } else if (do_login &&
- drec.type == DISCOVERY_TYPE_ISNS) {
- log_error("iSNS discovery is not fully "
- "implemented yet.");
- rc = -1;
- goto done;
} else if (op == OP_NOOP || op == OP_SHOW) {
if (!idbm_print_discovery_info(&drec,
do_show)) {
@@ -1778,38 +1767,23 @@ static int exec_disc_op(int disc_type, char *ip, int port,
log_error("Unable to delete record!");
rc = -1;
}
- } else if (op == OP_UPDATE) {
- struct db_set_param set_param;
-
- if (!name || !value) {
- log_error("Update requires "
- "name and value");
- rc = -1;
- goto done;
- }
- set_param.name = name;
- set_param.value = value;
- if (idbm_discovery_set_param(&set_param,
- &drec))
- rc = -1;
+ } else if (op == OP_UPDATE || op == OP_NEW) {
+ log_error("Operations new and update for "
+ "discovery mode is not supported. "
+ "Use discoverydb mode.");
+ rc = -1;
+ goto done;
} else {
- log_error("Operation is not supported.");
+ log_error("Invalid operation.");
rc = -1;
goto done;
}
-
} else if (op == OP_NOOP || op == OP_SHOW) {
if (!idbm_print_all_discovery(info_level))
rc = -1;
goto done;
- } else if (op == OP_DELETE) {
- log_error("--record required for delete operation");
- rc = -1;
- goto done;
} else {
- log_error("Operations: new and "
- "update for node is not fully "
- "implemented yet.");
+ log_error("Invalid operation.");
rc = -1;
goto done;
}
@@ -2036,7 +2010,7 @@ main(int argc, char **argv)
rc = exec_iface_op(op, do_show, info_level, iface,
name, value);
break;
- case MODE_DISCOVERY2:
+ case MODE_DISCOVERYDB:
if ((rc = verify_mode_params(argc, argv, "DSIPdmntplov", 0))) {
log_error("discovery mode: option '-%c' is not "
"allowed/supported", rc);