cpupool: correct error handling when removing cpu from cpupool
authorJuergen Gross <jgross@suse.com>
Wed, 9 Mar 2016 15:44:04 +0000 (16:44 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 9 Mar 2016 15:48:30 +0000 (16:48 +0100)
commitd62ead2eb23491de50cf65f548d66c2e433de455
tree330e143ca22d9822bb0fb905d491475b8957eb7c
parent0aa1330aac92fd75f185c9b354396014178fe95d
cpupool: correct error handling when removing cpu from cpupool

When schedule_cpu_switch() called from cpupool_unassign_cpu_helper()
returns an error, the domlist_read_lock isn't released again.

As cpu_disable_scheduler() might have changed affinity of some
domains domain_update_node_affinity() must be called for all domains
in the cpupool even in error case.

Even if looking weird it is okay to let the to be removed cpu set in
cpupool_free_cpus in case of an error returned by
cpu_disable_scheduler(). Add a comment explaining the reason for this.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
xen/common/cpupool.c