qemu-discuss
[Top][All Lists]
Advanced

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

Re: [Qemu-discuss] qemu-nbd: knowing which nbd device number to connect


From: Raphael Bauduin
Subject: Re: [Qemu-discuss] qemu-nbd: knowing which nbd device number to connect
Date: Tue, 1 Oct 2013 15:22:09 +0200




On Thu, Sep 26, 2013 at 6:00 PM, Phil Ehrens <address@hidden> wrote:
Does this help?:

 udevadm info -q all -n /dev/nbdN

I don't think so. running the command on /dev/nbd0 gives the same result wether nbd0 is connected or not.
Currently I have 2 ways to check if the device is connected: the first is calling file on the device and check if it is empty or not. The second is call lsblk and see if the device is in the list.

thx anyway for the suggestion.

Raph


 

Raphael Bauduin wrote:
> Hi,
>
> thanks for your answer.
>
> But this lists all nbd devices, even those not connected, so it doesn't do
> what I need.
>
> Raph
>
>
> On Wed, Sep 25, 2013 at 5:31 PM, Phil Ehrens <address@hidden>wrote:
>
> > This may be all you need:
> >
> >  ls /dev/nbd*
> >
> > Unless the nbd model supports disconnection and reuse
> > of an existing device. Sorry, again I'm just guessing.
> >
> > Please tell me if I'm being a nuisance.
> >
> > Raphael Bauduin wrote:
> > > Hi,
> > >
> > > I'm accessing qcow2 images via nbd. This is done with a command as
> > > qemu-nbd -c /dev/nbd0 /path/to/image.qcow
> > >
> > > When making several images available, I use subsequent numbers for the
> > > /dev/nbd device to attach to. Is there a way to get the first available
> > nbd
> > > device number ?
> > >
> > > Thanks
> > >
> > > Raph
> >
> > --
> > Phil Ehrens <address@hidden> |              mm
> > The LIGO Laboratory, MS 100-36     |           /^(  )^\
> > California Institute of Technology |           \,(..),/
> > 1200 East California Blvd.         |             V~~V
> > Pasadena, CA 91125 USA             | My gpg public key:
> > Phone:(626)395-8518                | http://www.imbe.net/peligo.asc
> >
>
>
>
> --
> Web database: http://www.myowndb.com
> Free Software Developers Meeting: http://www.fosdem.org

--
Phil Ehrens <address@hidden> |              mm
The LIGO Laboratory, MS 100-36     |           /^(  )^\
California Institute of Technology |           \,(..),/
1200 East California Blvd.         |             V~~V
Pasadena, CA 91125 USA             | My gpg public key:
Phone:(626)395-8518                | http://www.imbe.net/peligo.asc



--
Web database: http://www.myowndb.com
Free Software Developers Meeting: http://www.fosdem.org

reply via email to

[Prev in Thread] Current Thread [Next in Thread]