[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] This fixes a small race between when a domain is created and when xentop



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID e1728d3c18ca63ccc29b599caf24997cb93cf191
# Parent  9c631c4fe727d9148b7feecafe94df5b8439cea7
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@xxxxxxxxxx>
Signed-off-by: Anthony Liguori <aliguori@xxxxxxxxxx>

diff -r 9c631c4fe727 -r e1728d3c18ca tools/xenstat/libxenstat/src/xenstat.c
--- a/tools/xenstat/libxenstat/src/xenstat.c    Thu Nov 24 10:10:43 2005
+++ b/tools/xenstat/libxenstat/src/xenstat.c    Thu Nov 24 10:17:20 2005
@@ -702,19 +702,12 @@
 {
        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;
 }      

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.