These two patches are for discussion of the proposed API only (in
fact, it doesn't compile).
virtio-scsi allows you to name drives (using the qemu serial=...
option or libvirt <serial/>). Let's allow users to specify a serial
when adding a drive, and then map that to a well-known name in the
libguestfs API (/dev/disk/guests/SERIAL[PARTNUM]).
Note that I chose not to change list-devices / list-partitions. These
still return raw device names (which still exist, even if the serial
is used). Instead there is a new API called list-serial-names which
returns a mapping of the serial names to raw device names.
This patch is in preparation for hotplugging. The plan would be to
remove the restriction that add_drive{_opts} has to be called before
launch. If it's called after launch (ie. hotplugging) then we
strongly recommend that users specify the serial option so the disk
has a predictable name.
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/