]> xenbits.xensource.com Git - libvirt.git/commit
Don't blindly reorder disk drives
authorDaniel P. Berrange <berrange@redhat.com>
Fri, 14 Aug 2009 09:31:36 +0000 (10:31 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Wed, 2 Sep 2009 14:19:34 +0000 (15:19 +0100)
commit2d6adabd53c8f1858191d521dc9b4948d1205955
tree7d323daa1d5a0cbfd439ca153a68f500fddf2392
parentfea5a0bdc9b15666660123f5bd16953b99094534
Don't blindly reorder disk drives

Calling qsort() on the disks array causes disk to be
unneccessarily re-ordered, potentially breaking the
ability to boot if the boot disk gets moved later in
the list. The new algorithm will insert a new disk as
far to the end of the list as possible, while being
ordered correctly wrt other disks on the same bus.

* src/domain_conf.c, src/domain_conf.h: Remove disk sorting
  routines. Add API to insert a disk into existing list at
  the optimal position, without resorting disks
* src/libvirt_private.syms: Export virDomainDiskInsert
* src/xend_internal.c, src/xm_internal.c: Remove calls to
  qsort, use virDomainDiskInsert instead.
* src/qemu_driver.c: Remove calls to qsort, use virDoaminDiskInsert
  instead. Fix reordering bugs when hotunplugging disks and
  networks. Fix memory leak in disk/net unplug
src/domain_conf.c
src/domain_conf.h
src/libvirt_private.syms
src/qemu_driver.c
src/xend_internal.c
src/xm_internal.c
tests/sexpr2xmldata/sexpr2xml-fv-v2.sexpr
tests/xml2sexprdata/xml2sexpr-fv-vncunused.xml
tests/xml2sexprdata/xml2sexpr-fv.xml