On Sat, Jan 16, 2016 at 10:22:13 -0500, John Ferlan wrote: > > > On 01/14/2016 11:26 AM, Peter Krempa wrote: > > Iterate over all cpus skipping inactive ones. > > --- > > src/qemu/qemu_driver.c | 15 ++++++++++++--- > > 1 file changed, 12 insertions(+), 3 deletions(-) > > > > Patch 7 introduces virDomainDefGetVcpumap (or GetOnlineVcpuMap) - why > not use that instead and then iterate the set bits. This works, but the > less places that check for vcpu->online perhaps the better. Perhaps also > a way to reduce the decision points of using ->maxvcpus or the > virDomainDefGetVcpusMax call... That would end up in two cases: 1) The bitmap would be recalculated before every use. This increases complexity twofold since the function iterates the list once to assemble the bitmap and then you iterate the bitmap to get the objects. 2) The bitmap would need to be stored persistently This again introduces two different places where data has to be stored. It either then will require us to keep it in sync the two places or remove one and the def->vcpus and def->vcpumap would need to be used in parallel always. I don't like either of those since the target was to remove two places storing data about one object. Peter
Attachment:
signature.asc
Description: Digital signature
-- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list