From: Keir Fraser Subject: Re: help with event channels Date: Tue, 12 Dec 2006 07:24:18 +0000 Message-ID: References: <262848.62107.qm@web53113.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <262848.62107.qm@web53113.mail.yahoo.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: David Richardson , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 11/12/06 7:54 pm, "David Richardson" wrote: > I'd really appreciate any help with how to create a > simple event channel between dom0 and a userspace > program in domU. I'm running Xen3.0.3 stable. Thanks > in advance. Assuming userspace-to-userspace, both apps need to be linked against libxenctrl. Then domU executes xc_evtchn_bind_unbound_port(xce_handle, 0). The return value is a port number that dom0 can pass to xc_evtchn_bind_interdomain(xce_handle, domU, domU_port). The 'xce_handle' is obtained via a call to xc_evtchn_open(). You send an even to the remote end via xc_evtchn_notify(). You receive an event by, for example, read(xc_evtchn_fd(), &buffer, 2). Each 2-byte element in the read stream is a port id. You receive no further notifications on a particular port until you write() the 2 bytes back via the xc_evtchn_fd(). -- Keir