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

Re: [Xen-devel] problem using xenbus interface


  • To: Rusty Russell <rusty@xxxxxxxxxxxxxxx>, Dan Smith <danms@xxxxxxxxxx>
  • From: NAHieu <nahieu@xxxxxxxxx>
  • Date: Tue, 9 Aug 2005 11:53:07 +0900
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 09 Aug 2005 02:51:27 +0000
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=SkAhGZ6wUi0GvyPDx4Aj70v4m+BE9kpu8APaDBWUybK1N/d47pyyl4vJFRzFynaVkdXprPZdvOpviXcnyq3tNaNsOshbL3TAP/GFlTeOezPT2QvoRlt47cOhH0ZsYk6yMuAi9917bxSNZSjoseAwHsoEGpVdZI9IWi9P84s7WV8=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

Hi Rusty and Dan,

Those are the best answers I can get. Thank you a lot.

Too bad that XenBus has very little documentation, so there are so
much confuses. Hopefully somebody knows it well enough will put out
more docs.

Best regards,
NAH

On 8/9/05, Rusty Russell <rusty@xxxxxxxxxxxxxxx> wrote:
> On Mon, 2005-08-08 at 21:26 +0900, NAHieu wrote:
> > Hello,
> >
> > I a writing a small kernel module for domU, in which I use xenbus and
> > have some problems:
> >
> > I use xenbus_scanf to read value of "/restart_mode", but the below
> > code always failed (got non-zero err)
> >
> > err = xenbus_scanf("/", "restart_mode", "%s", mode);
> 
> OK, if you start the xenstored with "--trace-file=/tmp/trace" you can
> see what's happening in that file.
> 
> In this case, it's actually a bug in xenbus_scanf: it will ask to read
> "//restart_mode" which is an invalid path since it has two "/" in a row.
> But it's not a big problem because you shouldn't be writing in the top
> level directory anyway...
> 
> I would recommend the following:
> 
> 1) Use xenbus_read here, not xenbus_scanf, since you are just reading a
> single string and xenbus_read won't overflow on long strings.
> 
> 2) Use "restart-mode" not "restart_mode": we've chosen - over _ so far.
> 
> 3) Use the two args "restart-mode", "": that will be restart-mode inside
> your domain's home directory, rather than at the top level.
> 
> > Another code like below also failed (I try to make a new node
> > "/domain/<DOM>/test" with xenbus_mkdir):
> >
> > err = xenbus_mkdir("/", "test");
> 
> Same problem: it would be "xenbus_mkdir("/test", "")" and you probably
> don't want to do that at the top level anyway (when we turn permission
> checking back on, that will not work).
> 
> Hope that helps!
> Rusty.
> (PS.  Heading to the wiki now to do some remedial documentation).
> --
> A bad analogy is like a leaky screwdriver -- Richard Braakman
> 
>

_______________________________________________
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®.