ia64/xen-unstable

changeset 8026:e1728d3c18ca

This fixes a small race between when a domain is created and when xentop
tries to read it's info from the xenstore. Instead of sending a NULL
pointer for the name the name will be displayed as a ' ' until the next
refresh where xentop will then properly display the name.

Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu Nov 24 11:17:20 2005 +0100 (2005-11-24)
parents 9c631c4fe727
children 188a4fb5ea1f
files tools/xenstat/libxenstat/src/xenstat.c
line diff
     1.1 --- a/tools/xenstat/libxenstat/src/xenstat.c	Thu Nov 24 11:10:43 2005 +0100
     1.2 +++ b/tools/xenstat/libxenstat/src/xenstat.c	Thu Nov 24 11:17:20 2005 +0100
     1.3 @@ -702,19 +702,12 @@ static char *xenstat_get_domain_name(xen
     1.4  {
     1.5  	char path[80];
     1.6  	char *name;
     1.7 -	struct xs_transaction_handle *xstranshandle;
     1.8  
     1.9  	snprintf(path, sizeof(path),"/local/domain/%i/name", domain_id);
    1.10  	
    1.11 -	xstranshandle = xs_transaction_start(handle->xshandle);
    1.12 -	if (xstranshandle == NULL) {
    1.13 -		perror("Unable to get transcation handle from xenstore\n");
    1.14 -		exit(1); /* Change this */
    1.15 -	}
    1.16 -
    1.17 -	name = (char *) xs_read(handle->xshandle, xstranshandle, path, NULL);
    1.18 -	
    1.19 -	xs_transaction_end(handle->xshandle, xstranshandle, false);
    1.20 +	name = xs_read(handle->xshandle, NULL, path, NULL);
    1.21 +	if (name == NULL)
    1.22 +		name = strdup(" ");
    1.23  
    1.24  	return name;
    1.25  }