From: =?GBK?B?zuK80cPx?= Subject: Question about using xenctl Date: Fri, 11 Jul 2008 16:52:03 +0800 (CST) Message-ID: <26823723.379491215766323723.JavaMail.coremail@bj163app115.163.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0165907174==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org --===============0165907174== Content-Type: multipart/alternative; boundary="----=_Part_101231_9099444.1215766323722" ------=_Part_101231_9099444.1215766323722 Content-Type: text/plain; charset=gbk Content-Transfer-Encoding: 7bit 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 #include #include #include #include #include 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; } ============================================== ------=_Part_101231_9099444.1215766323722 Content-Type: text/html; charset=gbk Content-Transfer-Encoding: quoted-printable
Hi:
  I wanna domU to map dom0's page, so that these two domai= n 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=3Dinvalid argume= nt)".
  Can anybody know what the problem is ?
  Thanks .<= br>            =             Danius W= u.
=3D=3D=3D=3D=3D=3D
The Result of running my codes:
[root@vm1 pr= ogram]# gcc -g -Wall -lxenctrl test.c -o test
[root@vm1 program]# ./test=
ERROR Internal error: Could not open grant table interface (22 =3D Inv= alid argument)
Open xcg_handle Error!
[root@vm1 program]#

=3D= =3D=3D=3D=3D=3D=3D
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;
 &nb= sp;      xcg_handle =3D xc_gnttab_open();
 &nbs= p;      if(xcg_handle =3D=3D -1)
    =     {
          &= nbsp; printf("Open xcg_handle Error!\n");
      = ;      return -1;
      &nb= sp; }
        else
    &= nbsp;       printf("Open xcg_handle Success!\n");<= br>       
      = ;  void* start_address;
        start= _address =3D xc_gnttab_map_grant_ref(xcg_handle, 0, 3,PROT_WRITE);
 = ;       if(start_address !=3D NULL)
  = ;      {
         = ;   printf("mapping success!\n");
     &nb= sp;  }
        else
  &n= bsp;     {
         &n= bsp;  printf("mapping errror!=3Dn");
      = ;  }

        xc_gnttab_close(xcg_= handle);         
   &= nbsp;  return 0;
}
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D   
 


=20
22=D4=AA=B3=AC=D6=B5=B7=B9= =C3=E6,8.5=D5=DB=B4=BF=D5=E4=B1=C8=C8=F8,=B1=D8=CA=A4=D5=AC=BC=B1=CB=CD=CD= =F8=C9=CF=B5=E3=B2=CD=D3=C5=BB=DD=B6=E0 ------=_Part_101231_9099444.1215766323722-- --===============0165907174== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============0165907174==--