WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Front-end back-end connection

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Front-end back-end connection
From: Daniel Castro <evil.dani@xxxxxxxxx>
Date: Wed, 12 Oct 2011 16:13:35 +0900
Delivery-date: Wed, 12 Oct 2011 00:14:30 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=w7avXAdlujgmXEjG1vqjkyS+K/pSmV3IcuwxPpo7eE8=; b=Vvut/jZ7pSO27RoW8ZNzdaoRavlNZt9DRc69BaR+6SKY9bZggbxwJpOTzhLQgLy1o6 a+WDG8qRixtyRD+keRJTVJmxgq1sBQyQ4wNkmw+MVmRfCypUz4B5qsIoczqMXg9a8aUz l0BgEVG8HETn1h3AgZw/Nvp/IEkTFe5QgFj2s=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hello All,

I am in the process of conecting my front-end to my back end.
The process is like this:
1. Set up xenstore conection
2. initiate front rings
3. Initiate gran table
4. Take my rings mfn address and set it up as a entry (more on this)
5. create a unbound port for front-back ring communication (more on this )
5.1 I start by changing state to XenbusStateInitialising
5.2 ring-ref entry (step 4)
5.3 port entry (step 5)
5.4 backend state is XenbusStateInitWait
5.4 change state to XenbusStateInitialised
5.5 back end state is XenbusStateClosing meaning there is an error or
something is missing.
6. on sucess end

More on step 4: I got my grant page table like this:
        struct gnttab_setup_table gst;
        grant_entries = (struct grant_entry_v1 *) memalign_high(4096, 4096);
//asume malloc
        memset(grant_entries,0,4096);
        gst.dom = DOMID_SELF; //&me
        gst.nr_frames = 1; //a single page
        //gst.frame_list = grant_entries; (I have no idea how to handle this :P 
)
        res = hypercall_grant_table_op(GNTTABOP_map_grant_ref, &gst, 1);
I think this works, but maybe I am wrong. This is needed on step 5, so..
More on step 5:
I consider the grant table an array of type struct grant_entry_v1.
So I simply do grant_entry_v1[0] for my first grant entry, and so
forth. For this case I read on the list some time ago that entry 0 did
not work, so I work with entry 1, like this:
grant_entries[aval_grant].domid = ext_domid;
grant_entries[aval_grant].frame = _frame; where frame is: (u32)sring
>> PAGE_SHIFT //meaning mfn of my rings.
grant_entries[aval_grant].flags = GTF_permit_access;

These last two steps I described may be wrong... I know this because
the backend state is not XenbusStateConnected.
I think my mistake is on step 5, so can someone please shed some light
on this small issue.

And thank you very much for taking the time to read.

Daniel

-- 
+-=====---------------------------+
| +---------------------------------+ | This space intentionally blank
for notetaking.
| |   | Daniel Castro,                |
| |   | Consultant/Programmer.|
| |   | U Andes                         |
+-------------------------------------+

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