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] watches not working from domU userspace

To: "Cihula, Joseph" <joseph.cihula@xxxxxxxxx>
Subject: Re: [Xen-devel] watches not working from domU userspace
From: Ewan Mellor <ewan@xxxxxxxxxxxxx>
Date: Thu, 22 Dec 2005 15:33:30 +0000
Cc: Xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 22 Dec 2005 15:36:39 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <CA95C29D57188841ABB072EA7357C00D0A6AEC02@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <CA95C29D57188841ABB072EA7357C00D0A6AEC02@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.9i
On Thu, Dec 15, 2005 at 03:33:08AM -0800, Cihula, Joseph wrote:

> It seems that xenstore watches do not work from domU userspace (they
> obviously do for drivers).
> 
> In some preliminary debugging of this, there are two aspects of the
> failure:  not sending the watch to xenstore and not handling watch
> events for userspace watches.  The former can be easily fixed by adding
> the missing 'case XS_WATCH:'  to xenbus_dev_write() in xenbus_dev.c.
> The latter is more difficult to fix.  So before I tackle it, I wanted to
> see if anyone else was already working on a solution or just had some
> thoughts to share on possible solutions.

No-one's working on this at the moment, as far as I am aware, and you are more
than welcome to attack the problem.  The problem is that the interface exposed
through /proc/xen/xenbus does not handle the demultiplexing of watch events
when they fire.  It's only simple bookkeeping that is missing: userspace
processes will need to block on reading /proc/xen/xenbus, and then you need to

  o keep track of every register event so that you can demux the correct
watches firing and unblock the correct reader;
  o tear down the state that you hold internally whenever someone sends an
unregister message;
  o if the connection to userspace is closed before the watch is unregistered,
unregister it on their behalf;
  o deliver watches to the kernel correctly too.

The interface presented through /proc/xen/xenbus should be the same as that
presented through the unix domain socket used by dom0, so you should be able
to borrow lots of code from the existing xenstore library and move that into
kernel space.

Cheers,

Ewan.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>