[libvirt] [PATCH] Fix disk device ordering

Richard W.M. Jones rjones at redhat.com
Fri Aug 22 08:34:16 UTC 2008


On Thu, Aug 21, 2008 at 11:21:15PM -0400, Cole Robinson wrote:
> When parsing the domain xml, disks are supposed to be
> rearranged in an alphabetic order based on bus type
> and target. The reordering code had a flaw though, in
> that it would always put the first disk it encountered
> at the head of the list, and had no way of putting
> new entries in front of it.
> 
> The attached patch reworks the code to compare the new
> disk against the current disk entry (rather than the
> next entry like the existing code). Seems to pass all
> my tests.

Urgh, the perils of writing everything in C.

+1, this code looks correct to me.

Rich.

-- 
Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
Read my OCaml programming blog: http://camltastic.blogspot.com/
Fedora now supports 60 OCaml packages (the OPEN alternative to F#)
http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora




More information about the libvir-list mailing list