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

Re: [Nbd] nbd protocol specification?



On Mon, Jan 21, 2013 at 04:25:32PM +0100, Goswin von Brederlow wrote:
> On Mon, Jan 21, 2013 at 09:08:15AM +0100, Wouter Verhelst wrote:
> > On Mon, Jan 14, 2013 at 01:41:34PM +0100, Andreas Klauer wrote:
> > > Hi,
> > > 
> > > I need to implement a block device in user space with my own idea
> > > of read and write (like a selective copy-on-write layer). The thing 
> > > would be machine-local, network is not important.
> > > 
> > > I'm currently using FUSE + loop for that, but googling I came across 
> > > a [1]BUSE discussion on LKML which in turn referred to NBD. 
> > > (never even heard of NBD before... *blush*)
> > > 
> > > I experimented a bit with it and it seems like an interesting 
> > > alternative for me, but to use it, it appears I have to implement 
> > > the protocol myself since there doesn't seem to be a C library like 
> > > the one FUSE offers? Or is there one I have missed?
> > 
> > There isn't such a library, indeed. I've been thinking about turning the
> > server side of NBD into a library and making nbd-server depend on that
> > off and on for a few years, but it just hasn't happened (yet?)
> 
> I've been thinking of writing a buse kernel module (like fuse/cuse but
> for block devices) on and off for a few years, but it just hasn't
> happened (yet?).
> 
> Now wouldn't it be great to design the NBD server library in such a
> way that it would provide a suitable API for both use cases? After all
> buse would just cut out the tcp socket inbetween the server and client
> part and communicate with the kernel directly.

You can just create a unix domain socket and pass that on to the kernel,
really. There, you now have a block device in user space ;-)

-- 
Copyshops should do vouchers. So that next time some bureaucracy requires you
to mail a form in triplicate, you can mail it just once, add a voucher, and
save on postage.



Reply to: