403e860 conf: Pre-calculate initial memory size instead of always calculating it

Authored and Committed by Peter Krempa 8 years ago
    conf: Pre-calculate initial memory size instead of always calculating it
    
    Add 'initial_memory' member to struct virDomainMemtune so that the
    memory size can be pre-calculated once instead of inferring it always
    again and again.
    
    Separating of the fields will also allow finer granularity of decisions
    in later patches where it will allow to keep the old initial memory
    value in cases where we are handling incomming migration from older
    versions that did not always update the size from NUMA as the code did
    previously.
    
    The change also requires modification of the qemu memory alignment
    function since at the point where we are modifying the size of NUMA
    nodes the total size needs to be recalculated too.
    
    The refactoring done in this patch also fixes a crash in the hyperv
    driver that did not properly initialize def->numa and thus
    virDomainNumaGetMemorySize(def->numa) crashed.
    
    In summary this patch should have no functional impact at this point.
    
        
file modified
+32 -20
file modified
+3 -0
file modified
+1 -0
file modified
+10 -5