diff --git a/xen/common/sched_null.c b/xen/common/sched_null.c index 2edac234a5..26c6f0f129 100644 --- a/xen/common/sched_null.c +++ b/xen/common/sched_null.c @@ -368,6 +368,8 @@ static bool vcpu_deassign(struct null_private *prv, struct vcpu *v) struct null_vcpu *wvc; ASSERT(list_empty(&null_vcpu(v)->waitq_elem)); + ASSERT(per_cpu(npc, v->processor).vcpu == v); + ASSERT(!cpumask_test_cpu(v->processor, &prv->cpus_free)); per_cpu(npc, cpu).vcpu = NULL; cpumask_set_cpu(cpu, &prv->cpus_free); @@ -529,9 +531,6 @@ static void null_vcpu_remove(const struct scheduler *ops, struct vcpu *v) goto out; } - ASSERT(per_cpu(npc, v->processor).vcpu == v); - ASSERT(!cpumask_test_cpu(v->processor, &prv->cpus_free)); - vcpu_deassign(prv, v); out: