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

[Xen-devel] [PATCH] Handle RUNSTATE_INIT in domain_runstate calculation



diff -r 54ed57e63047 -r 275dd17a6a36 xenalyze.c
--- a/xenalyze.c        Wed May 18 11:24:21 2011 +0200
+++ b/xenalyze.c        Tue Jul 05 12:28:26 2011 +0100
@@ -4832,7 +4832,7 @@ int domain_runstate(struct domain_data *
         runstates[i]=0;
 
     for(i=0; i<=d->max_vid; i++)
-        if(d->vcpu[i]) {
+        if(d->vcpu[i] && d->vcpu[i]->runstate.state != RUNSTATE_INIT) {
             max_vcpus++;
             runstates[d->vcpu[i]->runstate.state]++;
         }
@@ -4863,17 +4863,18 @@ int domain_runstate(struct domain_data *
                 d->did);
     }
 
-#if 0
-    printf(" Max vid: %d\n", d->max_vid);
-    for(i=0; i<=d->max_vid; i++)
-        if(d->vcpu[i])
-            fprintf(warn, " v%d: %s\n",
-                    i, runstate_name[d->vcpu[i]->runstate]);
-
-    for(i=0; i<RUNSTATE_MAX; i++)
-        fprintf(warn, " %s: %d\n",
-                runstate_name[i], runstates[i]);
-#endif     
+    if ( ret < 0 )
+    {
+        printf(" Max vid: %d (max_vcpus %d)\n", d->max_vid, max_vcpus);
+        for(i=0; i<=d->max_vid; i++)
+            if(d->vcpu[i])
+                fprintf(warn, " v%d: %s\n",
+                        i, runstate_name[d->vcpu[i]->runstate.state]);
+
+        for(i=0; i<RUNSTATE_MAX; i++)
+            fprintf(warn, " %s: %d\n",
+                    runstate_name[i], runstates[i]);
+    }
                    
     if(ret >= 0)
         return ret;

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


 


Rackspace

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