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

Re: [Xen-devel] Question about using xenctl

To: "吴佳民" <wujiamin_tyut@xxxxxxx>
Subject: Re: [Xen-devel] Question about using xenctl
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
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received: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; bh=zYWdvuavsCyR4hmbPWw19f289KlOiM50uQcEquJgwlk=; b=xOq1Yw57TqsI01Qp5eUxTRvmieUxsHRG+5yTVaiwUVRB5qfG1JC2i4vo4INtG/tBab 1DYC9Fi0RZZGpu1mkpN55dICVgx+n2YLDghCnTMrkVPFEs8NM8YdaM+Rhi5iPhbQDs1o Dng81DEObH22pqIyEXiVqfn/Qvwl5aU1p/KH8=
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=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <26823723.379491215766323723.JavaMail.coremail@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>
References: <26823723.379491215766323723.JavaMail.coremail@xxxxxxxxxxxxxxxxxxx>
Reply-to: Derek.Murray@xxxxxxxxxxxx
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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
<Prev in Thread] Current Thread [Next in Thread>