|
|
|
|
|
|
|
|
|
|
xen-devel
Re: [Xen-devel] Question about using xenctl
Is this running in a DomU? The xc_gnttab functions rely on the gntdev
device, which hasn't (to the best of my knowledge) yet been used in a
DomU, and might not be loaded on your setup. Check to see if gntdev is
installed on your system, as that would explain the error.
Secondly, have you considered sharing the page from DomU and mapping
it in Dom0? This is the more common pattern, as it uses DomU's
resources (rather than Dom0's), and it avoids having Dom0 trust DomU
to unmap the page when Dom0 wants to revoke the grant.
Regards,
Derek Murray.
2008/7/11 吴佳民 <wujiamin_tyut@xxxxxxx>:
> 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
>
>
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|
|
|