ia64/xen-unstable

changeset 8549:f5f703ec5223

Change xenbus_transaction fake pointer into an opaque type.

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
author vhanquez@kneesa.uk.xensource.com
date Tue Jan 10 17:16:30 2006 +0000 (2006-01-10)
parents d3a4485a41fc
children 542cb7acb21a
files linux-2.6-xen-sparse/arch/xen/kernel/reboot.c linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c linux-2.6-xen-sparse/drivers/xen/tpmback/xenbus.c linux-2.6-xen-sparse/drivers/xen/tpmfront/tpmfront.c linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_client.c linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c linux-2.6-xen-sparse/include/asm-xen/xenbus.h tools/python/xen/lowlevel/xs/xs.c tools/xenstore/xenstore_client.c tools/xenstore/xs.c tools/xenstore/xs.h tools/xenstore/xs_test.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c	Tue Jan 10 17:27:16 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c	Tue Jan 10 17:16:30 2006 +0000
     1.3 @@ -290,7 +290,7 @@ static void shutdown_handler(struct xenb
     1.4  			     const char **vec, unsigned int len)
     1.5  {
     1.6  	char *str;
     1.7 -	struct xenbus_transaction *xbt;
     1.8 +	xenbus_transaction_t xbt;
     1.9  	int err;
    1.10  
    1.11  	if (shutting_down != SHUTDOWN_INVALID)
    1.12 @@ -339,7 +339,7 @@ static void sysrq_handler(struct xenbus_
    1.13  			  unsigned int len)
    1.14  {
    1.15  	char sysrq_key = '\0';
    1.16 -	struct xenbus_transaction *xbt;
    1.17 +	xenbus_transaction_t xbt;
    1.18  	int err;
    1.19  
    1.20   again:
     2.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c	Tue Jan 10 17:27:16 2006 +0100
     2.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c	Tue Jan 10 17:16:30 2006 +0000
     2.3 @@ -302,7 +302,7 @@ static void maybe_connect(struct backend
     2.4   */
     2.5  static void connect(struct backend_info *be)
     2.6  {
     2.7 -	struct xenbus_transaction *xbt;
     2.8 +	xenbus_transaction_t xbt;
     2.9  	int err;
    2.10  	struct xenbus_device *dev = be->dev;
    2.11  
     3.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Tue Jan 10 17:27:16 2006 +0100
     3.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Tue Jan 10 17:16:30 2006 +0000
     3.3 @@ -161,7 +161,7 @@ static int talk_to_backend(struct xenbus
     3.4  			   struct blkfront_info *info)
     3.5  {
     3.6  	const char *message = NULL;
     3.7 -	struct xenbus_transaction *xbt;
     3.8 +	xenbus_transaction_t xbt;
     3.9  	int err;
    3.10  
    3.11  	/* Create shared ring, alloc event channel. */
     4.1 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Tue Jan 10 17:27:16 2006 +0100
     4.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Tue Jan 10 17:16:30 2006 +0000
     4.3 @@ -260,7 +260,7 @@ static int talk_to_backend(struct xenbus
     4.4  			   struct netfront_info *info)
     4.5  {
     4.6  	const char *message;
     4.7 -	struct xenbus_transaction *xbt;
     4.8 +	xenbus_transaction_t xbt;
     4.9  	int err;
    4.10  
    4.11  	err = xen_net_read_mac(dev, info->mac);
     5.1 --- a/linux-2.6-xen-sparse/drivers/xen/tpmback/xenbus.c	Tue Jan 10 17:27:16 2006 +0100
     5.2 +++ b/linux-2.6-xen-sparse/drivers/xen/tpmback/xenbus.c	Tue Jan 10 17:16:30 2006 +0000
     5.3 @@ -230,7 +230,7 @@ static void maybe_connect(struct backend
     5.4  
     5.5  static void connect(struct backend_info *be)
     5.6  {
     5.7 -	struct xenbus_transaction *xbt;
     5.8 +	xenbus_transaction_t xbt;
     5.9  	int err;
    5.10  	struct xenbus_device *dev = be->dev;
    5.11  	unsigned long ready = 1;
     6.1 --- a/linux-2.6-xen-sparse/drivers/xen/tpmfront/tpmfront.c	Tue Jan 10 17:27:16 2006 +0100
     6.2 +++ b/linux-2.6-xen-sparse/drivers/xen/tpmfront/tpmfront.c	Tue Jan 10 17:16:30 2006 +0000
     6.3 @@ -271,7 +271,7 @@ static int talk_to_backend(struct xenbus
     6.4  {
     6.5  	const char *message = NULL;
     6.6  	int err;
     6.7 -	struct xenbus_transaction *xbt;
     6.8 +	xenbus_transaction_t xbt;
     6.9  
    6.10  	err = setup_tpmring(dev, info);
    6.11  	if (err) {
     7.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_client.c	Tue Jan 10 17:27:16 2006 +0100
     7.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_client.c	Tue Jan 10 17:16:30 2006 +0000
     7.3 @@ -87,7 +87,7 @@ EXPORT_SYMBOL(xenbus_watch_path2);
     7.4  
     7.5  
     7.6  int xenbus_switch_state(struct xenbus_device *dev,
     7.7 -			struct xenbus_transaction *xbt,
     7.8 +			xenbus_transaction_t xbt,
     7.9  			XenbusState state)
    7.10  {
    7.11  	/* We check whether the state is currently set to the given value, and
     8.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c	Tue Jan 10 17:27:16 2006 +0100
     8.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c	Tue Jan 10 17:16:30 2006 +0000
     8.3 @@ -47,7 +47,7 @@
     8.4  
     8.5  struct xenbus_dev_transaction {
     8.6  	struct list_head list;
     8.7 -	struct xenbus_transaction *handle;
     8.8 +	xenbus_transaction_t handle;
     8.9  };
    8.10  
    8.11  struct xenbus_dev_data {
    8.12 @@ -147,7 +147,7 @@ static ssize_t xenbus_dev_write(struct f
    8.13  		}
    8.14  
    8.15  		if (u->u.msg.type == XS_TRANSACTION_START) {
    8.16 -			trans->handle = (struct xenbus_transaction *)
    8.17 +			trans->handle = (xenbus_transaction_t)
    8.18  				simple_strtoul(reply, NULL, 0);
    8.19  			list_add(&trans->list, &u->transactions);
    8.20  		} else if (u->u.msg.type == XS_TRANSACTION_END) {
     9.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c	Tue Jan 10 17:27:16 2006 +0100
     9.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c	Tue Jan 10 17:16:30 2006 +0000
     9.3 @@ -190,7 +190,7 @@ void *xenbus_dev_request_and_reply(struc
     9.4  }
     9.5  
     9.6  /* Send message to xs, get kmalloc'ed reply.  ERR_PTR() on error. */
     9.7 -static void *xs_talkv(struct xenbus_transaction *t,
     9.8 +static void *xs_talkv(xenbus_transaction_t t,
     9.9  		      enum xsd_sockmsg_type type,
    9.10  		      const struct kvec *iovec,
    9.11  		      unsigned int num_vecs,
    9.12 @@ -242,7 +242,7 @@ static void *xs_talkv(struct xenbus_tran
    9.13  }
    9.14  
    9.15  /* Simplified version of xs_talkv: single message. */
    9.16 -static void *xs_single(struct xenbus_transaction *t,
    9.17 +static void *xs_single(xenbus_transaction_t t,
    9.18  		       enum xsd_sockmsg_type type,
    9.19  		       const char *string,
    9.20  		       unsigned int *len)
    9.21 @@ -309,7 +309,7 @@ static char **split(char *strings, unsig
    9.22  	return ret;
    9.23  }
    9.24  
    9.25 -char **xenbus_directory(struct xenbus_transaction *t,
    9.26 +char **xenbus_directory(xenbus_transaction_t t,
    9.27  			const char *dir, const char *node, unsigned int *num)
    9.28  {
    9.29  	char *strings, *path;
    9.30 @@ -329,7 +329,7 @@ char **xenbus_directory(struct xenbus_tr
    9.31  EXPORT_SYMBOL(xenbus_directory);
    9.32  
    9.33  /* Check if a path exists. Return 1 if it does. */
    9.34 -int xenbus_exists(struct xenbus_transaction *t,
    9.35 +int xenbus_exists(xenbus_transaction_t t,
    9.36  		  const char *dir, const char *node)
    9.37  {
    9.38  	char **d;
    9.39 @@ -347,7 +347,7 @@ EXPORT_SYMBOL(xenbus_exists);
    9.40   * Returns a kmalloced value: call free() on it after use.
    9.41   * len indicates length in bytes.
    9.42   */
    9.43 -void *xenbus_read(struct xenbus_transaction *t,
    9.44 +void *xenbus_read(xenbus_transaction_t t,
    9.45  		  const char *dir, const char *node, unsigned int *len)
    9.46  {
    9.47  	char *path;
    9.48 @@ -366,7 +366,7 @@ EXPORT_SYMBOL(xenbus_read);
    9.49  /* Write the value of a single file.
    9.50   * Returns -err on failure.
    9.51   */
    9.52 -int xenbus_write(struct xenbus_transaction *t,
    9.53 +int xenbus_write(xenbus_transaction_t t,
    9.54  		 const char *dir, const char *node, const char *string)
    9.55  {
    9.56  	const char *path;
    9.57 @@ -389,7 +389,7 @@ int xenbus_write(struct xenbus_transacti
    9.58  EXPORT_SYMBOL(xenbus_write);
    9.59  
    9.60  /* Create a new directory. */
    9.61 -int xenbus_mkdir(struct xenbus_transaction *t,
    9.62 +int xenbus_mkdir(xenbus_transaction_t t,
    9.63  		 const char *dir, const char *node)
    9.64  {
    9.65  	char *path;
    9.66 @@ -406,7 +406,7 @@ int xenbus_mkdir(struct xenbus_transacti
    9.67  EXPORT_SYMBOL(xenbus_mkdir);
    9.68  
    9.69  /* Destroy a file or directory (directories must be empty). */
    9.70 -int xenbus_rm(struct xenbus_transaction *t, const char *dir, const char *node)
    9.71 +int xenbus_rm(xenbus_transaction_t t, const char *dir, const char *node)
    9.72  {
    9.73  	char *path;
    9.74  	int ret;
    9.75 @@ -424,7 +424,7 @@ EXPORT_SYMBOL(xenbus_rm);
    9.76  /* Start a transaction: changes by others will not be seen during this
    9.77   * transaction, and changes will not be visible to others until end.
    9.78   */
    9.79 -struct xenbus_transaction *xenbus_transaction_start(void)
    9.80 +xenbus_transaction_t xenbus_transaction_start(void)
    9.81  {
    9.82  	char *id_str;
    9.83  	unsigned long id;
    9.84 @@ -434,20 +434,20 @@ struct xenbus_transaction *xenbus_transa
    9.85  	id_str = xs_single(XBT_NULL, XS_TRANSACTION_START, "", NULL);
    9.86  	if (IS_ERR(id_str)) {
    9.87  		up_read(&xs_state.suspend_mutex);
    9.88 -		return (struct xenbus_transaction *)id_str;
    9.89 +		return (xenbus_transaction_t )id_str;
    9.90  	}
    9.91  
    9.92  	id = simple_strtoul(id_str, NULL, 0);
    9.93  	kfree(id_str);
    9.94  
    9.95 -	return (struct xenbus_transaction *)id;
    9.96 +	return (xenbus_transaction_t) id;
    9.97  }
    9.98  EXPORT_SYMBOL(xenbus_transaction_start);
    9.99  
   9.100  /* End a transaction.
   9.101   * If abandon is true, transaction is discarded instead of committed.
   9.102   */
   9.103 -int xenbus_transaction_end(struct xenbus_transaction *t, int abort)
   9.104 +int xenbus_transaction_end(xenbus_transaction_t t, int abort)
   9.105  {
   9.106  	char abortstr[2];
   9.107  	int err;
   9.108 @@ -466,7 +466,7 @@ int xenbus_transaction_end(struct xenbus
   9.109  EXPORT_SYMBOL(xenbus_transaction_end);
   9.110  
   9.111  /* Single read and scanf: returns -errno or num scanned. */
   9.112 -int xenbus_scanf(struct xenbus_transaction *t,
   9.113 +int xenbus_scanf(xenbus_transaction_t t,
   9.114  		 const char *dir, const char *node, const char *fmt, ...)
   9.115  {
   9.116  	va_list ap;
   9.117 @@ -489,7 +489,7 @@ int xenbus_scanf(struct xenbus_transacti
   9.118  EXPORT_SYMBOL(xenbus_scanf);
   9.119  
   9.120  /* Single printf and write: returns -errno or 0. */
   9.121 -int xenbus_printf(struct xenbus_transaction *t,
   9.122 +int xenbus_printf(xenbus_transaction_t t,
   9.123  		  const char *dir, const char *node, const char *fmt, ...)
   9.124  {
   9.125  	va_list ap;
   9.126 @@ -515,7 +515,7 @@ int xenbus_printf(struct xenbus_transact
   9.127  EXPORT_SYMBOL(xenbus_printf);
   9.128  
   9.129  /* Takes tuples of names, scanf-style args, and void **, NULL terminated. */
   9.130 -int xenbus_gather(struct xenbus_transaction *t, const char *dir, ...)
   9.131 +int xenbus_gather(xenbus_transaction_t t, const char *dir, ...)
   9.132  {
   9.133  	va_list ap;
   9.134  	const char *name;
    10.1 --- a/linux-2.6-xen-sparse/include/asm-xen/xenbus.h	Tue Jan 10 17:27:16 2006 +0100
    10.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/xenbus.h	Tue Jan 10 17:16:30 2006 +0000
    10.3 @@ -103,34 +103,35 @@ int xenbus_register_backend(struct xenbu
    10.4  void xenbus_unregister_driver(struct xenbus_driver *drv);
    10.5  
    10.6  struct xenbus_transaction;
    10.7 +typedef struct xenbus_transaction *xenbus_transaction_t;
    10.8  
    10.9 -char **xenbus_directory(struct xenbus_transaction *t,
   10.10 +char **xenbus_directory(xenbus_transaction_t t,
   10.11  			const char *dir, const char *node, unsigned int *num);
   10.12 -void *xenbus_read(struct xenbus_transaction *t,
   10.13 +void *xenbus_read(xenbus_transaction_t t,
   10.14  		  const char *dir, const char *node, unsigned int *len);
   10.15 -int xenbus_write(struct xenbus_transaction *t,
   10.16 +int xenbus_write(xenbus_transaction_t t,
   10.17  		 const char *dir, const char *node, const char *string);
   10.18 -int xenbus_mkdir(struct xenbus_transaction *t,
   10.19 +int xenbus_mkdir(xenbus_transaction_t t,
   10.20  		 const char *dir, const char *node);
   10.21 -int xenbus_exists(struct xenbus_transaction *t,
   10.22 +int xenbus_exists(xenbus_transaction_t t,
   10.23  		  const char *dir, const char *node);
   10.24 -int xenbus_rm(struct xenbus_transaction *t, const char *dir, const char *node);
   10.25 -struct xenbus_transaction *xenbus_transaction_start(void);
   10.26 -int xenbus_transaction_end(struct xenbus_transaction *t, int abort);
   10.27 +int xenbus_rm(xenbus_transaction_t t, const char *dir, const char *node);
   10.28 +xenbus_transaction_t xenbus_transaction_start(void);
   10.29 +int xenbus_transaction_end(xenbus_transaction_t t, int abort);
   10.30  
   10.31  /* Single read and scanf: returns -errno or num scanned if > 0. */
   10.32 -int xenbus_scanf(struct xenbus_transaction *t,
   10.33 +int xenbus_scanf(xenbus_transaction_t t,
   10.34  		 const char *dir, const char *node, const char *fmt, ...)
   10.35  	__attribute__((format(scanf, 4, 5)));
   10.36  
   10.37  /* Single printf and write: returns -errno or 0. */
   10.38 -int xenbus_printf(struct xenbus_transaction *t,
   10.39 +int xenbus_printf(xenbus_transaction_t t,
   10.40  		  const char *dir, const char *node, const char *fmt, ...)
   10.41  	__attribute__((format(printf, 4, 5)));
   10.42  
   10.43  /* Generic read function: NULL-terminated triples of name,
   10.44   * sprintf-style type string, and pointer. Returns 0 or errno.*/
   10.45 -int xenbus_gather(struct xenbus_transaction *t, const char *dir, ...);
   10.46 +int xenbus_gather(xenbus_transaction_t t, const char *dir, ...);
   10.47  
   10.48  /* notifer routines for when the xenstore comes up */
   10.49  int register_xenstore_notifier(struct notifier_block *nb);
   10.50 @@ -196,7 +197,7 @@ int xenbus_watch_path2(struct xenbus_dev
   10.51   * XenbusStateClosing, and the error will be saved in the store.
   10.52   */
   10.53  int xenbus_switch_state(struct xenbus_device *dev,
   10.54 -			struct xenbus_transaction *xbt,
   10.55 +			xenbus_transaction_t xbt,
   10.56  			XenbusState new_state);
   10.57  
   10.58  
    11.1 --- a/tools/python/xen/lowlevel/xs/xs.c	Tue Jan 10 17:27:16 2006 +0100
    11.2 +++ b/tools/python/xen/lowlevel/xs/xs.c	Tue Jan 10 17:16:30 2006 +0000
    11.3 @@ -66,7 +66,7 @@ static PyObject *none(bool result);
    11.4  
    11.5  static int parse_transaction_path(XsHandle *self, PyObject *args,
    11.6                                    struct xs_handle **xh,
    11.7 -                                  struct xs_transaction_handle **th,
    11.8 +                                  xs_transaction_handle *th,
    11.9                                    char **path);
   11.10  
   11.11  
   11.12 @@ -83,7 +83,7 @@ static int parse_transaction_path(XsHand
   11.13  static PyObject *xspy_read(XsHandle *self, PyObject *args)
   11.14  {
   11.15      struct xs_handle *xh;
   11.16 -    struct xs_transaction_handle *th;
   11.17 +    xs_transaction_handle th;
   11.18      char *path;
   11.19  
   11.20      char *xsval;
   11.21 @@ -120,7 +120,7 @@ static PyObject *xspy_write(XsHandle *se
   11.22  {
   11.23      static char *arg_spec = "sss#";
   11.24      struct xs_handle *xh = xshandle(self);
   11.25 -    struct xs_transaction_handle *th;
   11.26 +    xs_transaction_handle th;
   11.27      char *thstr;
   11.28      char *path;
   11.29      char *data;
   11.30 @@ -132,7 +132,7 @@ static PyObject *xspy_write(XsHandle *se
   11.31      if (!PyArg_ParseTuple(args, arg_spec, &thstr, &path, &data, &data_n))
   11.32          return NULL;
   11.33  
   11.34 -    th = (struct xs_transaction_handle *)strtoul(thstr, NULL, 16);
   11.35 +    th = (xs_transaction_handle)strtoul(thstr, NULL, 16);
   11.36  
   11.37      Py_BEGIN_ALLOW_THREADS
   11.38      result = xs_write(xh, th, path, data, data_n);
   11.39 @@ -155,7 +155,7 @@ static PyObject *xspy_write(XsHandle *se
   11.40  static PyObject *xspy_ls(XsHandle *self, PyObject *args)
   11.41  {
   11.42      struct xs_handle *xh;
   11.43 -    struct xs_transaction_handle *th;
   11.44 +    xs_transaction_handle th;
   11.45      char *path;
   11.46  
   11.47      char **xsval;
   11.48 @@ -193,7 +193,7 @@ static PyObject *xspy_ls(XsHandle *self,
   11.49  static PyObject *xspy_mkdir(XsHandle *self, PyObject *args)
   11.50  {
   11.51      struct xs_handle *xh;
   11.52 -    struct xs_transaction_handle *th;
   11.53 +    xs_transaction_handle th;
   11.54      char *path;
   11.55  
   11.56      bool result;
   11.57 @@ -221,7 +221,7 @@ static PyObject *xspy_mkdir(XsHandle *se
   11.58  static PyObject *xspy_rm(XsHandle *self, PyObject *args)
   11.59  {
   11.60      struct xs_handle *xh;
   11.61 -    struct xs_transaction_handle *th;
   11.62 +    xs_transaction_handle th;
   11.63      char *path;
   11.64  
   11.65      bool result;
   11.66 @@ -256,7 +256,7 @@ static PyObject *xspy_get_permissions(Xs
   11.67      unsigned int perms_n = 0;
   11.68      int i;
   11.69  
   11.70 -    struct xs_transaction_handle *th;
   11.71 +    xs_transaction_handle th;
   11.72      char *thstr;
   11.73  
   11.74      if (!xh)
   11.75 @@ -264,7 +264,7 @@ static PyObject *xspy_get_permissions(Xs
   11.76      if (!PyArg_ParseTuple(args, arg_spec, &thstr, &path))
   11.77          return NULL;
   11.78  
   11.79 -    th = (struct xs_transaction_handle *)strtoul(thstr, NULL, 16);
   11.80 +    th = (xs_transaction_handle)strtoul(thstr, NULL, 16);
   11.81  
   11.82      Py_BEGIN_ALLOW_THREADS
   11.83      perms = xs_get_permissions(xh, th, path, &perms_n);
   11.84 @@ -312,7 +312,7 @@ static PyObject *xspy_set_permissions(Xs
   11.85      int xsperms_n;
   11.86      PyObject *tuple0 = NULL;
   11.87  
   11.88 -    struct xs_transaction_handle *th;
   11.89 +    xs_transaction_handle th;
   11.90      char *thstr;
   11.91  
   11.92      if (!xh)
   11.93 @@ -320,7 +320,7 @@ static PyObject *xspy_set_permissions(Xs
   11.94      if (!PyArg_ParseTuple(args, "ssO", &thstr, &path, &perms))
   11.95          goto exit;
   11.96  
   11.97 -    th = (struct xs_transaction_handle *)strtoul(thstr, NULL, 16);
   11.98 +    th = (xs_transaction_handle)strtoul(thstr, NULL, 16);
   11.99  
  11.100      if (!PyList_Check(perms)) {
  11.101          PyErr_SetString(PyExc_RuntimeError, "perms must be a list");
  11.102 @@ -509,7 +509,7 @@ static PyObject *xspy_unwatch(XsHandle *
  11.103  static PyObject *xspy_transaction_start(XsHandle *self)
  11.104  {
  11.105      struct xs_handle *xh = xshandle(self);
  11.106 -    struct xs_transaction_handle *th;
  11.107 +    xs_transaction_handle th;
  11.108      char thstr[MAX_STRLEN(unsigned long) + 1];
  11.109  
  11.110      if (!xh)
  11.111 @@ -547,7 +547,7 @@ static PyObject *xspy_transaction_end(Xs
  11.112      struct xs_handle *xh = xshandle(self);
  11.113      bool result;
  11.114  
  11.115 -    struct xs_transaction_handle *th;
  11.116 +    xs_transaction_handle th;
  11.117      char *thstr;
  11.118  
  11.119      if (!xh)
  11.120 @@ -556,7 +556,7 @@ static PyObject *xspy_transaction_end(Xs
  11.121                                       &thstr, &abort))
  11.122          return NULL;
  11.123  
  11.124 -    th = (struct xs_transaction_handle *)strtoul(thstr, NULL, 16);
  11.125 +    th = (xs_transaction_handle)strtoul(thstr, NULL, 16);
  11.126  
  11.127      Py_BEGIN_ALLOW_THREADS
  11.128      result = xs_transaction_end(xh, th, abort);
  11.129 @@ -727,7 +727,7 @@ static void remove_watch(XsHandle *self,
  11.130   */
  11.131  static int parse_transaction_path(XsHandle *self, PyObject *args,
  11.132                                    struct xs_handle **xh,
  11.133 -                                  struct xs_transaction_handle **th,
  11.134 +                                  xs_transaction_handle *th,
  11.135                                    char **path)
  11.136  {
  11.137      char *thstr;
  11.138 @@ -740,7 +740,7 @@ static int parse_transaction_path(XsHand
  11.139      if (!PyArg_ParseTuple(args, "ss", &thstr, path))
  11.140          return 0;
  11.141  
  11.142 -    *th = (struct xs_transaction_handle *)strtoul(thstr, NULL, 16);
  11.143 +    *th = (xs_transaction_handle)strtoul(thstr, NULL, 16);
  11.144  
  11.145      return 1;
  11.146  }
    12.1 --- a/tools/xenstore/xenstore_client.c	Tue Jan 10 17:27:16 2006 +0100
    12.2 +++ b/tools/xenstore/xenstore_client.c	Tue Jan 10 17:16:30 2006 +0000
    12.3 @@ -66,7 +66,7 @@ usage(const char *progname)
    12.4  
    12.5  #if defined(CLIENT_rm)
    12.6  static int
    12.7 -do_rm(char *path, struct xs_handle *xsh, struct xs_transaction_handle *xth)
    12.8 +do_rm(char *path, struct xs_handle *xsh, xs_transaction_handle xth)
    12.9  {
   12.10      if (xs_rm(xsh, xth, path)) {
   12.11          return 0;
   12.12 @@ -81,7 +81,7 @@ do_rm(char *path, struct xs_handle *xsh,
   12.13  
   12.14  static int
   12.15  perform(int optind, int argc, char **argv, struct xs_handle *xsh,
   12.16 -        struct xs_transaction_handle *xth, int prefix, int tidy)
   12.17 +        xs_transaction_handle xth, int prefix, int tidy)
   12.18  {
   12.19      while (optind < argc) {
   12.20  #if defined(CLIENT_read)
   12.21 @@ -179,7 +179,7 @@ int
   12.22  main(int argc, char **argv)
   12.23  {
   12.24      struct xs_handle *xsh;
   12.25 -    struct xs_transaction_handle *xth;
   12.26 +    xs_transaction_handle xth;
   12.27      int ret = 0, socket = 0;
   12.28      int prefix = 0;
   12.29      int tidy = 0;
    13.1 --- a/tools/xenstore/xs.c	Tue Jan 10 17:27:16 2006 +0100
    13.2 +++ b/tools/xenstore/xs.c	Tue Jan 10 17:16:30 2006 +0000
    13.3 @@ -292,7 +292,7 @@ static void *read_reply(
    13.4  }
    13.5  
    13.6  /* Send message to xs, get malloc'ed reply.  NULL and set errno on error. */
    13.7 -static void *xs_talkv(struct xs_handle *h, struct xs_transaction_handle *t,
    13.8 +static void *xs_talkv(struct xs_handle *h, xs_transaction_handle t,
    13.9  		      enum xsd_sockmsg_type type,
   13.10  		      const struct iovec *iovec,
   13.11  		      unsigned int num_vecs,
   13.12 @@ -368,7 +368,7 @@ static void free_no_errno(void *p)
   13.13  }
   13.14  
   13.15  /* Simplified version of xs_talkv: single message. */
   13.16 -static void *xs_single(struct xs_handle *h, struct xs_transaction_handle *t,
   13.17 +static void *xs_single(struct xs_handle *h, xs_transaction_handle t,
   13.18  		       enum xsd_sockmsg_type type,
   13.19  		       const char *string,
   13.20  		       unsigned int *len)
   13.21 @@ -388,7 +388,7 @@ static bool xs_bool(char *reply)
   13.22  	return true;
   13.23  }
   13.24  
   13.25 -char **xs_directory(struct xs_handle *h, struct xs_transaction_handle *t,
   13.26 +char **xs_directory(struct xs_handle *h, xs_transaction_handle t,
   13.27  		    const char *path, unsigned int *num)
   13.28  {
   13.29  	char *strings, *p, **ret;
   13.30 @@ -420,7 +420,7 @@ char **xs_directory(struct xs_handle *h,
   13.31   * Returns a malloced value: call free() on it after use.
   13.32   * len indicates length in bytes, not including the nul.
   13.33   */
   13.34 -void *xs_read(struct xs_handle *h, struct xs_transaction_handle *t,
   13.35 +void *xs_read(struct xs_handle *h, xs_transaction_handle t,
   13.36  	      const char *path, unsigned int *len)
   13.37  {
   13.38  	return xs_single(h, t, XS_READ, path, len);
   13.39 @@ -429,7 +429,7 @@ void *xs_read(struct xs_handle *h, struc
   13.40  /* Write the value of a single file.
   13.41   * Returns false on failure.
   13.42   */
   13.43 -bool xs_write(struct xs_handle *h, struct xs_transaction_handle *t,
   13.44 +bool xs_write(struct xs_handle *h, xs_transaction_handle t,
   13.45  	      const char *path, const void *data, unsigned int len)
   13.46  {
   13.47  	struct iovec iovec[2];
   13.48 @@ -446,7 +446,7 @@ bool xs_write(struct xs_handle *h, struc
   13.49  /* Create a new directory.
   13.50   * Returns false on failure, or success if it already exists.
   13.51   */
   13.52 -bool xs_mkdir(struct xs_handle *h, struct xs_transaction_handle *t,
   13.53 +bool xs_mkdir(struct xs_handle *h, xs_transaction_handle t,
   13.54  	      const char *path)
   13.55  {
   13.56  	return xs_bool(xs_single(h, t, XS_MKDIR, path, NULL));
   13.57 @@ -455,7 +455,7 @@ bool xs_mkdir(struct xs_handle *h, struc
   13.58  /* Destroy a file or directory (directories must be empty).
   13.59   * Returns false on failure, or success if it doesn't exist.
   13.60   */
   13.61 -bool xs_rm(struct xs_handle *h, struct xs_transaction_handle *t,
   13.62 +bool xs_rm(struct xs_handle *h, xs_transaction_handle t,
   13.63  	   const char *path)
   13.64  {
   13.65  	return xs_bool(xs_single(h, t, XS_RM, path, NULL));
   13.66 @@ -465,7 +465,7 @@ bool xs_rm(struct xs_handle *h, struct x
   13.67   * Returns malloced array, or NULL: call free() after use.
   13.68   */
   13.69  struct xs_permissions *xs_get_permissions(struct xs_handle *h,
   13.70 -					  struct xs_transaction_handle *t,
   13.71 +					  xs_transaction_handle t,
   13.72  					  const char *path, unsigned int *num)
   13.73  {
   13.74  	char *strings;
   13.75 @@ -499,7 +499,7 @@ struct xs_permissions *xs_get_permission
   13.76   * Returns false on failure.
   13.77   */
   13.78  bool xs_set_permissions(struct xs_handle *h,
   13.79 -			struct xs_transaction_handle *t,
   13.80 +			xs_transaction_handle t,
   13.81  			const char *path,
   13.82  			struct xs_permissions *perms,
   13.83  			unsigned int num_perms)
   13.84 @@ -636,7 +636,7 @@ bool xs_unwatch(struct xs_handle *h, con
   13.85   * You can only have one transaction at any time.
   13.86   * Returns NULL on failure.
   13.87   */
   13.88 -struct xs_transaction_handle *xs_transaction_start(struct xs_handle *h)
   13.89 +xs_transaction_handle xs_transaction_start(struct xs_handle *h)
   13.90  {
   13.91  	char *id_str;
   13.92  	unsigned long id;
   13.93 @@ -648,7 +648,7 @@ struct xs_transaction_handle *xs_transac
   13.94  	id = strtoul(id_str, NULL, 0);
   13.95  	free(id_str);
   13.96  
   13.97 -	return (struct xs_transaction_handle *)id;
   13.98 +	return (xs_transaction_handle)id;
   13.99  }
  13.100  
  13.101  /* End a transaction.
  13.102 @@ -656,7 +656,7 @@ struct xs_transaction_handle *xs_transac
  13.103   * Returns false on failure, which indicates an error: transactions will
  13.104   * not fail spuriously.
  13.105   */
  13.106 -bool xs_transaction_end(struct xs_handle *h, struct xs_transaction_handle *t,
  13.107 +bool xs_transaction_end(struct xs_handle *h, xs_transaction_handle t,
  13.108  			bool abort)
  13.109  {
  13.110  	char abortstr[2];
    14.1 --- a/tools/xenstore/xs.h	Tue Jan 10 17:27:16 2006 +0100
    14.2 +++ b/tools/xenstore/xs.h	Tue Jan 10 17:16:30 2006 +0000
    14.3 @@ -26,6 +26,7 @@
    14.4  
    14.5  struct xs_handle;
    14.6  struct xs_transaction_handle;
    14.7 +typedef struct xs_transaction_handle * xs_transaction_handle;
    14.8  
    14.9  /* On failure, these routines set errno. */
   14.10  
   14.11 @@ -47,45 +48,45 @@ void xs_daemon_close(struct xs_handle *)
   14.12   * Returns a malloced array: call free() on it after use.
   14.13   * Num indicates size.
   14.14   */
   14.15 -char **xs_directory(struct xs_handle *h, struct xs_transaction_handle *t,
   14.16 +char **xs_directory(struct xs_handle *h, xs_transaction_handle t,
   14.17  		    const char *path, unsigned int *num);
   14.18  
   14.19  /* Get the value of a single file, nul terminated.
   14.20   * Returns a malloced value: call free() on it after use.
   14.21   * len indicates length in bytes, not including terminator.
   14.22   */
   14.23 -void *xs_read(struct xs_handle *h, struct xs_transaction_handle *t,
   14.24 +void *xs_read(struct xs_handle *h, xs_transaction_handle t,
   14.25  	      const char *path, unsigned int *len);
   14.26  
   14.27  /* Write the value of a single file.
   14.28   * Returns false on failure.
   14.29   */
   14.30 -bool xs_write(struct xs_handle *h, struct xs_transaction_handle *t,
   14.31 +bool xs_write(struct xs_handle *h, xs_transaction_handle t,
   14.32  	      const char *path, const void *data, unsigned int len);
   14.33  
   14.34  /* Create a new directory.
   14.35   * Returns false on failure, or success if it already exists.
   14.36   */
   14.37 -bool xs_mkdir(struct xs_handle *h, struct xs_transaction_handle *t,
   14.38 +bool xs_mkdir(struct xs_handle *h, xs_transaction_handle t,
   14.39  	      const char *path);
   14.40  
   14.41  /* Destroy a file or directory (and children).
   14.42   * Returns false on failure, or if it doesn't exist.
   14.43   */
   14.44 -bool xs_rm(struct xs_handle *h, struct xs_transaction_handle *t,
   14.45 +bool xs_rm(struct xs_handle *h, xs_transaction_handle t,
   14.46  	   const char *path);
   14.47  
   14.48  /* Get permissions of node (first element is owner, first perms is "other").
   14.49   * Returns malloced array, or NULL: call free() after use.
   14.50   */
   14.51  struct xs_permissions *xs_get_permissions(struct xs_handle *h,
   14.52 -					  struct xs_transaction_handle *t,
   14.53 +					  xs_transaction_handle t,
   14.54  					  const char *path, unsigned int *num);
   14.55  
   14.56  /* Set permissions of node (must be owner).
   14.57   * Returns false on failure.
   14.58   */
   14.59 -bool xs_set_permissions(struct xs_handle *h, struct xs_transaction_handle *t,
   14.60 +bool xs_set_permissions(struct xs_handle *h, xs_transaction_handle t,
   14.61  			const char *path, struct xs_permissions *perms,
   14.62  			unsigned int num_perms);
   14.63  
   14.64 @@ -115,14 +116,14 @@ bool xs_unwatch(struct xs_handle *h, con
   14.65   * You can only have one transaction at any time.
   14.66   * Returns NULL on failure.
   14.67   */
   14.68 -struct xs_transaction_handle *xs_transaction_start(struct xs_handle *h);
   14.69 +xs_transaction_handle xs_transaction_start(struct xs_handle *h);
   14.70  
   14.71  /* End a transaction.
   14.72   * If abandon is true, transaction is discarded instead of committed.
   14.73   * Returns false on failure: if errno == EAGAIN, you have to restart
   14.74   * transaction.
   14.75   */
   14.76 -bool xs_transaction_end(struct xs_handle *h, struct xs_transaction_handle *t,
   14.77 +bool xs_transaction_end(struct xs_handle *h, xs_transaction_handle t,
   14.78  			bool abort);
   14.79  
   14.80  /* Introduce a new domain.
    15.1 --- a/tools/xenstore/xs_test.c	Tue Jan 10 17:27:16 2006 +0100
    15.2 +++ b/tools/xenstore/xs_test.c	Tue Jan 10 17:16:30 2006 +0000
    15.3 @@ -43,7 +43,7 @@
    15.4  #define XSTEST
    15.5  
    15.6  static struct xs_handle *handles[10] = { NULL };
    15.7 -static struct xs_transaction_handle *txh[10] = { XBT_NULL };
    15.8 +static xs_transaction_handle txh[10] = { XBT_NULL };
    15.9  
   15.10  static unsigned int timeout_ms = 500;
   15.11  static bool timeout_suppressed = true;