f8e9deb qemuBuildMemoryBackendStr: Fix hugepages lookup process

Authored and Committed by mprivozn 8 years ago
    qemuBuildMemoryBackendStr: Fix hugepages lookup process
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1196644
    
    This function constructs the backend (host facing) part of the
    memory device.  At the beginning, the configured hugepages are
    searched to find the best match for given guest NUMA node.
    Configured hugepages can have a @nodeset attribute to specify on
    which guest NUMA nodes should be the hugepages backing used.
    There is, however, one 'corner case'. Users may just tell 'use
    hugepages to back all the nodes'. In other words:
    
      <memoryBacking>
        <hugepages/>
      </memoryBacking>
    
      <cpu>
        <numa>
          <cell id='0' cpus='0-1' memory='1024000' unit='KiB'/>
        </numa>
      </cpu>
    
    Our code fails in this case. Well, since there's no @nodeset (nor
    any <page/> child element to <hugepages/>) we fail to lookup the
    default hugepage size to use.
    
    Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
    
        
file modified
+20 -15
file modified
+8 -0