[libvirt] [PATCH 2/6] util: Introduce virHostCPUGetInfoParseCPUInfo()

Andrea Bolognani abologna at redhat.com
Wed Dec 13 15:56:37 UTC 2017


On Wed, 2017-12-13 at 15:56 +0100, Bjoern Walk wrote:
> > > Why do we cleanup here and abandon the rest of the information? Since
> > > the information in /proc/cpuinfo is kind of volatile in its format,
> > > shouldn't we be liberal in what we accept? If we can't parse it, we just
> > > report mhz = 0, but gathering the rest of the information in this
> > > function is still valuable.
> > 
> > Most functions in libvirt either perform all tasks succesfully or
> > return a failure, so failing here is in line both with that and
> > with the existing behavior.
> 
> So for example for S390 we have introduced CPU frequency information in
> /proc/cpuinfo only recently. That means that depending on your kernel
> version, you either read freq. info and the rest of the stuff or you
> discard the whole CPU. I found this highly unintuitive.

That's actually a very good reason!

I ended up liking your approach to refactoring more than mine after
all. So I made a couple of very small tweaks to it and I'm going to
include it mostly as-is in my v2, coming in a minute. If you have a
problem with any of my tweaks, just let me know.

-- 
Andrea Bolognani / Red Hat / Virtualization




More information about the libvir-list mailing list