diff options
author | dmitry_yus <dmitry_yus@d7303112-9cec-0310-bdd2-e83a94d6c2b6> | 2005-08-21 14:05:26 +0000 |
---|---|---|
committer | dmitry_yus <dmitry_yus@d7303112-9cec-0310-bdd2-e83a94d6c2b6> | 2005-08-21 14:05:26 +0000 |
commit | a254867de562321fdfc1a15300c389a1d423e53f (patch) | |
tree | b1e0cc51dbd4d7e136f8a16839584ec50383e32e /usr/mgmt_ipc.c | |
parent | 3c0f3bf82f7e726eb63c8065cabf53a36bc2c96c (diff) | |
download | open-iscsi-a254867de562321fdfc1a15300c389a1d423e53f.tar.gz |
Hannes Reinecke:
I found it really annoying that iscsiadm has to get it's information
from some file (eg /etc/initiatorname.iscsi and /etc/iscsid.conf), when
there is
a) no chance to set the via the commandline
b) this information is already present in the daemon.
So here's a patch which will retrieve this information from the daemon.
And while I've been at it, the initiatorname and config file name can
now the changed from the commandline of the daemon, too.
git-svn-id: svn://svn.berlios.de/open-iscsi@401 d7303112-9cec-0310-bdd2-e83a94d6c2b6
Diffstat (limited to 'usr/mgmt_ipc.c')
-rw-r--r-- | usr/mgmt_ipc.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/usr/mgmt_ipc.c b/usr/mgmt_ipc.c index bc85e18..3b9e756 100644 --- a/usr/mgmt_ipc.c +++ b/usr/mgmt_ipc.c @@ -177,6 +177,30 @@ mgmt_ipc_session_logout(queue_task_t *qtask, int rid) } static mgmt_ipc_err_e +mgmt_ipc_cfg_initiatorname(queue_task_t *qtask, iscsiadm_rsp_t *rsp) +{ + strcpy(rsp->u.config.var, dconfig->initiator_name); + + return MGMT_IPC_OK; +} + +static mgmt_ipc_err_e +mgmt_ipc_cfg_initiatoralias(queue_task_t *qtask, iscsiadm_rsp_t *rsp) +{ + strcpy(rsp->u.config.var, dconfig->initiator_alias); + + return MGMT_IPC_OK; +} + +static mgmt_ipc_err_e +mgmt_ipc_cfg_filename(queue_task_t *qtask, iscsiadm_rsp_t *rsp) +{ + strcpy(rsp->u.config.var, dconfig->config_file); + + return MGMT_IPC_OK; +} + +static mgmt_ipc_err_e mgmt_ipc_conn_add(queue_task_t *qtask, int rid, int cid) { return MGMT_IPC_ERR; @@ -341,6 +365,18 @@ mgmt_ipc_handle(int accept_fd) rsp.err = mgmt_ipc_conn_remove(qtask, req.u.conn.rid, req.u.conn.cid); break; + case MGMT_IPC_CONFIG_INAME: + rsp.err = mgmt_ipc_cfg_initiatorname(qtask, &rsp); + immrsp = 1; + break; + case MGMT_IPC_CONFIG_IALIAS: + rsp.err = mgmt_ipc_cfg_initiatoralias(qtask, &rsp); + immrsp = 1; + break; + case MGMT_IPC_CONFIG_FILE: + rsp.err = mgmt_ipc_cfg_filename(qtask, &rsp); + immrsp = 1; + break; default: log_error("unknown request: %s(%d) %u", __FUNCTION__, __LINE__, req.command); |