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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2010-09-07 at 09:49 +0900, FUJITA Tomonori wrote:
> On Wed, 01 Sep 2010 17:46:09 -0700
> Chandra Seetharaman <sekharan@xxxxxxxxxx> 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@xxxxxxxxxx>
> > ---
> >  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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Linux RAID]     [Linux Clusters]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]

  Powered by Linux