From mboxrd@z Thu Jan 1 00:00:00 1970 From: NAHieu Subject: Re: back/frontend drivers HelloWorld Date: Sun, 25 Sep 2005 18:38:51 -0700 Message-ID: <5d7aca950509251838175955e@mail.gmail.com> References: <200509221746.32758.tiger@swsoft.mipt.ru> <5d7aca9505092302532b4e88eb@mail.gmail.com> <766473d1a313531c949034405df37ec5@cl.cam.ac.uk> <5d7aca9505092410405b07022@mail.gmail.com> <1d35e5803140b27e1535e7c1c146d5c4@cl.cam.ac.uk> <5d7aca95050925092427b30189@mail.gmail.com> Reply-To: NAHieu Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: xen-devel List-Id: xen-devel@lists.xenproject.org On 9/25/05, Keir Fraser wrote: > > On 25 Sep 2005, at 17:24, NAHieu wrote: > > > - Is that correct? ( I have some doubts about (2), as I see that the > > drivers available in xen uses xenbus_driver.probe to detect domU's > > driver?) > > All correct, but you skip a few details. > > In step 1, domU gets the event channel port via EVTCHNOP_alloc_unbound. > It then writes that port value to xenstore. > > In step 2, dom0 binds to the remote event-channel port via > EVTCHNOP_bind_interdomain. This returns the allocated local port which > is what is passed to bind_evtchn_to_irqhandler(). > See code in drivers/xen/blkback/interface.c for a precise example of > doing this -- probably best to steal that portion of code as a > template. > > Also, you can find code in blkfront/blkback to allocate a shared page > in blkfront, allocate a grant reference for it, pass that to blkback > and map the page thru the grant reference. > I looked at some frontend code, and they all exploit the xenbus_driver (and the needed common fields are .ids, .probe and .remove ). So it is mandatory for all backend/frontend (regardless of real or virtual device) to do like that ? Keir, thank you a lot. Hieu