ia64/xen-unstable

changeset 6387:ac57c81692b2

Add some additional error nodes when block device setup fails.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Wed Aug 24 08:55:14 2005 +0000 (2005-08-24)
parents a3822cb3b2b3
children ccfc31779d36
files linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c	Wed Aug 24 08:28:50 2005 +0000
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c	Wed Aug 24 08:55:14 2005 +0000
     1.3 @@ -75,7 +75,7 @@ static void frontend_changed(struct xenb
     1.4  	err = xenbus_gather(be->frontpath, "grant-id", "%lu", &sharedmfn,
     1.5  			    "event-channel", "%u", &evtchn, NULL);
     1.6  	if (err) {
     1.7 -		xenbus_dev_error(be->dev, err, 
     1.8 +		xenbus_dev_error(be->dev, err,
     1.9  				 "reading %s/grant-id and event-channel",
    1.10  				 be->frontpath);
    1.11  		return;
    1.12 @@ -177,6 +177,9 @@ static void backend_changed(struct xenbu
    1.13  		err = register_xenbus_watch(&be->watch);
    1.14  		if (err) {
    1.15  			be->watch.node = NULL;
    1.16 +			xenbus_dev_error(dev, err,
    1.17 +					 "adding frontend watch on %s",
    1.18 +					 be->frontpath);
    1.19  			goto device_fail;
    1.20  		}
    1.21  	}
    1.22 @@ -211,12 +214,15 @@ static void backend_changed(struct xenbu
    1.23  		if (IS_ERR(be->blkif)) {
    1.24  			err = PTR_ERR(be->blkif);
    1.25  			be->blkif = NULL;
    1.26 +			xenbus_dev_error(dev, err, "creating block interface");
    1.27  			goto device_fail;
    1.28  		}
    1.29  
    1.30  		err = vbd_create(be->blkif, handle, be->pdev, be->readonly);
    1.31 -		if (err)
    1.32 +		if (err) {
    1.33 +			xenbus_dev_error(dev, err, "creating vbd structure");
    1.34  			goto device_fail;
    1.35 +		}
    1.36  
    1.37  		frontend_changed(&be->watch, be->frontpath);
    1.38  	}
    1.39 @@ -238,8 +244,10 @@ static int blkback_probe(struct xenbus_d
    1.40  	int err;
    1.41  
    1.42  	be = kmalloc(sizeof(*be), GFP_KERNEL);
    1.43 -	if (!be)
    1.44 +	if (!be) {
    1.45 +		xenbus_dev_error(dev, -ENOMEM, "allocating backend structure");
    1.46  		return -ENOMEM;
    1.47 +	}
    1.48  
    1.49  	memset(be, 0, sizeof(*be));
    1.50  
    1.51 @@ -247,8 +255,11 @@ static int blkback_probe(struct xenbus_d
    1.52  	be->backend_watch.node = dev->nodename;
    1.53  	be->backend_watch.callback = backend_changed;
    1.54  	err = register_xenbus_watch(&be->backend_watch);
    1.55 -	if (err)
    1.56 +	if (err) {
    1.57 +		xenbus_dev_error(dev, err, "adding backend watch on %s",
    1.58 +				 dev->nodename);
    1.59  		goto free_be;
    1.60 +	}
    1.61  
    1.62  	dev->data = be;
    1.63  
     2.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Wed Aug 24 08:28:50 2005 +0000
     2.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Wed Aug 24 08:55:14 2005 +0000
     2.3 @@ -1165,8 +1165,10 @@ static int talk_to_backend(struct xenbus
     2.4  
     2.5  	/* Create shared ring, alloc event channel. */
     2.6  	err = setup_blkring(dev, info);
     2.7 -	if (err)
     2.8 +	if (err) {
     2.9 +		xenbus_dev_error(dev, err, "setting up block ring");
    2.10  		goto out;
    2.11 +	}
    2.12  
    2.13  	err = xenbus_transaction_start(dev->nodename);
    2.14  	if (err) {