domain_update_node_affinity: bail out early if no VCPUs are allocated
authorJulien Grall <julien.grall@linaro.org>
Mon, 11 Aug 2014 13:11:43 +0000 (15:11 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 11 Aug 2014 13:11:43 +0000 (15:11 +0200)
commit34155c34aec89ea0dec94c44d714c9085beb6135
tree5e9f8604e5368dd7a38e8f6c1b24b0cbb9cf5750
parentca063d4480e618834f142817032a1434077554f5
domain_update_node_affinity: bail out early if no VCPUs are allocated

The commit "move domain to cpupool0 before destroying it" make Xen crashes
when a domain is destroyed with d->vcpus allocated but no VCPU initialized.

Assertion '!cpumask_empty(dom_cpumask)' failed at domain.c:452
Xen call trace:
    [<00207bd8>] domain_update_node_affinity+0x10c/0x238 (PC)
    [<00000004>] 00000004 (LR)
    [<00226870>] sched_move_domain+0x3cc/0x42c
    [<0020925c>] domain_kill+0xc8/0x178
    [<00206a0c>] do_domctl+0xaac/0x15e4
    [<002529c0>] do_trap_hypervisor+0xc5c/0xf94
    [<002559f0>] return_from_trap+0/0x4

Bail out early if there is d->VCPU is not allocated or VCPU 0 has not been
initialized.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
xen/common/domain.c
xen/common/schedule.c