[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] domain_update_node_affinity: bail out early if no VCPUs are allocated



commit 34155c34aec89ea0dec94c44d714c9085beb6135
Author:     Julien Grall <julien.grall@xxxxxxxxxx>
AuthorDate: Mon Aug 11 15:11:43 2014 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Aug 11 15:11:43 2014 +0200

    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@xxxxxxxxxx>
---
 xen/common/domain.c   |    4 ++++
 xen/common/schedule.c |    4 +---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index d7a84cf..1952070 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -415,6 +415,10 @@ void domain_update_node_affinity(struct domain *d)
     struct vcpu *v;
     unsigned int cpu;
 
+    /* Do we have vcpus already? If not, no need to update node-affinity. */
+    if ( !d->vcpu || !d->vcpu[0] )
+        return;
+
     if ( !zalloc_cpumask_var(&dom_cpumask) )
         return;
     if ( !zalloc_cpumask_var(&dom_cpumask_soft) )
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 9a49769..55503e0 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -310,9 +310,7 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
         SCHED_OP(old_ops, free_vdata, vcpudata);
     }
 
-    /* Do we have vcpus already? If not, no need to update node-affinity */
-    if ( d->vcpu )
-        domain_update_node_affinity(d);
+    domain_update_node_affinity(d);
 
     domain_unpause(d);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.