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

Re: [Xen-devel] help with event channels


  • To: David Richardson <daverich04@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
  • Date: Tue, 12 Dec 2006 07:24:18 +0000
  • Delivery-date: Mon, 11 Dec 2006 23:24:20 -0800
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: AccdvojUxwkQNomxEduj9wANk04WTA==
  • Thread-topic: [Xen-devel] help with event channels

On 11/12/06 7:54 pm, "David Richardson" <daverich04@xxxxxxxxx> 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



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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