[torquedev] patch: fix qstat xml output of Resource_List and
resources_used
Garrick Staples
garrick at clusterresources.com
Tue Jan 30 23:37:15 MST 2007
On Tue, Jan 30, 2007 at 06:39:42PM -0500, Toni L. Harbaugh-Blackford [Contr] alleged:
> Hi-
>
> qstat -x leaves out the subfields when printing the XML of Resource_List
> and resources_used. For instance,
>
> Resource_List.ncpus = 2
>
> is printed in XML as
>
> <Resource_List>2</Resource_List>
>
> Below is a simple patch which will append the subfield with a "." as
> in the plain text output, so the XML will come out as
>
> <Resource_List.ncpus>2</Resource_List.ncpus>
>
> I have another patch that will instead make the subfields XML children, if
> you would prefer that.
I suspect the simpler dotted notation is adequate, though others may
disagree. We don't have validating XML, strict DTDs, or anything like
that.
> + if (!strcmp(a->name,ATTR_l) ||
> + !strcmp(a->name,ATTR_used)) {
> + combined[0]=0;
> + strcat(combined,a->name);
> + strcat(combined,".");
> + strcat(combined,a->resource);
I know we only currently have only 2 resource lists, but I imagine that
could change at some point. How about 'if (a->resource != NULL)'?
More information about the torquedev
mailing list