From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gerd Hoffmann Subject: Re: [PATCH] Add an ioctl interface for simple xenstore access Date: Mon, 20 Mar 2006 11:10:01 +0100 Message-ID: <441E7F79.8080902@suse.de> References: <87r750pupr.fsf@caffeine.beaverton.ibm.com> <20060318071405.GD23816@granada.merseine.nu> <01789afa761fc8e2b1f398148de7370c@cl.cam.ac.uk> <441C4B20.4000202@us.ibm.com> <441E69FE.7070307@suse.de> <20060320085205.GA30703@leeni.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------030704000807070203090604" Return-path: In-Reply-To: <20060320085205.GA30703@leeni.uk.xensource.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: Ewan Mellor Cc: Xen Developers , Dan Smith List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------030704000807070203090604 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit > Watches work in kernel space in domU (the frontends to the split device > drivers use them), but they don't work in userspace there. The problem is > that there is no support in xenbus for blocking a userspace process waiting > for a watch to fire. > > In domain 0, Xend uses a unix domain socket straight to Xenstored: it can > block on that, as it's not going through the Xenbus kernel-level driver. Huh? Sleeping on the unix socket and sleeping on the /proc/xen/xenbus filehandle should work equally well, shouldn't it? Well, right now there is no poll support, so you can't stuff the filehandle into select()-loop. But that is trivially fixable, patch below (compile-tested only though). Or did I miss the real problem? cheers, Gerd -- Gerd 'just married' Hoffmann I'm the hacker formerly known as Gerd Knorr. http://www.suse.de/~kraxel/just-married.jpeg --------------030704000807070203090604 Content-Type: text/plain; name="xenbus-poll" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="xenbus-poll" diff -r f6bd46559b93 drivers/xen/xenbus/xenbus_dev.c --- a/drivers/xen/xenbus/xenbus_dev.c Mon Mar 6 17:57:34 2006 +++ b/drivers/xen/xenbus/xenbus_dev.c Mon Mar 20 11:04:49 2006 @@ -36,6 +36,7 @@ #include #include #include +#include #include "xenbus_comms.h" @@ -208,11 +209,22 @@ return 0; } +static unsigned int xenbus_dev_poll(struct file *file, poll_table *wait) +{ + struct xenbus_dev_data *u = file->private_data; + + poll_wait(file, &u->read_waitq, wait); + if (u->read_cons != u->read_prod) + return POLLIN | POLLRDNORM; + return 0; +} + static struct file_operations xenbus_dev_file_ops = { .read = xenbus_dev_read, .write = xenbus_dev_write, .open = xenbus_dev_open, .release = xenbus_dev_release, + .poll = xenbus_dev_poll, }; static int __init --------------030704000807070203090604 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 --------------030704000807070203090604--