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] Question about using xenctl

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] Question about using xenctl
From: 吴佳民 <wujiamin_tyut@xxxxxxx>
Date: Fri, 11 Jul 2008 16:52:03 +0800 (CST)
Delivery-date: Fri, 11 Jul 2008 01:52:35 -0700
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
Hi:
  I wanna domU to map dom0's page, so that these two domain can receive/send data between them in the future. But when I run my code , it told me that "Could not open grant table interface(22=invalid argument)".
  Can anybody know what the problem is ?
  Thanks .
                        Danius Wu.
======
The Result of running my codes:
[root@vm1 program]# gcc -g -Wall -lxenctrl test.c -o test
[root@vm1 program]# ./test
ERROR Internal error: Could not open grant table interface (22 = Invalid argument)
Open xcg_handle Error!
[root@vm1 program]#

=======
Source code:
#include <stdio.h>
#include <stdint.h>
#include <time.h>
#include <sys/select.h>
#include <xenctrl.h>
#include <sys/mman.h>
 
int main(void)
{
        int xcg_handle;
        xcg_handle = xc_gnttab_open();
        if(xcg_handle == -1)
        {
            printf("Open xcg_handle Error!\n");
            return -1;
        }
        else
            printf("Open xcg_handle Success!\n");
       
        void* start_address;
        start_address = xc_gnttab_map_grant_ref(xcg_handle, 0, 3,PROT_WRITE);
        if(start_address != NULL)
        {
            printf("mapping success!\n");
        }
        else
        {
            printf("mapping errror!=n");
        }

        xc_gnttab_close(xcg_handle);         
      return 0;
}
==============================================
   
 



22元超值饭面,8.5折纯珍比萨,必胜宅急送网上点餐优惠多
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>