[libvirt] [PATCH 05/10] nodeinfo: Add out parameter to nodeGetPresentCPUBitmap()

Peter Krempa pkrempa at redhat.com
Mon Jul 20 14:18:08 UTC 2015


On Mon, Jul 20, 2015 at 16:07:42 +0200, Andrea Bolognani wrote:
> On Mon, 2015-07-20 at 15:15 +0200, Peter Krempa wrote:
> > 
> > > -virBitmapPtr nodeGetPresentCPUBitmap(const char *sysfs_prefix);
> > > -virBitmapPtr nodeGetCPUBitmap(const char *sysfs_prefix, int 
> > > *max_id);
> > > +virBitmapPtr nodeGetPresentCPUBitmap(const char *sysfs_prefix,
> > > +                                     int *size);
> > > +virBitmapPtr nodeGetCPUBitmap(const char *sysfs_prefix,
> > > +                              int *size);
> > 
> > I'd prefer something like "ncpus" or maxcpu rather than size. For
> > getting size virBitmapSize() is totally apropriate.
> 
> I've used "size" on purpose, because I didn't want people to
> mistake that for a count of online or present CPUs: it's the
> size of the returned bitmap, same value you'd get if you
> called virBitmapSize() on it.

I thin the 'max_id' or perhaps 'max_cpu_id' were better. Otherwise I'd
stay with calling virBitmapSize. It doesn't then look like it's adding
any value on top of calling virBitmapSize directly and could actually be
optimized out.

Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150720/e130f0fa/attachment-0001.sig>


More information about the libvir-list mailing list