[libvirt] [PATCH] Update domain xml after usb hotplug
Richard W.M. Jones
rjones at redhat.com
Fri Aug 22 08:49:50 UTC 2008
On Thu, Aug 21, 2008 at 11:21:33PM -0400, Cole Robinson wrote:
> The recently added usb hostdev and mass storage device
> hotplug code doesn't append the devices to the running
> guests xml if the hotplug succeeds. The attached patch
> fixes this.
IIRC there was some question about whether it should actually do this.
I think it should -- a user would expect that when you attach a device
to a domain, the device should appear in the XML (and be persistent
too).
So I ACK this patch.
This code pattern:
> + /* Find spot in domain definition where we will put the disk */
> + ptr = vm->def->disks;
> + prev = &(vm->def->disks);
> + while (ptr) {
> ....
appears at least twice. What we need is a Set abstract type.
Implementing it as a red-black self-balancing tree would avoid any
unexpected surprises when someone's guest has 100s of devices
attached.
Rich.
Ob-OCaml-hack. The Set type in OCaml, implemented as an RB-tree,
comes with a formal proof of correctness which runs to 5000 lines and
took two man-months to complete. Along the way they found bugs in the
original implementation.
--
Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines. Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.
http://et.redhat.com/~rjones/virt-p2v
More information about the libvir-list
mailing list