ia64/xen-unstable

changeset 8547:991ccc24bf2e

Replace NULL xenbus transaction by a specific XBT_NULL value.

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
author vhanquez@kneesa.uk.xensource.com
date Tue Jan 10 15:05:05 2006 +0000 (2006-01-10)
parents 50d46a775ad0
children d3a4485a41fc 40bb46f599d9
files linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c linux-2.6-xen-sparse/drivers/xen/balloon/balloon.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/net_driver_util.c linux-2.6-xen-sparse/drivers/xen/netback/xenbus.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/xenbus/xenbus_client.c linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c linux-2.6-xen-sparse/include/asm-xen/xenbus.h tools/console/client/main.c tools/console/daemon/io.c tools/xenstore/xs.c tools/xenstore/xs.h tools/xenstore/xs_test.c tools/xenstore/xsls.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c	Tue Jan 10 16:00:37 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c	Tue Jan 10 15:05:05 2006 +0000
     1.3 @@ -298,7 +298,7 @@ static void vcpu_hotplug(unsigned int cp
     1.4  		return;
     1.5  
     1.6  	sprintf(dir, "cpu/%d", cpu);
     1.7 -	err = xenbus_scanf(NULL, dir, "availability", "%s", state);
     1.8 +	err = xenbus_scanf(XBT_NULL, dir, "availability", "%s", state);
     1.9  	if (err != 1) {
    1.10  		printk(KERN_ERR "XENBUS: Unable to read cpu state\n");
    1.11  		return;
     2.1 --- a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c	Tue Jan 10 16:00:37 2006 +0100
     2.2 +++ b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c	Tue Jan 10 15:05:05 2006 +0000
     2.3 @@ -354,7 +354,7 @@ static void watch_target(struct xenbus_w
     2.4  	unsigned long long new_target;
     2.5  	int err;
     2.6  
     2.7 -	err = xenbus_scanf(NULL, "memory", "target", "%llu", &new_target);
     2.8 +	err = xenbus_scanf(XBT_NULL, "memory", "target", "%llu", &new_target);
     2.9  	if (err != 1) {
    2.10  		/* This is ok (for domain0 at least) - so just return */
    2.11  		return;
     3.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c	Tue Jan 10 16:00:37 2006 +0100
     3.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c	Tue Jan 10 15:05:05 2006 +0000
     3.3 @@ -145,7 +145,7 @@ static int blkback_probe(struct xenbus_d
     3.4  	if (err)
     3.5  		goto fail;
     3.6  
     3.7 -	err = xenbus_switch_state(dev, NULL, XenbusStateInitWait);
     3.8 +	err = xenbus_switch_state(dev, XBT_NULL, XenbusStateInitWait);
     3.9  	if (err)
    3.10  		goto fail;
    3.11  
    3.12 @@ -175,7 +175,7 @@ static void backend_changed(struct xenbu
    3.13  
    3.14  	DPRINTK("");
    3.15  
    3.16 -	err = xenbus_scanf(NULL, dev->nodename, "physical-device", "%x:%x",
    3.17 +	err = xenbus_scanf(XBT_NULL, dev->nodename, "physical-device", "%x:%x",
    3.18  			   &major, &minor);
    3.19  	if (XENBUS_EXIST_ERR(err)) {
    3.20  		/* Since this watch will fire once immediately after it is
    3.21 @@ -197,7 +197,7 @@ static void backend_changed(struct xenbu
    3.22  		return;
    3.23  	}
    3.24  
    3.25 -	be->mode = xenbus_read(NULL, dev->nodename, "mode", NULL);
    3.26 +	be->mode = xenbus_read(XBT_NULL, dev->nodename, "mode", NULL);
    3.27  	if (IS_ERR(be->mode)) {
    3.28  		err = PTR_ERR(be->mode);
    3.29  		be->mode = NULL;
    3.30 @@ -268,7 +268,7 @@ static void frontend_changed(struct xenb
    3.31  		break;
    3.32  
    3.33  	case XenbusStateClosing:
    3.34 -		xenbus_switch_state(dev, NULL, XenbusStateClosing);
    3.35 +		xenbus_switch_state(dev, XBT_NULL, XenbusStateClosing);
    3.36  		break;
    3.37  
    3.38  	case XenbusStateClosed:
    3.39 @@ -366,7 +366,7 @@ static int connect_ring(struct backend_i
    3.40  
    3.41  	DPRINTK("%s", dev->otherend);
    3.42  
    3.43 -	err = xenbus_gather(NULL, dev->otherend, "ring-ref", "%lu", &ring_ref,
    3.44 +	err = xenbus_gather(XBT_NULL, dev->otherend, "ring-ref", "%lu", &ring_ref,
    3.45  			    "event-channel", "%u", &evtchn, NULL);
    3.46  	if (err) {
    3.47  		xenbus_dev_fatal(dev, err,
     4.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Tue Jan 10 16:00:37 2006 +0100
     4.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Tue Jan 10 15:05:05 2006 +0000
     4.3 @@ -91,7 +91,7 @@ static int blkfront_probe(struct xenbus_
     4.4  	struct blkfront_info *info;
     4.5  
     4.6  	/* FIXME: Use dynamic device id if this is not set. */
     4.7 -	err = xenbus_scanf(NULL, dev->nodename,
     4.8 +	err = xenbus_scanf(XBT_NULL, dev->nodename,
     4.9  			   "virtual-device", "%i", &vdevice);
    4.10  	if (err != 1) {
    4.11  		xenbus_dev_fatal(dev, err, "reading virtual-device");
    4.12 @@ -319,7 +319,7 @@ static void connect(struct blkfront_info
    4.13  
    4.14  	DPRINTK("blkfront.c:connect:%s.\n", info->xbdev->otherend);
    4.15  
    4.16 -	err = xenbus_gather(NULL, info->xbdev->otherend,
    4.17 +	err = xenbus_gather(XBT_NULL, info->xbdev->otherend,
    4.18  			    "sectors", "%lu", &sectors,
    4.19  			    "info", "%u", &binfo,
    4.20  			    "sector-size", "%lu", &sector_size,
    4.21 @@ -338,7 +338,7 @@ static void connect(struct blkfront_info
    4.22  		return;
    4.23  	}
    4.24  
    4.25 -	(void)xenbus_switch_state(info->xbdev, NULL, XenbusStateConnected); 
    4.26 +	(void)xenbus_switch_state(info->xbdev, XBT_NULL, XenbusStateConnected); 
    4.27  
    4.28  	/* Kick pending requests. */
    4.29  	spin_lock_irq(&blkif_io_lock);
    4.30 @@ -367,7 +367,7 @@ static void blkfront_closing(struct xenb
    4.31  		info->mi = NULL;
    4.32  	}
    4.33  
    4.34 -	xenbus_switch_state(dev, NULL, XenbusStateClosed);
    4.35 +	xenbus_switch_state(dev, XBT_NULL, XenbusStateClosed);
    4.36  }
    4.37  
    4.38  
    4.39 @@ -775,7 +775,7 @@ static void blkif_recover(struct blkfron
    4.40  
    4.41  	kfree(copy);
    4.42  
    4.43 -	(void)xenbus_switch_state(info->xbdev, NULL, XenbusStateConnected); 
    4.44 +	(void)xenbus_switch_state(info->xbdev, XBT_NULL, XenbusStateConnected); 
    4.45  	
    4.46  	/* Now safe for us to use the shared ring */
    4.47  	spin_lock_irq(&blkif_io_lock);
     5.1 --- a/linux-2.6-xen-sparse/drivers/xen/net_driver_util.c	Tue Jan 10 16:00:37 2006 +0100
     5.2 +++ b/linux-2.6-xen-sparse/drivers/xen/net_driver_util.c	Tue Jan 10 15:05:05 2006 +0000
     5.3 @@ -38,7 +38,7 @@ int xen_net_read_mac(struct xenbus_devic
     5.4  	char *s;
     5.5  	int i;
     5.6  	char *e;
     5.7 -	char *macstr = xenbus_read(NULL, dev->nodename, "mac", NULL);
     5.8 +	char *macstr = xenbus_read(XBT_NULL, dev->nodename, "mac", NULL);
     5.9  	if (IS_ERR(macstr)) {
    5.10  		return PTR_ERR(macstr);
    5.11  	}
     6.1 --- a/linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c	Tue Jan 10 16:00:37 2006 +0100
     6.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c	Tue Jan 10 15:05:05 2006 +0000
     6.3 @@ -93,7 +93,7 @@ static int netback_probe(struct xenbus_d
     6.4  	if (err)
     6.5  		goto fail;
     6.6  
     6.7 -	err = xenbus_switch_state(dev, NULL, XenbusStateInitWait);
     6.8 +	err = xenbus_switch_state(dev, XBT_NULL, XenbusStateInitWait);
     6.9  	if (err) {
    6.10  		goto fail;
    6.11  	}
    6.12 @@ -122,7 +122,7 @@ static int netback_hotplug(struct xenbus
    6.13  
    6.14  	DPRINTK("netback_hotplug");
    6.15  
    6.16 -	val = xenbus_read(NULL, xdev->nodename, "script", NULL);
    6.17 +	val = xenbus_read(XBT_NULL, xdev->nodename, "script", NULL);
    6.18  	if (IS_ERR(val)) {
    6.19  		int err = PTR_ERR(val);
    6.20  		xenbus_dev_fatal(xdev, err, "reading script");
    6.21 @@ -160,7 +160,7 @@ static void backend_changed(struct xenbu
    6.22  
    6.23  	DPRINTK("");
    6.24  
    6.25 -	err = xenbus_scanf(NULL, dev->nodename, "handle", "%li", &handle);
    6.26 +	err = xenbus_scanf(XBT_NULL, dev->nodename, "handle", "%li", &handle);
    6.27  	if (XENBUS_EXIST_ERR(err)) {
    6.28  		/* Since this watch will fire once immediately after it is
    6.29  		   registered, we expect this.  Ignore it, and wait for the
    6.30 @@ -212,7 +212,7 @@ static void frontend_changed(struct xenb
    6.31  		break;
    6.32  
    6.33  	case XenbusStateClosing:
    6.34 -		xenbus_switch_state(dev, NULL, XenbusStateClosing);
    6.35 +		xenbus_switch_state(dev, XBT_NULL, XenbusStateClosing);
    6.36  		break;
    6.37  
    6.38  	case XenbusStateClosed:
    6.39 @@ -256,7 +256,7 @@ static void connect(struct backend_info 
    6.40  		return;
    6.41  	}
    6.42  
    6.43 -	xenbus_switch_state(dev, NULL, XenbusStateConnected);
    6.44 +	xenbus_switch_state(dev, XBT_NULL, XenbusStateConnected);
    6.45  }
    6.46  
    6.47  
    6.48 @@ -269,7 +269,7 @@ static int connect_rings(struct backend_
    6.49  
    6.50  	DPRINTK("");
    6.51  
    6.52 -	err = xenbus_gather(NULL, dev->otherend,
    6.53 +	err = xenbus_gather(XBT_NULL, dev->otherend,
    6.54  			    "tx-ring-ref", "%lu", &tx_ring_ref,
    6.55  			    "rx-ring-ref", "%lu", &rx_ring_ref,
    6.56  			    "event-channel", "%u", &evtchn, NULL);
     7.1 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Tue Jan 10 16:00:37 2006 +0100
     7.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Tue Jan 10 15:05:05 2006 +0000
     7.3 @@ -212,7 +212,7 @@ static int netfront_probe(struct xenbus_
     7.4  	struct netfront_info *info;
     7.5  	unsigned int handle;
     7.6  
     7.7 -	err = xenbus_scanf(NULL, dev->nodename, "handle", "%u", &handle);
     7.8 +	err = xenbus_scanf(XBT_NULL, dev->nodename, "handle", "%u", &handle);
     7.9  	if (err != 1) {
    7.10  		xenbus_dev_fatal(dev, err, "reading handle");
    7.11  		return err;
    7.12 @@ -1199,7 +1199,7 @@ static void netfront_closing(struct xenb
    7.13  
    7.14  	close_netdev(info);
    7.15  
    7.16 -	xenbus_switch_state(dev, NULL, XenbusStateClosed);
    7.17 +	xenbus_switch_state(dev, XBT_NULL, XenbusStateClosed);
    7.18  }
    7.19  
    7.20  
     8.1 --- a/linux-2.6-xen-sparse/drivers/xen/tpmback/xenbus.c	Tue Jan 10 16:00:37 2006 +0100
     8.2 +++ b/linux-2.6-xen-sparse/drivers/xen/tpmback/xenbus.c	Tue Jan 10 15:05:05 2006 +0000
     8.3 @@ -275,7 +275,7 @@ static int connect_ring(struct backend_i
     8.4  	unsigned int evtchn;
     8.5  	int err;
     8.6  
     8.7 -	err = xenbus_gather(NULL, dev->otherend,
     8.8 +	err = xenbus_gather(XBT_NULL, dev->otherend,
     8.9  	                    "ring-ref", "%lu", &ring_ref,
    8.10  			    "event-channel", "%u", &evtchn, NULL);
    8.11  	if (err) {
     9.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_client.c	Tue Jan 10 16:00:37 2006 +0100
     9.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_client.c	Tue Jan 10 15:05:05 2006 +0000
     9.3 @@ -152,7 +152,7 @@ void _dev_error(struct xenbus_device *de
     9.4  		goto fail;
     9.5  	}
     9.6  
     9.7 -	if (xenbus_write(NULL, path_buffer, "error", printf_buffer) != 0) {
     9.8 +	if (xenbus_write(XBT_NULL, path_buffer, "error", printf_buffer) != 0) {
     9.9  		printk("xenbus: failed to write error node for %s (%s)\n",
    9.10  		       dev->nodename, printf_buffer);
    9.11  		goto fail;
    9.12 @@ -187,7 +187,7 @@ void xenbus_dev_fatal(struct xenbus_devi
    9.13  	_dev_error(dev, err, fmt, ap);
    9.14  	va_end(ap);
    9.15  	
    9.16 -	xenbus_switch_state(dev, NULL, XenbusStateClosing);
    9.17 +	xenbus_switch_state(dev, XBT_NULL, XenbusStateClosing);
    9.18  }
    9.19  EXPORT_SYMBOL(xenbus_dev_fatal);
    9.20  
    9.21 @@ -223,7 +223,7 @@ XenbusState xenbus_read_driver_state(con
    9.22  {
    9.23  	XenbusState result;
    9.24  
    9.25 -	int err = xenbus_gather(NULL, path, "state", "%d", &result, NULL);
    9.26 +	int err = xenbus_gather(XBT_NULL, path, "state", "%d", &result, NULL);
    9.27  	if (err)
    9.28  		result = XenbusStateClosed;
    9.29  
    10.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c	Tue Jan 10 16:00:37 2006 +0100
    10.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c	Tue Jan 10 15:05:05 2006 +0000
    10.3 @@ -115,7 +115,7 @@ static int frontend_bus_id(char bus_id[B
    10.4  static int read_otherend_details(struct xenbus_device *xendev,
    10.5  				 char *id_node, char *path_node)
    10.6  {
    10.7 -	int err = xenbus_gather(NULL, xendev->nodename,
    10.8 +	int err = xenbus_gather(XBT_NULL, xendev->nodename,
    10.9  				id_node, "%i", &xendev->otherend_id,
   10.10  				path_node, NULL, &xendev->otherend,
   10.11  				NULL);
   10.12 @@ -126,7 +126,7 @@ static int read_otherend_details(struct 
   10.13  		return err;
   10.14  	}
   10.15  	if (strlen(xendev->otherend) == 0 ||
   10.16 -	    !xenbus_exists(NULL, xendev->otherend, "")) {
   10.17 +	    !xenbus_exists(XBT_NULL, xendev->otherend, "")) {
   10.18  		xenbus_dev_fatal(xendev, -ENOENT, "missing other end from %s",
   10.19  				 xendev->nodename);
   10.20  		kfree(xendev->otherend);
   10.21 @@ -200,14 +200,14 @@ static int backend_bus_id(char bus_id[BU
   10.22  
   10.23  	devid = strrchr(nodename, '/') + 1;
   10.24  
   10.25 -	err = xenbus_gather(NULL, nodename, "frontend-id", "%i", &domid,
   10.26 +	err = xenbus_gather(XBT_NULL, nodename, "frontend-id", "%i", &domid,
   10.27  			    "frontend", NULL, &frontend,
   10.28  			    NULL);
   10.29  	if (err)
   10.30  		return err;
   10.31  	if (strlen(frontend) == 0)
   10.32  		err = -ERANGE;
   10.33 -	if (!err && !xenbus_exists(NULL, frontend, ""))
   10.34 +	if (!err && !xenbus_exists(XBT_NULL, frontend, ""))
   10.35  		err = -ENOENT;
   10.36  
   10.37  	kfree(frontend);
   10.38 @@ -373,7 +373,7 @@ static int xenbus_dev_probe(struct devic
   10.39  	return 0;
   10.40  fail:
   10.41  	xenbus_dev_error(dev, err, "xenbus_dev_probe on %s", dev->nodename);
   10.42 -	xenbus_switch_state(dev, NULL, XenbusStateClosed);
   10.43 +	xenbus_switch_state(dev, XBT_NULL, XenbusStateClosed);
   10.44  	return -ENODEV;
   10.45  	
   10.46  }
   10.47 @@ -391,7 +391,7 @@ static int xenbus_dev_remove(struct devi
   10.48  	if (drv->remove)
   10.49  		drv->remove(dev);
   10.50  
   10.51 -	xenbus_switch_state(dev, NULL, XenbusStateClosed);
   10.52 +	xenbus_switch_state(dev, XBT_NULL, XenbusStateClosed);
   10.53  	return 0;
   10.54  }
   10.55  
   10.56 @@ -643,7 +643,7 @@ static int xenbus_probe_backend(const ch
   10.57  	if (!nodename)
   10.58  		return -ENOMEM;
   10.59  
   10.60 -	dir = xenbus_directory(NULL, nodename, "", &dir_n);
   10.61 +	dir = xenbus_directory(XBT_NULL, nodename, "", &dir_n);
   10.62  	if (IS_ERR(dir)) {
   10.63  		kfree(nodename);
   10.64  		return PTR_ERR(dir);
   10.65 @@ -666,7 +666,7 @@ static int xenbus_probe_device_type(stru
   10.66  	unsigned int dir_n = 0;
   10.67  	int i;
   10.68  
   10.69 -	dir = xenbus_directory(NULL, bus->root, type, &dir_n);
   10.70 +	dir = xenbus_directory(XBT_NULL, bus->root, type, &dir_n);
   10.71  	if (IS_ERR(dir))
   10.72  		return PTR_ERR(dir);
   10.73  
   10.74 @@ -685,7 +685,7 @@ static int xenbus_probe_devices(struct x
   10.75  	char **dir;
   10.76  	unsigned int i, dir_n;
   10.77  
   10.78 -	dir = xenbus_directory(NULL, bus->root, "", &dir_n);
   10.79 +	dir = xenbus_directory(XBT_NULL, bus->root, "", &dir_n);
   10.80  	if (IS_ERR(dir))
   10.81  		return PTR_ERR(dir);
   10.82  
   10.83 @@ -731,7 +731,7 @@ static void dev_changed(const char *node
   10.84  	if (char_count(node, '/') < 2)
   10.85   		return;
   10.86  
   10.87 -	exists = xenbus_exists(NULL, node, "");
   10.88 +	exists = xenbus_exists(XBT_NULL, node, "");
   10.89  	if (!exists) {
   10.90  		xenbus_cleanup_devices(node, &bus->bus);
   10.91  		return;
    11.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c	Tue Jan 10 16:00:37 2006 +0100
    11.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c	Tue Jan 10 15:05:05 2006 +0000
    11.3 @@ -431,7 +431,7 @@ struct xenbus_transaction *xenbus_transa
    11.4  
    11.5  	down_read(&xs_state.suspend_mutex);
    11.6  
    11.7 -	id_str = xs_single(NULL, XS_TRANSACTION_START, "", NULL);
    11.8 +	id_str = xs_single(XBT_NULL, XS_TRANSACTION_START, "", NULL);
    11.9  	if (IS_ERR(id_str)) {
   11.10  		up_read(&xs_state.suspend_mutex);
   11.11  		return (struct xenbus_transaction *)id_str;
   11.12 @@ -553,7 +553,7 @@ static int xs_watch(const char *path, co
   11.13  	iov[1].iov_base = (void *)token;
   11.14  	iov[1].iov_len = strlen(token) + 1;
   11.15  
   11.16 -	return xs_error(xs_talkv(NULL, XS_WATCH, iov,
   11.17 +	return xs_error(xs_talkv(XBT_NULL, XS_WATCH, iov,
   11.18  				 ARRAY_SIZE(iov), NULL));
   11.19  }
   11.20  
   11.21 @@ -566,7 +566,7 @@ static int xs_unwatch(const char *path, 
   11.22  	iov[1].iov_base = (char *)token;
   11.23  	iov[1].iov_len = strlen(token) + 1;
   11.24  
   11.25 -	return xs_error(xs_talkv(NULL, XS_UNWATCH, iov,
   11.26 +	return xs_error(xs_talkv(XBT_NULL, XS_UNWATCH, iov,
   11.27  				 ARRAY_SIZE(iov), NULL));
   11.28  }
   11.29  
    12.1 --- a/linux-2.6-xen-sparse/include/asm-xen/xenbus.h	Tue Jan 10 16:00:37 2006 +0100
    12.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/xenbus.h	Tue Jan 10 15:05:05 2006 +0000
    12.3 @@ -37,6 +37,8 @@
    12.4  #include <asm-xen/xen-public/io/xenbus.h>
    12.5  #include <asm-xen/xen-public/io/xs_wire.h>
    12.6  
    12.7 +#define XBT_NULL NULL
    12.8 +
    12.9  /* Register callback to watch this node. */
   12.10  struct xenbus_watch
   12.11  {
    13.1 --- a/tools/console/client/main.c	Tue Jan 10 16:00:37 2006 +0100
    13.2 +++ b/tools/console/client/main.c	Tue Jan 10 15:05:05 2006 +0000
    13.3 @@ -220,7 +220,7 @@ int main(int argc, char **argv)
    13.4  	if (path == NULL)
    13.5  		err(ENOMEM, "realloc");
    13.6  	strcat(path, "/console/tty");
    13.7 -	str_pty = xs_read(xs, NULL, path, &len);
    13.8 +	str_pty = xs_read(xs, XBT_NULL, path, &len);
    13.9  
   13.10  	/* FIXME consoled currently does not assume domain-0 doesn't have a
   13.11  	   console which is good when we break domain-0 up.  To keep us
   13.12 @@ -245,7 +245,7 @@ int main(int argc, char **argv)
   13.13  		struct timeval tv = { 0, 500 };
   13.14  		select(0, NULL, NULL, NULL, &tv); /* pause briefly */
   13.15  
   13.16 -		str_pty = xs_read(xs, NULL, path, &len);
   13.17 +		str_pty = xs_read(xs, XBT_NULL, path, &len);
   13.18  	}
   13.19  
   13.20  	if (str_pty == NULL) {
    14.1 --- a/tools/console/daemon/io.c	Tue Jan 10 16:00:37 2006 +0100
    14.2 +++ b/tools/console/daemon/io.c	Tue Jan 10 15:05:05 2006 +0000
    14.3 @@ -174,7 +174,7 @@ static int domain_create_tty(struct doma
    14.4  		success = asprintf(&path, "%s/limit", dom->conspath) != -1;
    14.5  		if (!success)
    14.6  			goto out;
    14.7 -		data = xs_read(xs, NULL, path, &len);
    14.8 +		data = xs_read(xs, XBT_NULL, path, &len);
    14.9  		if (data) {
   14.10  			dom->buffer.max_capacity = strtoul(data, 0, 0);
   14.11  			free(data);
   14.12 @@ -184,7 +184,7 @@ static int domain_create_tty(struct doma
   14.13  		success = asprintf(&path, "%s/tty", dom->conspath) != -1;
   14.14  		if (!success)
   14.15  			goto out;
   14.16 -		success = xs_write(xs, NULL, path, slave, strlen(slave));
   14.17 +		success = xs_write(xs, XBT_NULL, path, slave, strlen(slave));
   14.18  		free(path);
   14.19  		if (!success)
   14.20  			goto out;
   14.21 @@ -214,7 +214,7 @@ int xs_gather(struct xs_handle *xs, cons
   14.22  		char *p;
   14.23  
   14.24  		asprintf(&path, "%s/%s", dir, name);
   14.25 -		p = xs_read(xs, NULL, path, NULL);
   14.26 +		p = xs_read(xs, XBT_NULL, path, NULL);
   14.27  		free(path);
   14.28  		if (p == NULL) {
   14.29  			ret = ENOENT;
    15.1 --- a/tools/xenstore/xs.c	Tue Jan 10 16:00:37 2006 +0100
    15.2 +++ b/tools/xenstore/xs.c	Tue Jan 10 15:05:05 2006 +0000
    15.3 @@ -560,7 +560,7 @@ bool xs_watch(struct xs_handle *h, const
    15.4  	iov[1].iov_base = (void *)token;
    15.5  	iov[1].iov_len = strlen(token) + 1;
    15.6  
    15.7 -	return xs_bool(xs_talkv(h, NULL, XS_WATCH, iov,
    15.8 +	return xs_bool(xs_talkv(h, XBT_NULL, XS_WATCH, iov,
    15.9  				ARRAY_SIZE(iov), NULL));
   15.10  }
   15.11  
   15.12 @@ -627,7 +627,7 @@ bool xs_unwatch(struct xs_handle *h, con
   15.13  	iov[1].iov_base = (char *)token;
   15.14  	iov[1].iov_len = strlen(token) + 1;
   15.15  
   15.16 -	return xs_bool(xs_talkv(h, NULL, XS_UNWATCH, iov,
   15.17 +	return xs_bool(xs_talkv(h, XBT_NULL, XS_UNWATCH, iov,
   15.18  				ARRAY_SIZE(iov), NULL));
   15.19  }
   15.20  
   15.21 @@ -641,7 +641,7 @@ struct xs_transaction_handle *xs_transac
   15.22  	char *id_str;
   15.23  	unsigned long id;
   15.24  
   15.25 -	id_str = xs_single(h, NULL, XS_TRANSACTION_START, "", NULL);
   15.26 +	id_str = xs_single(h, XBT_NULL, XS_TRANSACTION_START, "", NULL);
   15.27  	if (id_str == NULL)
   15.28  		return NULL;
   15.29  
   15.30 @@ -693,7 +693,7 @@ bool xs_introduce_domain(struct xs_handl
   15.31  	iov[2].iov_base = eventchn_str;
   15.32  	iov[2].iov_len = strlen(eventchn_str) + 1;
   15.33  
   15.34 -	return xs_bool(xs_talkv(h, NULL, XS_INTRODUCE, iov,
   15.35 +	return xs_bool(xs_talkv(h, XBT_NULL, XS_INTRODUCE, iov,
   15.36  				ARRAY_SIZE(iov), NULL));
   15.37  }
   15.38  
   15.39 @@ -705,7 +705,7 @@ static void * single_with_domid(struct x
   15.40  
   15.41  	sprintf(domid_str, "%u", domid);
   15.42  
   15.43 -	return xs_single(h, NULL, type, domid_str, NULL);
   15.44 +	return xs_single(h, XBT_NULL, type, domid_str, NULL);
   15.45  }
   15.46  
   15.47  bool xs_release_domain(struct xs_handle *h, unsigned int domid)
   15.48 @@ -719,7 +719,7 @@ char *xs_get_domain_path(struct xs_handl
   15.49  
   15.50  	sprintf(domid_str, "%u", domid);
   15.51  
   15.52 -	return xs_single(h, NULL, XS_GET_DOMAIN_PATH, domid_str, NULL);
   15.53 +	return xs_single(h, XBT_NULL, XS_GET_DOMAIN_PATH, domid_str, NULL);
   15.54  }
   15.55  
   15.56  bool xs_is_domain_introduced(struct xs_handle *h, unsigned int domid)
   15.57 @@ -739,7 +739,7 @@ char *xs_debug_command(struct xs_handle 
   15.58  	iov[1].iov_base = data;
   15.59  	iov[1].iov_len = len;
   15.60  
   15.61 -	return xs_talkv(h, NULL, XS_DEBUG, iov,
   15.62 +	return xs_talkv(h, XBT_NULL, XS_DEBUG, iov,
   15.63  			ARRAY_SIZE(iov), NULL);
   15.64  }
   15.65  
    16.1 --- a/tools/xenstore/xs.h	Tue Jan 10 16:00:37 2006 +0100
    16.2 +++ b/tools/xenstore/xs.h	Tue Jan 10 15:05:05 2006 +0000
    16.3 @@ -22,6 +22,8 @@
    16.4  
    16.5  #include <xs_lib.h>
    16.6  
    16.7 +#define XBT_NULL NULL
    16.8 +
    16.9  struct xs_handle;
   16.10  struct xs_transaction_handle;
   16.11  
    17.1 --- a/tools/xenstore/xs_test.c	Tue Jan 10 16:00:37 2006 +0100
    17.2 +++ b/tools/xenstore/xs_test.c	Tue Jan 10 15:05:05 2006 +0000
    17.3 @@ -37,12 +37,13 @@
    17.4  #include <sys/time.h>
    17.5  #include "utils.h"
    17.6  #include "xs_lib.h"
    17.7 +#include "xs.h"
    17.8  #include "list.h"
    17.9  
   17.10  #define XSTEST
   17.11  
   17.12  static struct xs_handle *handles[10] = { NULL };
   17.13 -static struct xs_transaction_handle *txh[10] = { NULL };
   17.14 +static struct xs_transaction_handle *txh[10] = { XBT_NULL };
   17.15  
   17.16  static unsigned int timeout_ms = 500;
   17.17  static bool timeout_suppressed = true;
   17.18 @@ -492,7 +493,7 @@ static void do_unwatch(unsigned int hand
   17.19  static void do_start(unsigned int handle)
   17.20  {
   17.21  	txh[handle] = xs_transaction_start(handles[handle]);
   17.22 -	if (txh[handle] == NULL)
   17.23 +	if (txh[handle] == XBT_NULL)
   17.24  		failed(handle);
   17.25  }
   17.26  
   17.27 @@ -500,7 +501,7 @@ static void do_end(unsigned int handle, 
   17.28  {
   17.29  	if (!xs_transaction_end(handles[handle], txh[handle], abort))
   17.30  		failed(handle);
   17.31 -	txh[handle] = NULL;
   17.32 +	txh[handle] = XBT_NULL;
   17.33  }
   17.34  
   17.35  static void do_introduce(unsigned int handle,
   17.36 @@ -718,7 +719,7 @@ static void do_command(unsigned int defa
   17.37  	else if (streq(command, "close")) {
   17.38  		xs_daemon_close(handles[handle]);
   17.39  		handles[handle] = NULL;
   17.40 -		txh[handle] = NULL;
   17.41 +		txh[handle] = XBT_NULL;
   17.42  	} else if (streq(command, "start"))
   17.43  		do_start(handle);
   17.44  	else if (streq(command, "commit"))
    18.1 --- a/tools/xenstore/xsls.c	Tue Jan 10 16:00:37 2006 +0100
    18.2 +++ b/tools/xenstore/xsls.c	Tue Jan 10 15:05:05 2006 +0000
    18.3 @@ -11,7 +11,7 @@ void print_dir(struct xs_handle *h, char
    18.4      int i;
    18.5      unsigned int num, len;
    18.6  
    18.7 -    e = xs_directory(h, NULL, path, &num);
    18.8 +    e = xs_directory(h, XBT_NULL, path, &num);
    18.9      if (e == NULL)
   18.10          err(1, "xs_directory (%s)", path);
   18.11  
   18.12 @@ -22,7 +22,7 @@ void print_dir(struct xs_handle *h, char
   18.13          sprintf(newpath, "%s%s%s", path, 
   18.14                  path[strlen(path)-1] == '/' ? "" : "/", 
   18.15                  e[i]);
   18.16 -        val = xs_read(h, NULL, newpath, &len);
   18.17 +        val = xs_read(h, XBT_NULL, newpath, &len);
   18.18          if (val == NULL)
   18.19              printf(":\n");
   18.20          else if ((unsigned)len > (151 - strlen(e[i])))