[stgt] [PATCH 4/5] Call user defined callback progam from target_redirected()

Chandra Seetharaman sekharan at us.ibm.com
Tue Sep 7 22:41:57 CEST 2010


On Tue, 2010-09-07 at 09:49 +0900, FUJITA Tomonori wrote:
> On Wed, 01 Sep 2010 17:46:09 -0700
> Chandra Seetharaman <sekharan at us.ibm.com> wrote:
> 
> > Implement the calling of user defined callback.
> > 
> > Basically, the callback is called from target_redirected() to get 
> > redirect address, redirect port and redirect reason in 
> > "string_addr:string_port:string_reason" syntax.
> > 
> > Signed-Off-By: Chandra Seetharaman <sekharan at us.ibm.com>
> > ---
> >  usr/iscsi/target.c |   32 ++++++++++++++++++++++++++++++++
> >  1 file changed, 32 insertions(+)
> > 
> > Index: tgt-1.0.8/usr/iscsi/target.c
> > ===================================================================
> > --- tgt-1.0.8.orig/usr/iscsi/target.c
> > +++ tgt-1.0.8/usr/iscsi/target.c
> > @@ -197,7 +197,38 @@ int target_redirected(struct iscsi_targe
> >  	socklen_t len;
> >  	int ret, rsn;
> >  	char *p, *q, *str, *port, *addr;
> > +	char buffer[NI_MAXHOST + NI_MAXSERV + 4];
> >  
> > +	if (target->redirect_info.callback) {
> > +		bzero(buffer, NI_MAXHOST + NI_MAXSERV + 4);
> > +		ret = call_program(target->redirect_info.callback,
> > +				buffer, NI_MAXHOST + NI_MAXSERV + 4);
> 
> Are there more info thatp possibly might be useful to the external
> program? The target name?

That is a good one, I will add it.

Thanks for the comments.


--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list