On Mon, Feb 01, 2010 at 05:23:32PM +0000, Matthew Booth wrote:
+sub _configure_default_devices
+{
+ my ($dom, $default_dom) = @_;
+
+ my ($devices) = $dom->findnodes('/domain/devices');
+
+ # Remove any existing input, graphics or video devices
+ foreach my $input ($devices->findnodes('input | video | graphics')) {
+ $devices->removeChild($input);
+ }
+
+ my ($input_devices) = $default_dom->findnodes('/domain/devices');
+
+ # Add new default devices from default XML
+ foreach my $input ($input_devices->findnodes('input | video | graphics'))
{
+ my $new = $input->cloneNode(1);
+ $new->setOwnerDocument($devices->getOwnerDocument());
+ $devices->appendChild($new);
+ }
+}
How do we know that the guest has drivers for these, or do we just
assume that any guest can drive a basic Cirrus card etc?
What sort of devices do ESX guests come configured with? Is the XML
generated by the libvirt ESX driver an accurate reflection of this?
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://et.redhat.com/~rjones/libguestfs/
See what it can do:
http://et.redhat.com/~rjones/libguestfs/recipes.html