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

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

 



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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux