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

Re: [Xen-devel] [PATCH 8 of 8] xl: add node-affinity to the output of `xl list`



On Fri, 2012-10-05 at 17:36 +0100, Ian Jackson wrote: 
> > +static void print_bitmap(uint8_t *map, int maplen, FILE *stream, int 
> > cpu_node)
> > +{
> > +    int i;
> > +    uint8_t pmap = 0, bitmask = 0;
> > +    int firstset = 0, state = 0;
> > +
> > ...
> 
> Is this business with a state variable really the least opaque way of
> writing this ?  Oh I see you're just moving it about.  Oh well..
> 
I don't think it's any opaque and, yes, I'm mostly moving that
print_bitmap function up in the file, but the new status variable is
mine (guilty ass charge :-D).

Honestly, despite the fact that the function is called print_bitmap(),
it contains the following code:

        case 1:
            if (firstset == 0) {
                fprintf(stream, "any cpu");
                break;
            }
        case 3:

Which is what made me thinking that opacity was not its first concern in
the first place, and that turning it into being opaque was none of this
change's business. :-)

However, I see your point... Perhaps I can add two functions (something
like print_{cpumap,nodemap}()), both calling the original
print_bitmap(), and deal with the "any {cpu,node}" case within them... 

Do you like that better?

Thanks and Regards,
Dario

-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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