aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xenstore/xs.c
diff options
context:
space:
mode:
authorvhanquez@kneesa.uk.xensource.com <vhanquez@kneesa.uk.xensource.com>2006-01-11 11:46:32 +0000
committervhanquez@kneesa.uk.xensource.com <vhanquez@kneesa.uk.xensource.com>2006-01-11 11:46:32 +0000
commit53ed6896f34e46734d1e2d681cb234440b41a94a (patch)
tree69fe273bbe1a7416a2efe020d05d9d7b4c2a78bf /tools/xenstore/xs.c
parentf2a491843da3d9918eabf0efa5377782c1a0aa68 (diff)
downloadxen-53ed6896f34e46734d1e2d681cb234440b41a94a.tar.gz
xen-53ed6896f34e46734d1e2d681cb234440b41a94a.tar.bz2
xen-53ed6896f34e46734d1e2d681cb234440b41a94a.zip
Share the same name for xenbus transaction type between user and kernel
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
Diffstat (limited to 'tools/xenstore/xs.c')
-rw-r--r--tools/xenstore/xs.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/tools/xenstore/xs.c b/tools/xenstore/xs.c
index 3ecb462ea3..8332e1aad5 100644
--- a/tools/xenstore/xs.c
+++ b/tools/xenstore/xs.c
@@ -292,7 +292,7 @@ static void *read_reply(
}
/* Send message to xs, get malloc'ed reply. NULL and set errno on error. */
-static void *xs_talkv(struct xs_handle *h, xs_transaction_handle t,
+static void *xs_talkv(struct xs_handle *h, xs_transaction_t t,
enum xsd_sockmsg_type type,
const struct iovec *iovec,
unsigned int num_vecs,
@@ -368,7 +368,7 @@ static void free_no_errno(void *p)
}
/* Simplified version of xs_talkv: single message. */
-static void *xs_single(struct xs_handle *h, xs_transaction_handle t,
+static void *xs_single(struct xs_handle *h, xs_transaction_t t,
enum xsd_sockmsg_type type,
const char *string,
unsigned int *len)
@@ -388,7 +388,7 @@ static bool xs_bool(char *reply)
return true;
}
-char **xs_directory(struct xs_handle *h, xs_transaction_handle t,
+char **xs_directory(struct xs_handle *h, xs_transaction_t t,
const char *path, unsigned int *num)
{
char *strings, *p, **ret;
@@ -420,7 +420,7 @@ char **xs_directory(struct xs_handle *h, xs_transaction_handle t,
* Returns a malloced value: call free() on it after use.
* len indicates length in bytes, not including the nul.
*/
-void *xs_read(struct xs_handle *h, xs_transaction_handle t,
+void *xs_read(struct xs_handle *h, xs_transaction_t t,
const char *path, unsigned int *len)
{
return xs_single(h, t, XS_READ, path, len);
@@ -429,7 +429,7 @@ void *xs_read(struct xs_handle *h, xs_transaction_handle t,
/* Write the value of a single file.
* Returns false on failure.
*/
-bool xs_write(struct xs_handle *h, xs_transaction_handle t,
+bool xs_write(struct xs_handle *h, xs_transaction_t t,
const char *path, const void *data, unsigned int len)
{
struct iovec iovec[2];
@@ -446,7 +446,7 @@ bool xs_write(struct xs_handle *h, xs_transaction_handle t,
/* Create a new directory.
* Returns false on failure, or success if it already exists.
*/
-bool xs_mkdir(struct xs_handle *h, xs_transaction_handle t,
+bool xs_mkdir(struct xs_handle *h, xs_transaction_t t,
const char *path)
{
return xs_bool(xs_single(h, t, XS_MKDIR, path, NULL));
@@ -455,7 +455,7 @@ bool xs_mkdir(struct xs_handle *h, xs_transaction_handle t,
/* Destroy a file or directory (directories must be empty).
* Returns false on failure, or success if it doesn't exist.
*/
-bool xs_rm(struct xs_handle *h, xs_transaction_handle t,
+bool xs_rm(struct xs_handle *h, xs_transaction_t t,
const char *path)
{
return xs_bool(xs_single(h, t, XS_RM, path, NULL));
@@ -465,7 +465,7 @@ bool xs_rm(struct xs_handle *h, xs_transaction_handle t,
* Returns malloced array, or NULL: call free() after use.
*/
struct xs_permissions *xs_get_permissions(struct xs_handle *h,
- xs_transaction_handle t,
+ xs_transaction_t t,
const char *path, unsigned int *num)
{
char *strings;
@@ -499,7 +499,7 @@ struct xs_permissions *xs_get_permissions(struct xs_handle *h,
* Returns false on failure.
*/
bool xs_set_permissions(struct xs_handle *h,
- xs_transaction_handle t,
+ xs_transaction_t t,
const char *path,
struct xs_permissions *perms,
unsigned int num_perms)
@@ -636,7 +636,7 @@ bool xs_unwatch(struct xs_handle *h, const char *path, const char *token)
* You can only have one transaction at any time.
* Returns NULL on failure.
*/
-xs_transaction_handle xs_transaction_start(struct xs_handle *h)
+xs_transaction_t xs_transaction_start(struct xs_handle *h)
{
char *id_str;
unsigned long id;
@@ -648,7 +648,7 @@ xs_transaction_handle xs_transaction_start(struct xs_handle *h)
id = strtoul(id_str, NULL, 0);
free(id_str);
- return (xs_transaction_handle)id;
+ return (xs_transaction_t)id;
}
/* End a transaction.
@@ -656,7 +656,7 @@ xs_transaction_handle xs_transaction_start(struct xs_handle *h)
* Returns false on failure, which indicates an error: transactions will
* not fail spuriously.
*/
-bool xs_transaction_end(struct xs_handle *h, xs_transaction_handle t,
+bool xs_transaction_end(struct xs_handle *h, xs_transaction_t t,
bool abort)
{
char abortstr[2];