George Dunlap
2011-Jul-05 11:28 UTC
[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@lists.xensource.com http://lists.xensource.com/xen-devel