summaryrefslogtreecommitdiff
path: root/hw/xen
diff options
context:
space:
mode:
authorEmil Condrea <emilcondrea@gmail.com>2016-10-25 08:50:10 +0300
committerStefano Stabellini <sstabellini@kernel.org>2016-10-28 17:53:08 -0700
commit046db9bec5e94787e12ec11bb27bcd5dab669249 (patch)
treecb83a5c3758ee3c4e8c594b5367c60ea296a3b61 /hw/xen
parentf0021dba622f562d42982f4f4105a7e14ef7535c (diff)
downloadqemu-046db9bec5e94787e12ec11bb27bcd5dab669249.tar.gz
qemu-046db9bec5e94787e12ec11bb27bcd5dab669249.tar.bz2
qemu-046db9bec5e94787e12ec11bb27bcd5dab669249.zip
xen: Move xenstore_update to xen_pvdev.c
* xenstore_update -> xen_pvdev.c Signed-off-by: Emil Condrea <emilcondrea@gmail.com> Signed-off-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Quan Xu <xuquan8@huawei.com> Acked-by: Anthony PERARD <anthony.perard@citrix.com>
Diffstat (limited to 'hw/xen')
-rw-r--r--hw/xen/xen_backend.c30
-rw-r--r--hw/xen/xen_pvdev.c23
2 files changed, 26 insertions, 27 deletions
diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
index b32b0dd6f8..e3a7d95aca 100644
--- a/hw/xen/xen_backend.c
+++ b/hw/xen/xen_backend.c
@@ -556,8 +556,8 @@ static int xenstore_scan(const char *type, int dom, struct XenDevOps *ops)
return 0;
}
-static void xenstore_update_be(char *watch, char *type, int dom,
- struct XenDevOps *ops)
+void xenstore_update_be(char *watch, char *type, int dom,
+ struct XenDevOps *ops)
{
struct XenDevice *xendev;
char path[XEN_BUFSIZE], *bepath;
@@ -590,7 +590,7 @@ static void xenstore_update_be(char *watch, char *type, int dom,
}
}
-static void xenstore_update_fe(char *watch, struct XenDevice *xendev)
+void xenstore_update_fe(char *watch, struct XenDevice *xendev)
{
char *node;
unsigned int len;
@@ -607,30 +607,6 @@ static void xenstore_update_fe(char *watch, struct XenDevice *xendev)
xen_be_frontend_changed(xendev, node);
xen_be_check_state(xendev);
}
-
-static 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);
-}
-
static void xen_be_evtchn_event(void *opaque)
{
struct XenDevice *xendev = opaque;
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[] = {