From: Ian Campbell Subject: Re: [PATCH 10 of 11 v4] xl: add node-affinity to the output of `xl list` Date: Mon, 18 Mar 2013 14:13:51 +0000 Message-ID: <1363616031.2963.6.camel@zakaz.uk.xensource.com> References: <0197084457098065914d.1363314652@hit-nxdomain.opendns.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <0197084457098065914d.1363314652@hit-nxdomain.opendns.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Dario Faggioli Cc: Marcus Granado , Dan Magenheimer , Matt Wilson , Anil Madhavapeddy , George Dunlap , Andrew Cooper , Juergen Gross , Ian Jackson , Xen-Devel , Jan Beulich , Daniel De Graaf List-Id: xen-devel@lists.xenproject.org On Fri, 2013-03-15 at 02:30 +0000, Dario Faggioli wrote: > Node-affinity is now something that is under (some) control of the > user, so show it upon request as part of the output of `xl list' > by the `-n' option. > > Re the patch, the print_bitmap() related hunk is _mostly_ code motion, > although there is a very minor change in the code, basically to allow > using the function for printing both cpu and node bitmaps (as, in case > all bits are sets, it used to print "any cpu", which doesn't fit the > nodemap case). > > Signed-off-by: Dario Faggioli > Acked-by: Juergen Gross Acked-by: Ian Campbell [...] > if (rc < 0) > - printf(" -"); > + printf(" -"); > else { > - printf(" %s", buf); > + printf(" %16s", buf); > free(buf); If you do end up respinning for any reason then this could be made less manual/error prone by using "%16s" even in the "-" case. Might even be possible to combine the whole lot, since free(NULL) is safe: printf(" %16s", rc < 0 : "" ? buf); free(buf); (assuming buf == NULL whenever rc < 0, I didn't check)