aboutsummaryrefslogtreecommitdiff
path: root/hw/xen/xen_backend.c
diff options
context:
space:
mode:
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>2013-12-18 19:17:31 +0000
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>2014-07-07 10:37:40 +0000
commit4aba9eb138e5d68c400de0b116f15217d7a92d3a (patch)
tree260720164d2f8e4aa3d8fe52a7bba8800edab23f /hw/xen/xen_backend.c
parent9d9de254c2b81b68cd48f2324cc753a570a4cdd8 (diff)
xen_backend: introduce xenstore_read_uint64 and xenstore_read_fe_uint64
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/xen/xen_backend.c')
-rw-r--r--hw/xen/xen_backend.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
index 3cd45b407c..b2cb22b99d 100644
--- a/hw/xen/xen_backend.c
+++ b/hw/xen/xen_backend.c
@@ -111,6 +111,19 @@ int xenstore_read_int(const char *base, const char *node, int *ival)
return rc;
}
+int xenstore_read_uint64(const char *base, const char *node, uint64_t *uval)
+{
+ char *val;
+ int rc = -1;
+
+ val = xenstore_read_str(base, node);
+ if (val && 1 == sscanf(val, "%"SCNu64, uval)) {
+ rc = 0;
+ }
+ g_free(val);
+ return rc;
+}
+
int xenstore_write_be_str(struct XenDevice *xendev, const char *node, const char *val)
{
return xenstore_write_str(xendev->be, node, val);
@@ -146,6 +159,11 @@ int xenstore_read_fe_int(struct XenDevice *xendev, const char *node, int *ival)
return xenstore_read_int(xendev->fe, node, ival);
}
+int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node, uint64_t *uval)
+{
+ return xenstore_read_uint64(xendev->fe, node, uval);
+}
+
/* ------------------------------------------------------------- */
const char *xenbus_strstate(enum xenbus_state state)