[PATCH 0/2] launch: Add add_drive 'label' option
This completes the implementation previously posted here: https://www.redhat.com/archives/libguestfs/2012-October/msg00002.html Instead of using 'serial', the option is now called 'label' and these are collectively called disk labels. Also the updated patch adds a test. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
-- 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/
On Fri, Oct 05, 2012 at 12:32:58PM +0200, Olaf Hering wrote:
On Fri, Oct 05, Richard W.M. Jones wrote:
+=item C<label> + +Give the disk a label. The label should be a unique, short +string using I<only> ASCII characters C<[a-zA-Z]>.
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. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
On Fri, Oct 05, Richard W.M. Jones 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
On Fri, Oct 05, 2012 at 12:32:58PM +0200, Olaf Hering wrote: 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. Olaf
On Fri, Oct 05, 2012 at 02:03:44PM +0200, Olaf Hering wrote:
On Fri, Oct 05, Richard W.M. Jones 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
On Fri, Oct 05, 2012 at 12:32:58PM +0200, Olaf Hering wrote: 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/
participants (2)
-
Olaf Hering -
Richard W.M. Jones