[stgt] RFC [patch] README.passthrough v1 (2nd send)

Nicholas A. Bellinger nab at linux-iscsi.org
Fri Aug 20 11:29:42 CEST 2010


On Fri, 2010-08-20 at 11:22 +0900, FUJITA Tomonori wrote:
> On Thu, 19 Aug 2010 12:51:54 -0700
> "Nicholas A. Bellinger" <nab at linux-iscsi.org> wrote:
> > So it looks like the failure is attributed to my hardcoding of major 254
> > in the original STGT/BSG patch (note the comment above the conditional
> > check).  Here is a quick fix:
> > 
> > diff --git a/usr/bs_sg.c b/usr/bs_sg.c
> > index cda5cd2..a369570 100644
> > --- a/usr/bs_sg.c
> > +++ b/usr/bs_sg.c
> > @@ -289,7 +289,7 @@ static int chk_sg_device(char *path)
> >                 return 0;
> >  
> >         /* This is not yet defined in include/linux/major.h.. */
> > -       if (major(st.st_rdev) == 254)
> > +       if ((major(st.st_rdev) == 254) || (major(st.st_rdev) == 253))
> >                 return 1;
> >  
> >         return -1;
> 
> Well, seems that nobody uses the bsg support except for you. :)
> 
> The above patch is still wrong.
> 
> bsg major number can be anything. So you need to get it from
> /proc/devices.
> 
> Or you can also get it from /sys/class/bsg/, which is created by
> kernel so available on any distributions.
> 
> You can steal the bsg device handling code from sg3-utils. Maybe
> someone could create something like libbsg.so

Hmmm indeed, thanks for point this one out.   I will have look at
adressing for this the BSG efforts with STGT and QEMU-KVM using the
recommended major:minor output from /sys/class/bsg/$HCTL/dev.

Best,

--nab

--
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