x86/hvm: Bind xen-created event channels to building domain
authorDaniel De Graaf <dgdegra@tycho.nsa.gov>
Tue, 8 Jan 2013 09:37:38 +0000 (10:37 +0100)
committerDaniel De Graaf <dgdegra@tycho.nsa.gov>
Tue, 8 Jan 2013 09:37:38 +0000 (10:37 +0100)
Instead of using a hardcoded domain 0 as the endpoint for the event
channels created in hvm_vcpu_initialise, use the domain ID of the
building domain so that a domain builder in a domain other than dom0 has
the expected access to the event channels.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/hvm.c

index 40c1ab219f463fb065536b8951c6785a21359b73..682d934c7e685052d285a453a850d52758f8adad 100644 (file)
@@ -1071,7 +1071,7 @@ int hvm_vcpu_initialise(struct vcpu *v)
         goto fail3;
 
     /* Create ioreq event channel. */
-    rc = alloc_unbound_xen_event_channel(v, 0, NULL);
+    rc = alloc_unbound_xen_event_channel(v, current->domain->domain_id, NULL);
     if ( rc < 0 )
         goto fail4;
 
@@ -1081,7 +1081,7 @@ int hvm_vcpu_initialise(struct vcpu *v)
     if ( v->vcpu_id == 0 )
     {
         /* Create bufioreq event channel. */
-        rc = alloc_unbound_xen_event_channel(v, 0, NULL);
+        rc = alloc_unbound_xen_event_channel(v, current->domain->domain_id, NULL);
         if ( rc < 0 )
             goto fail2;
         v->domain->arch.hvm_domain.params[HVM_PARAM_BUFIOREQ_EVTCHN] = rc;