From: Gerd Hoffmann <kraxel@suse.de>
To: Ewan Mellor <ewan@xensource.com>
Cc: Xen Developers <xen-devel@lists.xensource.com>,
Dan Smith <danms@us.ibm.com>
Subject: Re: [PATCH] Add an ioctl interface for simple xenstore access
Date: Mon, 20 Mar 2006 11:10:01 +0100 [thread overview]
Message-ID: <441E7F79.8080902@suse.de> (raw)
In-Reply-To: <20060320085205.GA30703@leeni.uk.xensource.com>
[-- Attachment #1: Type: text/plain, Size: 891 bytes --]
> 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 <kraxel@suse.de>
I'm the hacker formerly known as Gerd Knorr.
http://www.suse.de/~kraxel/just-married.jpeg
[-- Attachment #2: xenbus-poll --]
[-- Type: text/plain, Size: 846 bytes --]
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 <linux/notifier.h>
#include <linux/wait.h>
#include <linux/fs.h>
+#include <linux/poll.h>
#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
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next prev parent reply other threads:[~2006-03-20 10:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-17 22:33 [PATCH] Add an ioctl interface for simple xenstore access Dan Smith
2006-03-18 7:14 ` Muli Ben-Yehuda
2006-03-18 9:50 ` Keir Fraser
2006-03-18 18:02 ` Anthony Liguori
2006-03-18 19:32 ` Keir Fraser
2006-03-20 8:38 ` Gerd Hoffmann
2006-03-20 8:52 ` Ewan Mellor
2006-03-20 10:08 ` Keir Fraser
2006-03-20 10:10 ` Gerd Hoffmann [this message]
2006-03-18 17:56 ` Anthony Liguori
2006-03-19 0:10 ` Muli Ben-Yehuda
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=441E7F79.8080902@suse.de \
--to=kraxel@suse.de \
--cc=danms@us.ibm.com \
--cc=ewan@xensource.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.