ia64/xen-unstable

changeset 7294:5df423407700

Added some clarifying comments regarding xenbus/xenstore kernel startup.

Signed-off-by: Steven Hand <steven@xensource.com>
author smh22@firebug.cl.cam.ac.uk
date Sun Oct 09 20:55:53 2005 +0100 (2005-10-09)
parents 8016551fde98
children f1e8d5f64105
files linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c	Sun Oct 09 18:52:54 2005 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c	Sun Oct 09 20:55:53 2005 +0100
     1.3 @@ -246,7 +246,10 @@ static int privcmd_ioctl(struct inode *i
     1.4  				   PAGE_SHIFT);
     1.5  		ret = xen_start_info->store_mfn;
     1.6  
     1.7 -		/* We'll return then this will wait for daemon to answer */
     1.8 +		/* 
     1.9 +		** Complete initialization of xenbus (viz. set up the 
    1.10 +		** connection to xenstored now that it has started). 
    1.11 +		*/
    1.12  		kthread_run(do_xenbus_probe, NULL, "xenbus_probe");
    1.13  	}
    1.14  	break;
     2.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c	Sun Oct 09 18:52:54 2005 +0100
     2.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c	Sun Oct 09 20:55:53 2005 +0100
     2.3 @@ -666,12 +666,16 @@ void unregister_xenstore_notifier(struct
     2.4  }
     2.5  EXPORT_SYMBOL(unregister_xenstore_notifier);
     2.6  
     2.7 -/* called from a thread in privcmd/privcmd.c */
     2.8 +/* 
     2.9 +** Called either from below xenbus_probe_init() initcall (for domUs) 
    2.10 +** or, for dom0, from a thread created in privcmd/privcmd.c (after 
    2.11 +** the user-space tools have invoked initDomainStore()) 
    2.12 +*/
    2.13  int do_xenbus_probe(void *unused)
    2.14  {
    2.15  	int err = 0;
    2.16  
    2.17 -	/* Initialize xenstore comms unless already done. */
    2.18 +	/* Initialize the interface to xenstore. */
    2.19  	err = xs_init();
    2.20  	if (err) {
    2.21  		printk("XENBUS: Error initializing xenstore comms:"
    2.22 @@ -703,6 +707,10 @@ static int __init xenbus_probe_init(void
    2.23  	device_register(&xenbus_frontend.dev);
    2.24  	device_register(&xenbus_backend.dev);
    2.25  
    2.26 +	/* 
    2.27 +	** Domain0 doesn't have a store_evtchn yet - this will
    2.28 +	** be set up later by xend invoking initDomainStore() 
    2.29 +	*/
    2.30  	if (!xen_start_info->store_evtchn)
    2.31  		return 0;
    2.32  
     3.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c	Sun Oct 09 18:52:54 2005 +0100
     3.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c	Sun Oct 09 20:55:53 2005 +0100
     3.3 @@ -780,6 +780,9 @@ static int read_thread(void *unused)
     3.4  	}
     3.5  }
     3.6  
     3.7 +/*
     3.8 +** Initialize the interface to xenstore. 
     3.9 +*/
    3.10  int xs_init(void)
    3.11  {
    3.12  	int err;
    3.13 @@ -793,6 +796,7 @@ int xs_init(void)
    3.14  	init_MUTEX(&xs_state.transaction_mutex);
    3.15  	xs_state.transaction_pid = -1;
    3.16  
    3.17 +	/* Initialize the shared memory rings to talk to xenstored */
    3.18  	err = xb_init_comms();
    3.19  	if (err)
    3.20  		return err;