aboutsummaryrefslogtreecommitdiffstats
path: root/extras/mini-os/xenbus
diff options
context:
space:
mode:
Diffstat (limited to 'extras/mini-os/xenbus')
-rw-r--r--extras/mini-os/xenbus/xenbus.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/extras/mini-os/xenbus/xenbus.c b/extras/mini-os/xenbus/xenbus.c
index 9065510e70..8e721caec0 100644
--- a/extras/mini-os/xenbus/xenbus.c
+++ b/extras/mini-os/xenbus/xenbus.c
@@ -124,7 +124,7 @@ char* xenbus_wait_for_value(const char* path, const char* value, xenbus_event_qu
static void xenbus_thread_func(void *ign)
{
struct xsd_sockmsg msg;
- unsigned prod = 0;
+ unsigned prod = xenstore_buf->rsp_prod;
for (;;)
{
@@ -174,9 +174,14 @@ static void xenbus_thread_func(void *ign)
break;
}
- event->next = *events;
- *events = event;
- wake_up(&xenbus_watch_queue);
+ if (events) {
+ event->next = *events;
+ *events = event;
+ wake_up(&xenbus_watch_queue);
+ } else {
+ printk("unexpected watch token %s\n", event->token);
+ free(event);
+ }
}
else
@@ -265,6 +270,10 @@ void init_xenbus(void)
DEBUG("xenbus on irq %d\n", err);
}
+void fini_xenbus(void)
+{
+}
+
/* Send data to xenbus. This can block. All of the requests are seen
by xenbus as if sent atomically. The header is added
automatically, using type %type, req_id %req_id, and trans_id