diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/python/xen/lowlevel/xs/xs.c | 12 | ||||
-rw-r--r-- | tools/xenstat/libxenstat/src/xenstat.c | 2 | ||||
-rw-r--r-- | tools/xenstore/xenstore_client.c | 2 | ||||
-rw-r--r-- | tools/xenstore/xs.c | 10 | ||||
-rw-r--r-- | tools/xenstore/xs.h | 5 |
5 files changed, 15 insertions, 16 deletions
diff --git a/tools/python/xen/lowlevel/xs/xs.c b/tools/python/xen/lowlevel/xs/xs.c index 5f6d1850f4..25dfaaf2a4 100644 --- a/tools/python/xen/lowlevel/xs/xs.c +++ b/tools/python/xen/lowlevel/xs/xs.c @@ -132,7 +132,7 @@ static PyObject *xspy_write(XsHandle *self, PyObject *args) if (!PyArg_ParseTuple(args, arg_spec, &thstr, &path, &data, &data_n)) return NULL; - th = (xs_transaction_t)strtoul(thstr, NULL, 16); + th = strtoul(thstr, NULL, 16); Py_BEGIN_ALLOW_THREADS result = xs_write(xh, th, path, data, data_n); @@ -264,7 +264,7 @@ static PyObject *xspy_get_permissions(XsHandle *self, PyObject *args) if (!PyArg_ParseTuple(args, arg_spec, &thstr, &path)) return NULL; - th = (xs_transaction_t)strtoul(thstr, NULL, 16); + th = strtoul(thstr, NULL, 16); Py_BEGIN_ALLOW_THREADS perms = xs_get_permissions(xh, th, path, &perms_n); @@ -320,7 +320,7 @@ static PyObject *xspy_set_permissions(XsHandle *self, PyObject *args) if (!PyArg_ParseTuple(args, "ssO", &thstr, &path, &perms)) goto exit; - th = (xs_transaction_t)strtoul(thstr, NULL, 16); + th = strtoul(thstr, NULL, 16); if (!PyList_Check(perms)) { PyErr_SetString(PyExc_RuntimeError, "perms must be a list"); @@ -519,7 +519,7 @@ static PyObject *xspy_transaction_start(XsHandle *self) th = xs_transaction_start(xh); Py_END_ALLOW_THREADS - if (th == NULL) { + if (th == XBT_NULL) { PyErr_SetFromErrno(PyExc_RuntimeError); return NULL; } @@ -556,7 +556,7 @@ static PyObject *xspy_transaction_end(XsHandle *self, PyObject *args, &thstr, &abort)) return NULL; - th = (xs_transaction_t)strtoul(thstr, NULL, 16); + th = strtoul(thstr, NULL, 16); Py_BEGIN_ALLOW_THREADS result = xs_transaction_end(xh, th, abort); @@ -740,7 +740,7 @@ static int parse_transaction_path(XsHandle *self, PyObject *args, if (!PyArg_ParseTuple(args, "ss", &thstr, path)) return 0; - *th = (xs_transaction_t)strtoul(thstr, NULL, 16); + *th = strtoul(thstr, NULL, 16); return 1; } diff --git a/tools/xenstat/libxenstat/src/xenstat.c b/tools/xenstat/libxenstat/src/xenstat.c index 921c7d29db..e8a6928dac 100644 --- a/tools/xenstat/libxenstat/src/xenstat.c +++ b/tools/xenstat/libxenstat/src/xenstat.c @@ -705,7 +705,7 @@ static char *xenstat_get_domain_name(xenstat_handle *handle, unsigned int domain snprintf(path, sizeof(path),"/local/domain/%i/name", domain_id); - name = xs_read(handle->xshandle, NULL, path, NULL); + name = xs_read(handle->xshandle, XBT_NULL, path, NULL); if (name == NULL) name = strdup(" "); diff --git a/tools/xenstore/xenstore_client.c b/tools/xenstore/xenstore_client.c index deb63453d3..07809e6c83 100644 --- a/tools/xenstore/xenstore_client.c +++ b/tools/xenstore/xenstore_client.c @@ -243,7 +243,7 @@ main(int argc, char **argv) again: xth = xs_transaction_start(xsh); - if (xth == NULL) + if (xth == XBT_NULL) errx(1, "couldn't start transaction"); ret = perform(optind, argc, argv, xsh, xth, prefix, tidy); diff --git a/tools/xenstore/xs.c b/tools/xenstore/xs.c index 8332e1aad5..f7a576119f 100644 --- a/tools/xenstore/xs.c +++ b/tools/xenstore/xs.c @@ -304,7 +304,7 @@ static void *xs_talkv(struct xs_handle *h, xs_transaction_t t, unsigned int i; struct sigaction ignorepipe, oldact; - msg.tx_id = (uint32_t)(unsigned long)t; + msg.tx_id = t; msg.req_id = 0; msg.type = type; msg.len = 0; @@ -634,21 +634,21 @@ bool xs_unwatch(struct xs_handle *h, const char *path, const char *token) /* Start a transaction: changes by others will not be seen during this * transaction, and changes will not be visible to others until end. * You can only have one transaction at any time. - * Returns NULL on failure. + * Returns XBT_NULL on failure. */ xs_transaction_t xs_transaction_start(struct xs_handle *h) { char *id_str; - unsigned long id; + xs_transaction_t id; id_str = xs_single(h, XBT_NULL, XS_TRANSACTION_START, "", NULL); if (id_str == NULL) - return NULL; + return XBT_NULL; id = strtoul(id_str, NULL, 0); free(id_str); - return (xs_transaction_t)id; + return id; } /* End a transaction. diff --git a/tools/xenstore/xs.h b/tools/xenstore/xs.h index 55bbcd157a..cabf9d0711 100644 --- a/tools/xenstore/xs.h +++ b/tools/xenstore/xs.h @@ -22,11 +22,10 @@ #include <xs_lib.h> -#define XBT_NULL NULL +#define XBT_NULL 0 struct xs_handle; -struct xs_transaction_t; -typedef struct xs_transaction_t * xs_transaction_t; +typedef uint32_t xs_transaction_t; /* On failure, these routines set errno. */ |