aboutsummaryrefslogtreecommitdiff
path: root/hw/xen/xen_pvdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/xen/xen_pvdev.c')
-rw-r--r--hw/xen/xen_pvdev.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c
index a1dc2bed4c..22a1abe213 100644
--- a/hw/xen/xen_pvdev.c
+++ b/hw/xen/xen_pvdev.c
@@ -95,6 +95,29 @@ int xenstore_read_uint64(const char *base, const char *node, uint64_t *uval)
return rc;
}
+void xenstore_update(void *unused)
+{
+ char **vec = NULL;
+ intptr_t type, ops, ptr;
+ unsigned int dom, count;
+
+ vec = xs_read_watch(xenstore, &count);
+ if (vec == NULL) {
+ goto cleanup;
+ }
+
+ if (sscanf(vec[XS_WATCH_TOKEN], "be:%" PRIxPTR ":%d:%" PRIxPTR,
+ &type, &dom, &ops) == 3) {
+ xenstore_update_be(vec[XS_WATCH_PATH], (void *)type, dom, (void*)ops);
+ }
+ if (sscanf(vec[XS_WATCH_TOKEN], "fe:%" PRIxPTR, &ptr) == 1) {
+ xenstore_update_fe(vec[XS_WATCH_PATH], (void *)ptr);
+ }
+
+cleanup:
+ free(vec);
+}
+
const char *xenbus_strstate(enum xenbus_state state)
{
static const char *const name[] = {