Re: [Nbd] How to find a free NBD device?
- To: firstname.lastname@example.org
- Subject: Re: [Nbd] How to find a free NBD device?
- From: Andreas Klauer <Andreas.Klauer@...1264...>
- Date: Mon, 3 Mar 2014 19:16:19 +0100
- Message-id: <20140303181619.GA17222@...1265...>
- In-reply-to: <20140303174147.GA16734@...1265...>
- References: <20140303174147.GA16734@...1265...>
On Mon, Mar 03, 2014 at 06:41:47PM +0100, Andreas Klauer wrote:
> Is there something I'm missing?
Sorry, I see this has been discussed earlier on this list:
Another thing I found is a patch for qemu-nbd:
(the patch didn't seem to make it though)
That patch discussion also mentions a NBD_SET_LOCK but I could not
find any other reference to that...
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
Is that it?