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

Re: [Xen-devel] [HYBRID]: status update...



On Thu, 5 Jul 2012, Mukesh Rathor wrote:
> > xenstored is going to try to open the grant table interface
> > (xc_gnttab_open, implemented via gntdev), if that fails it should fall
> > back to xc_map_foreign_range. That should work out of the box, or at
> > least it does for my "hybrid" ARM dom0.
> 
> For hybrid, I'd like it to just use map foreign range for now. I am
> looking for a way to enforce that. I can't pass flag to the API.

Maybe the best thing to do would be modifying xenstored map_interface to
fall back to the old method if gnttab doesn't work.
The basic idea is the following (untested):


diff --git a/tools/xenstore/xenstored_domain.c 
b/tools/xenstore/xenstored_domain.c
index bf83d58..14f5cdf 100644
--- a/tools/xenstore/xenstored_domain.c
+++ b/tools/xenstore/xenstored_domain.c
@@ -167,14 +167,16 @@ static int readchn(struct connection *conn, void *data, 
unsigned int len)
 
 static void *map_interface(domid_t domid, unsigned long mfn)
 {
+       void *addr;
        if (*xcg_handle != NULL) {
                /* this is the preferred method */
-               return xc_gnttab_map_grant_ref(*xcg_handle, domid,
+               addr = xc_gnttab_map_grant_ref(*xcg_handle, domid,
                        GNTTAB_RESERVED_XENSTORE, PROT_READ|PROT_WRITE);
-       } else {
-               return xc_map_foreign_range(*xc_handle, domid,
-                       getpagesize(), PROT_READ|PROT_WRITE, mfn);
+               if (addr)
+                       return addr;
        }
+       return xc_map_foreign_range(*xc_handle, domid,
+                       getpagesize(), PROT_READ|PROT_WRITE, mfn);
 }
 
 static void unmap_interface(void *interface)

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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