From: Kuriakose Mathew Subject: Re: how to read value from xenstore inside kernel Date: Tue, 25 Aug 2009 18:14:46 +0530 Message-ID: <9e81bde0908250544x48d42cb0kebea735e7f3ef258@mail.gmail.com> References: <9e81bde0908162340h42011f5cn7606c962fda89da4@mail.gmail.com> <20090817143826.GA4551@phenom.dumpdata.com> <9e81bde0908171055q5504683cm19cb2c70e24dfb88@mail.gmail.com> <20090817182023.GA6144@phenom.dumpdata.com> <9e81bde0908250357j5678af58ob56633561bf5a2bb@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0143903353==" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: James Harper Cc: xen-devel@lists.xensource.com, Konrad Rzeszutek Wilk List-Id: xen-devel@lists.xenproject.org --===============0143903353== Content-Type: multipart/alternative; boundary=001636eee4ea0834af0471f6b316 --001636eee4ea0834af0471f6b316 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Thanks James. I will try to get the crash message but not how to get it in a file. When I restart the system after making the change, it gets rebooted at this point. So I have to find a way to get those message displayed while a system is booting. I ll try to get it. Also regarding 'watch' , it is called when the value of key changes but if I want to read some value which is static then will this help? Not sure if I am right. -Mathew On Tue, Aug 25, 2009 at 4:37 PM, James Harper wrote: > > 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 ? > > Not sure how much this helps, but you should not be re-reading from > xenbus every time a packet is sent. That would involve huge per-packet > overheads. You can read it initially and then set a 'watch' on the value > to get notified every time it changes. > > Have you got a copy of the crash message? > > James > > --001636eee4ea0834af0471f6b316 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thanks James.
I will try to get the crash message but not how to get it = in a file. When I restart the system after making the change, it gets reboo= ted at this point. So I have to find a way to get those message displayed w= hile a system is booting. I ll try to get it.

Also regarding 'watch' , it is called when the value of key cha= nges but if I want to read some value which is static then will this help?<= br>Not sure if I am right.

-Mathew


On Tue, Aug 25, 2009 at 4:37 PM, James Harper <james.harper@bendigoit.com.au= > wrote:
> 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 =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
> 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 ?

Not sure how much this helps, but you should not be re-reading from xenbus every time a packet is sent. That would involve huge per-packet
overheads. You can read it initially and then set a 'watch' on the = value
to get notified every time it changes.

Have you got a copy of the crash message?

James


--001636eee4ea0834af0471f6b316-- --===============0143903353== 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 --===============0143903353==--