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

Re: [Xen-devel] Question about using xenctl


  • To: "吴佳民" <wujiamin_tyut@xxxxxxx>
  • From: "Derek Murray" <Derek.Murray@xxxxxxxxxxxx>
  • Date: Sat, 12 Jul 2008 18:49:46 +0100
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Sat, 12 Jul 2008 10:50:09 -0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:sender:to:subject:cc:in-reply-to :mime-version:content-type:content-transfer-encoding :content-disposition:references:x-google-sender-auth; b=YfzRI14Nt6smTev1Tjlm3m56uLqLT1CUJGvEio1FiMsDQzq2cbBW6Y2gGfBvnGRGIQ 0F26T8aOSNWB3HgbgWzt3wdpTrhBh/IDSNpIoNdOfbuJTERDe1oMNFC2pgStj8aNcb1+ 2XKpl90PYf+tbk/C7Bq/+pKIo+VDd3Zx9UCyc=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

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

 


Rackspace

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