aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/domain.c
diff options
context:
space:
mode:
authorKeir Fraser <keir@xen.org>2010-11-17 16:42:37 +0000
committerKeir Fraser <keir@xen.org>2010-11-17 16:42:37 +0000
commit9b231b6bc20bc55e55ed5511eb1b74ad3686ad94 (patch)
treec8bf7ae675e6a0b4e9aac4c0ebd691fd29f71572 /xen/common/domain.c
parent89b31d1255573286bab1853f47bfa50ff9d89801 (diff)
downloadxen-9b231b6bc20bc55e55ed5511eb1b74ad3686ad94.tar.gz
xen-9b231b6bc20bc55e55ed5511eb1b74ad3686ad94.tar.bz2
xen-9b231b6bc20bc55e55ed5511eb1b74ad3686ad94.zip
Wait queues, allowing conditional sleep in hypervisor context.
Signed-off-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/common/domain.c')
-rw-r--r--xen/common/domain.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 69a0ab4b62..1a08636756 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -27,6 +27,7 @@
#include <xen/percpu.h>
#include <xen/multicall.h>
#include <xen/rcupdate.h>
+#include <xen/wait.h>
#include <acpi/cpufreq/cpufreq.h>
#include <asm/debugger.h>
#include <public/sched.h>
@@ -162,10 +163,12 @@ struct vcpu *alloc_vcpu(
v->vcpu_info = ((vcpu_id < XEN_LEGACY_MAX_VCPUS)
? (vcpu_info_t *)&shared_info(d, vcpu_info[vcpu_id])
: &dummy_vcpu_info);
+ init_waitqueue_vcpu(v);
}
if ( sched_init_vcpu(v, cpu_id) != 0 )
{
+ destroy_waitqueue_vcpu(v);
free_vcpu_struct(v);
return NULL;
}
@@ -173,6 +176,7 @@ struct vcpu *alloc_vcpu(
if ( vcpu_initialise(v) != 0 )
{
sched_destroy_vcpu(v);
+ destroy_waitqueue_vcpu(v);
free_vcpu_struct(v);
return NULL;
}
@@ -617,6 +621,7 @@ static void complete_domain_destroy(struct rcu_head *head)
tasklet_kill(&v->continue_hypercall_tasklet);
vcpu_destroy(v);
sched_destroy_vcpu(v);
+ destroy_waitqueue_vcpu(v);
}
grant_table_destroy(d);