[Libguestfs] [PATCH 2/2] launch: Add add_drive 'label' option.

Richard W.M. Jones rjones at redhat.com
Fri Oct 5 19:33:32 UTC 2012


On Fri, Oct 05, 2012 at 02:03:44PM +0200, Olaf Hering wrote:
> On Fri, Oct 05, Richard W.M. Jones wrote:
> 
> > On Fri, Oct 05, 2012 at 12:32:58PM +0200, Olaf Hering wrote:
> > > No support for digits etc.?
> > The underlying serial field supports digits and more (in fact it's
> > really an arbitrary 20 byte buffer).  However I excluded digits in
> > this case because the usual Linux naming scheme for partitions is
> > either:
> > 
> >   /dev/<name><partnum>
> > 
> > where <name> ends in an alphabetic character (eg. /dev/sda) , else:
> > 
> >   /dev/<name>p<partnum>
> > 
> > where <name> ends in a digit (eg. /dev/mmcblk0p1).
> > 
> > If we allow people to use a label that ends in a digit then we'd
> > (probably) need to abide by this convention too, which makes things
> > complicated.  I agree this is not ideal, but also we can relax this
> > restriction later.
> 
> Isnt the above true only for kernel names, but not for persistant
> devicenames in /dev/disk/by-{id,name,label,foo}. I think the latter get
> "-partN" appended by udev.

Correct, by rules like this:

KERNEL=="vd*[0-9]", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}-part%n"

However I don't know if that convention is necessarily a good one to
follow (it's completely different from the one we use in other parts
of the API for example).

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://et.redhat.com/~rjones/virt-df/




More information about the Libguestfs mailing list