On Wednesday, 21 June 2017 at 10:44 PM, Martin Kletzander wrote:
You don't need to pass the whole structure of all the data. Can't theqemu function just do something like:virResctrlLock()foreach cachetune:region = virResctrlGetFreeRegion(size, type)foreach cachetune.vcpu:virResctrlSetRegion(vcpu.pid, region)
Or like with some other tuning, you can have a function that determinesthe region when given vcpu and just call it for all vcpus. You cansave the regions in the status XML, so that not only users can see it,but you can also reference them from that aforementioned function. Oryou could have saved pairs of id: region, but I think that's not needed.That reminds me, unless referred to from somewhere, the cachetunedoesn't even need the id.But basically, you don't need to pass the whole cachetune or any otherstructure. The code is very messy, check your pointers and don'tcompare references to NULLs. Read the diffs after yourself. I know itworks for you, but the code needs to be readable as well.