This patch is the first step towards supporting USB devices in libvirt
XML format. As per the original thread some months back[1], I'm the
grouping is being done based on device classes, rather than bus types.
So this first patch is actually introducing the concept of 'input'
devices. This is best illustrated by examples
- PS2 mouse - automatically added when yuou turn on <graphics> in
an HVM guest.
<input type='mouse' bus='ps2'/>
- Xen mouse - automatically added when you turn on <graphics> in a
Xen paravirt guest (ie the paravirt input device)
<input type='mouse' bus='xen'/>
- USB mouse - have to actually ask for this. Not all that useful since
its still using relative co-ordinates, but here for completeness.
<input type='mouse' bus='usb'/>
- USB tablet - have to actually ask for this. Very useful. Windows and
Linux can both drive this in absolute co-ordinate mode.
<input type='tablet' bus='usb'/>
If it possible to omit the 'bus' attribute, in which case it'll automatically
set up the device on the most appropriate bus for that type of device. So
if you say type='mouse', it'll pick a ps2/xen bus. If you say
type='tablet'
it'll pick a usb bus.
In my previous email[1] I suggested a possible 'model' attribute as well.
I since discovered that Xen removed support for the summagraphics tablet
completely, so adding a model at this time is a waste of time. We can always
choose it add it later if we port to another virt manager here we need to
distinguish devices on more than just a (type, bus) pair.
As with the previous '<clock/>' element, it is intended that virt-install
and virt-manager will automatically add a USB tablet if they you tell
them you're installing Windows, or a recent Linux guest. It'll also be
possible manally add post-install through the virt-manager UI.
For the QEMU driver at least, I intend to make it possible to hot add &
remove USB devices. This will appear as impl of virAttach/Detch methods
for QEMU at least. Xen doesn't support hot add/remove of USB at this time.
Finally, before I actually commit this I think it is well overdue to
write some unit tests for the QEMU driver. So I'm going to do a test which
chceks XML -> data struct -> QEMU command line, and XML -> data struct ->
XML sequences of operations. This should let us exercise all the XML
related code in QEMU which is a good start & helpful to avoid regressions.
Regards,
Dan.
[1]
http://www.redhat.com/archives/libvir-list/2007-March/msg00205.html
--
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|
|=- Perl modules:
http://search.cpan.org/~danberr/ -=|
|=- Projects:
http://freshmeat.net/~danielpb/ -=|
|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|