]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
conf: Optimize the iothreadid initialization
authorJohn Ferlan <jferlan@redhat.com>
Tue, 13 Oct 2015 12:26:27 +0000 (08:26 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Fri, 16 Oct 2015 10:55:50 +0000 (06:55 -0400)
commitbb02d4c429673b9ee6d979a8bdf6eda54f62fe54
tree99bf45131f34287e2a184e9bf91aabe0b9e93f14
parentcc2d49f9be13e439efcdbd4e1c161750f4208995
conf: Optimize the iothreadid initialization

https://bugzilla.redhat.com/show_bug.cgi?id=1264008

The existing algorithm assumed that someone was making small, incremental
changes; however, it is possible to change iothreads from 0 (or relatively
small number) to some really large number and the algorithm would possibly
spin its wheels doing unnecessary searches.

So, optimize the algorithm using a bitmap to find available iothread_id's
starting at 1 that aren't already defined by a "<thread id='#'>" and
filling in the iothreadids array with those iothread_id values.
src/conf/domain_conf.c