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

Re: [Nbd] How to find a free NBD device?



Op maandag 3 maart 2014 13:26:43 schreef Paul Clements:

> On Mon, Mar 3, 2014 at 1:16 PM, Andreas Klauer

>

> <Andreas.Klauer@...1264...> wrote:

> > So the method seems to be:

> >

> > 1) check /proc/partitions

> > 2) check /sys/block/nbd*/pid

> > 3) lock your own program and hope no-one is racing you

>

> Yes, that's basically it. And if any ioctl returns -EBUSY, then retry

> from the start. BTW, "losetup --find" just looks at /proc/partitions.

 

We did have a vague discussion once about having something like a /dev/nbdmaster which would be used for a "give me an nbd device" type call. This would also mean that /dev/nbdX would not exist until the "give me an nbd device" call had been made.

 

I still think that would be a good idea, but AFAIK it never got implemented. Paul, what's your opinion on that?

 

--

This end should point toward the ground if you want to go to space.

 

If it starts pointing toward space you are having a bad problem and you

will not go to space today.

 

-- http://xkcd.com/1133/

 


Reply to: