ia64/xen-unstable

changeset 9140:5aae1b1c3098

Log the tdb_error when a read fails with EIO. This is happening after a long
time under load -- hopefully this message will suggest why.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@leeni.uk.xensource.com
date Sat Mar 04 19:12:37 2006 +0100 (2006-03-04)
parents 8853631252d8
children f43f094467f6
files tools/xenstore/xenstored_core.c
line diff
     1.1 --- a/tools/xenstore/xenstored_core.c	Sat Mar 04 19:10:56 2006 +0100
     1.2 +++ b/tools/xenstore/xenstored_core.c	Sat Mar 04 19:12:37 2006 +0100
     1.3 @@ -406,16 +406,19 @@ static struct node *read_node(struct con
     1.4  	TDB_DATA key, data;
     1.5  	uint32_t *p;
     1.6  	struct node *node;
     1.7 +	TDB_CONTEXT * context = tdb_context(conn);
     1.8  
     1.9  	key.dptr = (void *)name;
    1.10  	key.dsize = strlen(name);
    1.11 -	data = tdb_fetch(tdb_context(conn), key);
    1.12 +	data = tdb_fetch(context, key);
    1.13  
    1.14  	if (data.dptr == NULL) {
    1.15 -		if (tdb_error(tdb_context(conn)) == TDB_ERR_NOEXIST)
    1.16 +		if (tdb_error(context) == TDB_ERR_NOEXIST)
    1.17  			errno = ENOENT;
    1.18 -		else
    1.19 +		else {
    1.20 +			log("TDB error on read: %s", tdb_errorstr(context));
    1.21  			errno = EIO;
    1.22 +		}
    1.23  		return NULL;
    1.24  	}
    1.25