• J
    libxl: implement NUMA capabilities reporting · 0192fd67
    Jim Fehlig 提交于
    From: Dario Faggioli <dario.faggioli@citrix.com>
    
    Starting from Xen 4.2, libxl has all the bits and pieces in place
    for retrieving an adequate amount of information about the host
    NUMA topology. It is therefore possible, after a bit of shuffling,
    to arrange those information in the way libvirt wants to present
    them to the outside world.
    
    Therefore, with this patch, the <topology> section of the host
    capabilities is properly populated, when running on Xen, so that
    we can figure out whether or not we're running on a NUMA host,
    and what its characteristics are.
    
    [raistlin@Zhaman ~]$ sudo virsh --connect xen:/// capabilities
    <capabilities>
      <host>
        <cpu>
        ....
        <topology>
          <cells num='2'>
            <cell id='0'>
              <memory unit='KiB'>6291456</memory>
              <cpus num='8'>
                <cpu id='0' socket_id='1' core_id='0' siblings='0-1'/>
                <cpu id='1' socket_id='1' core_id='0' siblings='0-1'/>
                <cpu id='2' socket_id='1' core_id='1' siblings='2-3'/>
                <cpu id='3' socket_id='1' core_id='1' siblings='2-3'/>
                <cpu id='4' socket_id='1' core_id='9' siblings='4-5'/>
                <cpu id='5' socket_id='1' core_id='9' siblings='4-5'/>
                <cpu id='6' socket_id='1' core_id='10' siblings='6-7'/>
                <cpu id='7' socket_id='1' core_id='10' siblings='6-7'/>
              </cpus>
            </cell>
            <cell id='1'>
              <memory unit='KiB'>6881280</memory>
              <cpus num='8'>
                <cpu id='8' socket_id='0' core_id='0' siblings='8-9'/>
                <cpu id='9' socket_id='0' core_id='0' siblings='8-9'/>
                <cpu id='10' socket_id='0' core_id='1' siblings='10-11'/>
                <cpu id='11' socket_id='0' core_id='1' siblings='10-11'/>
                <cpu id='12' socket_id='0' core_id='9' siblings='12-13'/>
                <cpu id='13' socket_id='0' core_id='9' siblings='12-13'/>
                <cpu id='14' socket_id='0' core_id='10' siblings='14-15'/>
                <cpu id='15' socket_id='0' core_id='10' siblings='14-15'/>
              </cpus>
            </cell>
          </cells>
        </topology>
      </host>
      ....
    0192fd67
libxl_conf.c 32.9 KB