From: Kuriakose Mathew Subject: Re: how to read value from xenstore inside kernel Date: Tue, 25 Aug 2009 16:27:22 +0530 Message-ID: <9e81bde0908250357j5678af58ob56633561bf5a2bb@mail.gmail.com> References: <9e81bde0908162340h42011f5cn7606c962fda89da4@mail.gmail.com> <20090817143826.GA4551@phenom.dumpdata.com> <9e81bde0908171055q5504683cm19cb2c70e24dfb88@mail.gmail.com> <20090817182023.GA6144@phenom.dumpdata.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1011861131==" Return-path: In-Reply-To: <20090817182023.GA6144@phenom.dumpdata.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Konrad Rzeszutek Wilk Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --===============1011861131== Content-Type: multipart/alternative; boundary=001636ed6637ef84250471f5320e --001636ed6637ef84250471f5320e Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi , I have been trying to use to xenbus_read. I added the below code in netback.c , static void net_tx_action(unsigned long unused) function. char * test; const char *nodename = "console"; test = xenbus_read(XBT_NIL, nodename, "limit", NULL); It is compiling fine. But when the kernel is crashing at this point during runtime. I expect to read the /local/domain/0/console/limit , which I am able to read from shell using xenstore-read . Am I missing something ? Thanks Mathew On Mon, Aug 17, 2009 at 11:50 PM, Konrad Rzeszutek Wilk < konrad.wilk@oracle.com> wrote: > On Mon, Aug 17, 2009 at 11:25:36PM +0530, Kuriakose Mathew wrote: > > Thanks for the response. > > But I want the value to be read in netback.c . I checked the > > drivers/xen/netback/xenbus.c > > and found some functions using xenbus_scanf . But couldn't find where > these > > functions are getting called. > > I recommend you get acquinted with 'cscope' and run under your linux > directory this > command: 'make cscope' to create the cscope files. Then look for > xenbus_scanf. > > > Whether it will be possible to directly call xenbus_scanf directly in > > netback.c ? I want a value in xenstore to be read in some function in > > Yes, if you have all of the #include files set right. > > > netback.c. > --001636ed6637ef84250471f5320e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi ,

I have been trying to use to xenbus_read.

I added the be= low code in netback.c , static void net_tx_action(unsigned long unused) fun= ction.

char * test;
const char *nodename =3D "console";=
test =3D xenbus_read(XBT_NIL, nodename, "limit", NULL);

It= is compiling fine. But when the kernel is crashing at this point during ru= ntime.
I expect to read the /local/domain/0/console/limit , which I am a= ble to read from shell using
xenstore-read . Am I missing something ?

Thanks
Mathew



On Mon, Aug 17, 2009 at 11:50 PM, Konrad= Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
On Mon, Aug 17, 2009 at 11:25:36PM +0530, Kuriakose Mathe= w wrote:
> Thanks for the response.
> But I want the value to be read in netback.c . I checked the
> drivers/xen/netback/xenbus.c
> and found some functions using xenbus_scanf . But couldn't find wh= ere these
> functions are getting called.

I recommend you get acquinted with 'cscope' and run under you= r linux directory this
command: 'make cscope' to create the cscope files. Then look for xe= nbus_scanf.

> Whether it will be possible to directly call xenbus_scanf directly in<= br> > netback.c ? I want a value in xenstore to be read in some function in<= br>
Yes, if you have all of the #include files set right.

> netback.c.

--001636ed6637ef84250471f5320e-- --===============1011861131== 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 --===============1011861131==--