From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: qemu-devel@nongnu.org
Cc: anthony.perard@citrix.com, xen-devel@lists.xensource.com,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [Qemu-devel] [PATCH 1/2] xen_backend: introduce xenstore_read_uint64 and xenstore_read_fe_uint64
Date: Tue, 17 Dec 2013 17:30:59 +0000 [thread overview]
Message-ID: <1387301460-28164-1-git-send-email-stefano.stabellini@eu.citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1312171724460.8667@kaball.uk.xensource.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
hw/xen/xen_backend.c | 18 ++++++++++++++++++
include/hw/xen/xen_backend.h | 2 ++
2 files changed, 20 insertions(+)
diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
index 197795f..5f9be5a 100644
--- a/hw/xen/xen_backend.c
+++ b/hw/xen/xen_backend.c
@@ -112,6 +112,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, "%"PRIu64, 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);
@@ -147,6 +160,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)
diff --git a/include/hw/xen/xen_backend.h b/include/hw/xen/xen_backend.h
index 3b7d96d..3b4125e 100644
--- a/include/hw/xen/xen_backend.h
+++ b/include/hw/xen/xen_backend.h
@@ -74,6 +74,8 @@ char *xenstore_read_be_str(struct XenDevice *xendev, const char *node);
int xenstore_read_be_int(struct XenDevice *xendev, const char *node, int *ival);
char *xenstore_read_fe_str(struct XenDevice *xendev, const char *node);
int xenstore_read_fe_int(struct XenDevice *xendev, const char *node, int *ival);
+int xenstore_read_uint64(const char *base, const char *node, uint64_t *uval);
+int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node, uint64_t *uval);
const char *xenbus_strstate(enum xenbus_state state);
struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev);
--
1.7.10.4
next prev parent reply other threads:[~2013-12-17 17:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-17 17:30 [Qemu-devel] [PATCH 0/2] build QEMU with Xen support on ARM Stefano Stabellini
2013-12-17 17:30 ` Stefano Stabellini [this message]
2013-12-17 17:56 ` [Qemu-devel] [PATCH 1/2] xen_backend: introduce xenstore_read_uint64 and xenstore_read_fe_uint64 Peter Maydell
2013-12-17 18:28 ` Stefano Stabellini
2013-12-17 17:31 ` [Qemu-devel] [PATCH 2/2] xen: build on ARM Stefano Stabellini
2013-12-17 17:58 ` Peter Maydell
2013-12-17 18:20 ` Stefano Stabellini
2013-12-17 18:27 ` Peter Maydell
2013-12-18 11:25 ` [Qemu-devel] [Xen-devel] " Ian Campbell
2013-12-18 12:35 ` Stefano Stabellini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1387301460-28164-1-git-send-email-stefano.stabellini@eu.citrix.com \
--to=stefano.stabellini@eu.citrix.com \
--cc=anthony.perard@citrix.com \
--cc=qemu-devel@nongnu.org \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).