aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xenstat
diff options
context:
space:
mode:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-11-24 11:17:20 +0100
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-11-24 11:17:20 +0100
commitefb8e0c63f3d394ac37bfeaf3c27cc092d06317f (patch)
tree1a71ce5142c48fa11b9e7d4be7320e663d25447c /tools/xenstat
parentd0d531a4c5f20aef1ea5d7d93fe875fc5fb143bf (diff)
downloadxen-efb8e0c63f3d394ac37bfeaf3c27cc092d06317f.tar.gz
xen-efb8e0c63f3d394ac37bfeaf3c27cc092d06317f.tar.bz2
xen-efb8e0c63f3d394ac37bfeaf3c27cc092d06317f.zip
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>
Diffstat (limited to 'tools/xenstat')
-rw-r--r--tools/xenstat/libxenstat/src/xenstat.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/tools/xenstat/libxenstat/src/xenstat.c b/tools/xenstat/libxenstat/src/xenstat.c
index e01ee8c4eb..921c7d29db 100644
--- a/tools/xenstat/libxenstat/src/xenstat.c
+++ b/tools/xenstat/libxenstat/src/xenstat.c
@@ -702,19 +702,12 @@ static char *xenstat_get_domain_name(xenstat_handle *handle, unsigned int domain
{
char path[80];
char *name;
- struct xs_transaction_handle *xstranshandle;
snprintf(path, sizeof(path),"/local/domain/%i/name", domain_id);
- xstranshandle = xs_transaction_start(handle->xshandle);
- if (xstranshandle == NULL) {
- perror("Unable to get transcation handle from xenstore\n");
- exit(1); /* Change this */
- }
-
- name = (char *) xs_read(handle->xshandle, xstranshandle, path, NULL);
-
- xs_transaction_end(handle->xshandle, xstranshandle, false);
+ name = xs_read(handle->xshandle, NULL, path, NULL);
+ if (name == NULL)
+ name = strdup(" ");
return name;
}