search for: xs_watch

Displaying 20 results from an estimated 62 matches for "xs_watch".

2013 May 15
6
xenfs: race condition on xenstore watch
...e watch fires before the driver sends "OK", which confuses the xenstore-watch client. It seems to me that the client is within its rights to expect the "OK" first. Here''s what is happening: The userspace process xenstore-watch writes to /proc/xen/xenbus with msg_type==XS_WATCH. This is handled by xenbus_write_watch which calls register_xenbus_watch with watch_fired as a callback *before* acquiring the reply_mutex and sending the synthesised "OK" reply. This gives a fast xenstore the opportunity to cause the watch_fired to run (and briefly grab the reply_mutex...
2006 Aug 02
2
[PATCH][RFC] permit domU userspace to watch xenstore
Hello, This patch allows userspace tools on a domU to setup a watch on the xenstore. It does this by intercepting XS_WATCH requests written to /proc/xen/xenbus and then re-submitting the request to the in-kernel xenstore interface, in linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c. When a callback occurs, an in-kernel function is invoked, which then reconstructs a response in the format expected by userspace, and...
2012 Jun 06
3
[PATCH 0 of 2 V3] xs: fixes to watch thread creation
A pair of patches to the xenstore library that: 1) blocks signal delivery before creating the watch wakeup thread 2) reduces the stack size of the watch wakeup thread.
2012 Sep 25
2
[PATCH V2] libxenstore: filter watch events in libxenstore when we unwatch
...; --- tools/xenstore/xs.c | 73 +++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 65 insertions(+), 8 deletions(-) diff --git a/tools/xenstore/xs.c b/tools/xenstore/xs.c index b951015..df89e37 100644 --- a/tools/xenstore/xs.c +++ b/tools/xenstore/xs.c @@ -753,6 +753,19 @@ bool xs_watch(struct xs_handle *h, const char *path, const char *token) ARRAY_SIZE(iov), NULL)); } + +/* Clear the pipe token if there are no more pending watchs. + * We suppose the watch_mutex is already taken. + */ +static void xs_clear_watch_pipe(struct xs_handle *h) +{ + char c; + + if (list_empty(&a...
2012 Dec 13
4
[PATCH V3] libxenstore: filter watch events in libxenstore when we unwatch
...ated message is read. The use case is non-threaded libevent, we have two event A and B: - Event A will destroy something and call xs_unwatch; - Event B is used to notify that a node has changed in XenStore. As the event is called one by one, event A can be handled before event B. So on next xs_watch_read the user could retrieve an unwatch token and a segfault occured if the token store the pointer of the structure (ie: "backend:0xcafe"). To avoid problem with previous application using libXenStore, this behaviour will only be enabled if XS_UNWATCH_SAFE is give to xs_open. Signed-of...
2013 Feb 14
5
using @releaseDomain to subscribe for domain destruction
Hello!. How can i use @releaseDomain from dom0 to subscribe for domain destruction? I''m try to add watch for @releaseDomain path with token equal of needed domain id. But when another domain dies, i get domain that i provide via token to xs_watch. Is that possible to get id of domain what released from xenstore? -- Vasiliy Tolstov, Clodo.ru e-mail: v.tolstov@selfip.ru jabber: vase@selfip.ru
2005 Aug 04
0
[PATCH 6/11] Xenstore watch rework
...se/drivers/xen/xenbus/xenbus_xs.c --- a/linux-2.6.11-xen-sparse/drivers/xen/xenbus/xenbus_xs.c Thu Aug 4 10:43:03 2005 +++ b/linux-2.6.11-xen-sparse/drivers/xen/xenbus/xenbus_xs.c Thu Aug 4 11:39:03 2005 @@ -321,18 +321,14 @@ return xs_single(XS_GETDOMAINPATH, domid_str, NULL); } -static int xs_watch(const char *path, const char *token, unsigned int priority) -{ - char prio[32]; - struct kvec iov[3]; - - sprintf(prio, "%u", priority); +static int xs_watch(const char *path, const char *token) +{ + struct kvec iov[2]; + iov[0].iov_base = (void *)path; iov[0].iov_len = strlen(path) +...
2010 Aug 25
7
A bug in Xenbus driver
...} This bug makes the read_buffer not be cleared most of the time. If the xenstore client uses PTHREAD to create a thread to receive reply message, the problem will incur. The new thread can not read what it wants to read, since the list is not empty. I found this problem from the xenstore client xs_watch function. xs_watch creates the new thread on demand. So I recommend that in the function of read_message(xen/tools/xenstore/xs.c), if using thread to receive message, in the case of read fault, it should signal to the listener and print out the error. Jun Zhu Citrix Systems UK ___________________...
2010 May 27
10
Is there something missing for my NIC passthough?
Hi experts I use xen-4.0.0 and dom0 is 2.6.33 and domU is 2.6.34 #lspci ............... 01:00.0 Ethernet controller: Intel Corporation Unknown device 10a7 (rev 02) 01:00.1 Ethernet controller: Intel Corporation Unknown device 10a7 (rev 02) 05:00.0 Ethernet controller: Intel Corporation 82571EB Gigabit Ethernet Controller (rev 06) 05:00.1 Ethernet controller: Intel Corporation 82571EB Gigabit
2010 Sep 02
7
[PATCH] libxl: make libxl communicate with xenstored by socket or xenbus driver
...3:49 2010 +0100 +++ b/tools/libxl/libxl_device.c Thu Sep 02 14:51:46 2010 +0100 @@ -406,6 +406,8 @@ char **l = NULL; xsh = xs_daemon_open(); + if (!xsh) + xsh = xs_domain_open(); path = libxl_sprintf(&gc, "/local/domain/0/device-model/%d/state", domid); xs_watch(xsh, path, path); tv.tv_sec = LIBXL_DEVICE_MODEL_START_TIMEOUT; diff -r eff592364826 tools/libxl/libxl_dom.c --- a/tools/libxl/libxl_dom.c Wed Sep 01 11:23:49 2010 +0100 +++ b/tools/libxl/libxl_dom.c Thu Sep 02 14:51:46 2010 +0100 @@ -284,6 +284,8 @@ snprintf(path, sizeof(path), "/lo...
2006 Sep 13
0
[PATCH] fix xenconsoled race
...a/tools/console/daemon/io.c Fri Sep 01 12:16:21 2006 +0100 +++ b/tools/console/daemon/io.c Fri Sep 01 08:14:07 2006 -0700 @@ -293,12 +293,14 @@ static bool watch_domain(struct domain * bool success; sprintf(domid_str, "dom%u", dom->domid); - if (watch) + if (watch) { success = xs_watch(xs, dom->conspath, domid_str); - else + if (success) + domain_create_ring(dom); + } else { success = xs_unwatch(xs, dom->conspath, domid_str); - if (success) - domain_create_ring(dom); + } + return success; } _______________________________________________ Xen-devel mailing list...
2011 Sep 23
1
Question on Xenstore watch
Hello All, I am trying to set up a watch on xentore. According to the documentation xenstore.txt a watch is simply done with the path to the node that the path is going to set, but according to the definitive guide to xen, it is done like a write, path to node and key to be watched. I have tried both and both fail. Probably I have something wrong but it helps to know the correct format. Which
2012 Jan 24
0
[PATCH] linux-2.6.18/xenbus_dev: add missing error checks to watch handling
...; --- a/drivers/xen/xenbus/xenbus_dev.c +++ b/drivers/xen/xenbus/xenbus_dev.c @@ -269,18 +269,24 @@ static ssize_t xenbus_dev_write(struct f goto out; } token++; + if (memchr(token, 0, u->u.msg.len - (token - path)) == NULL) { + rc = -EILSEQ; + goto out; + } if (msg_type == XS_WATCH) { watch = kzalloc(sizeof(*watch), GFP_KERNEL); - watch->watch.node = kmalloc(strlen(path)+1, - GFP_KERNEL); - strcpy((char *)watch->watch.node, path); + if (watch == NULL) { + rc = -ENOMEM; + goto out; + } + watch->wat...
2012 Jan 24
0
[PATCH] xenbus_dev: add missing error check to watch handling
..._frontend.c +++ 3.3-rc1-xenbus-dev-write-watch/drivers/xen/xenbus/xenbus_dev_frontend.c @@ -369,6 +369,10 @@ static int xenbus_write_watch(unsigned m goto out; } token++; + if (memchr(token, 0, u->u.msg.len - (token - path)) == NULL) { + rc = -EILSEQ; + goto out; + } if (msg_type == XS_WATCH) { watch = alloc_watch_adapter(path, token);
2005 Dec 15
10
watches not working from domU userspace
...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. Joseph Cihula (Linux) Software Security Architect Open Source T...
2015 Nov 25
3
Bug#806226: xen-hypervisor-4.6-amd64: Can't start a VM
...__mutex_lock_slowpath+0x90/0x110 Nov 25 15:49:53 k2000 kernel: [ 2408.822722] [<ffffffff8153a536>] ? mutex_lock+0x16/0x30 Nov 25 15:49:53 k2000 kernel: [ 2408.822724] [<ffffffff81397347>] ? xs_talkv+0x67/0x1d0 Nov 25 15:49:53 k2000 kernel: [ 2408.822725] [<ffffffff8139770f>] ? xs_watch+0x4f/0x70 Nov 25 15:49:53 k2000 kernel: [ 2408.822727] [<ffffffff81397bd6>] ? register_xenbus_watch+0x96/0x110 Nov 25 15:49:53 k2000 kernel: [ 2408.822728] [<ffffffff8139a57f>] ? xenbus_file_write+0x48f/0x520 Nov 25 15:49:53 k2000 kernel: [ 2408.822731] [<ffffffff810bab75>] ? c...
2007 Oct 24
16
PATCH 0/10: Merge PV framebuffer & console into QEMU
The following series of 10 patches is a merge of the xenfb and xenconsoled functionality into the qemu-dm code. The general approach taken is to have qemu-dm provide two machine types - one for xen paravirt, the other for fullyvirt. For compatability the later is the default. The goals overall are to kill LibVNCServer, remove alot of code duplication and/or parallel impls of the same concepts, and
2008 Aug 29
12
stubdom problem
Hello all Xen devels, I''m writing howto''s in brazilian portuguese language about Xen-3.3.0 stubdom, pv-grub and others configurations. Following what is written in xen-3.3.0/stubdom/README, I tried start a HVM but without success. When I start the virtual machine calling ''xm create hvmtest'' command, in a few seconds the virtual machine is dead (see
2012 Dec 14
1
[PATCH V5] libxenstore: filter watch events in libxenstore when we unwatch
...ated message is read. The use case is non-threaded libevent, we have two event A and B: - Event A will destroy something and call xs_unwatch; - Event B is used to notify that a node has changed in XenStore. As the event is called one by one, event A can be handled before event B. So on next xs_watch_read the user could retrieve an unwatch token and a segfault occured if the token store the pointer of the structure (ie: "backend:0xcafe"). To avoid problem with previous application using libXenStore, this behaviour will only be enabled if XS_UNWATCH_FILTER is given to xs_open. Signed...
2012 Dec 14
1
[PATCH V4] libxenstore: filter watch events in libxenstore when we unwatch
...ated message is read. The use case is non-threaded libevent, we have two event A and B: - Event A will destroy something and call xs_unwatch; - Event B is used to notify that a node has changed in XenStore. As the event is called one by one, event A can be handled before event B. So on next xs_watch_read the user could retrieve an unwatch token and a segfault occured if the token store the pointer of the structure (ie: "backend:0xcafe"). To avoid problem with previous application using libXenStore, this behaviour will only be enabled if XS_UNWATCH_FILTER is given to xs_open. Signed...