1. 25 9月, 2014 2 次提交
  2. 24 9月, 2014 1 次提交
  3. 23 9月, 2014 2 次提交
  4. 11 9月, 2014 1 次提交
  5. 20 8月, 2014 1 次提交
    • M
      nodeCapsInitNUMA: Avoid @cpumap leak · f4c87a0c
      Michal Privoznik 提交于
      In case the host has 2 or more NUMA nodes, we fetch CPU map for each
      node. However, we need to free the CPU map in between loops:
      
      ==29513== 96 (72 direct, 24 indirect) bytes in 3 blocks are definitely lost in loss record 951 of 1,264
      ==29513==    at 0x4C2A700: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==29513==    by 0x52AD24B: virAlloc (viralloc.c:144)
      ==29513==    by 0x52AF0E6: virBitmapNew (virbitmap.c:78)
      ==29513==    by 0x52FB720: virNumaGetNodeCPUs (virnuma.c:294)
      ==29513==    by 0x53C700B: nodeCapsInitNUMA (nodeinfo.c:1886)
      ==29513==    by 0x11759708: vboxCapsInit (vbox_common.c:398)
      ==29513==    by 0x11759CC4: vboxConnectOpen (vbox_common.c:514)
      ==29513==    by 0x53C965F: do_open (libvirt.c:1147)
      ==29513==    by 0x53C9EBC: virConnectOpen (libvirt.c:1317)
      ==29513==    by 0x142905: remoteDispatchConnectOpen (remote.c:1215)
      ==29513==    by 0x126ADF: remoteDispatchConnectOpenHelper (remote_dispatch.h:2346)
      ==29513==    by 0x5453D21: virNetServerProgramDispatchCall (virnetserverprogram.c:437)
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      f4c87a0c
  6. 24 6月, 2014 1 次提交
    • M
      virNumaGetPageInfo: Take huge pages into account · 3499eedd
      Michal Privoznik 提交于
      On the Linux kernel, if huge pages are allocated the size they cut off
      from memory is accounted under the 'MemUsed' in the meminfo file.
      However, we want the sum to be subtracted from 'MemTotal'. This patch
      implements this feature. After this change, we can enable reporting
      of the ordinary system pages in the capability XML:
      
      <capabilities>
      
        <host>
          <uuid>01281cda-f352-cb11-a9db-e905fe22010c</uuid>
          <cpu>
            <arch>x86_64</arch>
            <model>Haswell</model>
            <vendor>Intel</vendor>
            <topology sockets='1' cores='1' threads='1'/>
            <feature/>
            <pages unit='KiB' size='4'/>
            <pages unit='KiB' size='2048'/>
            <pages unit='KiB' size='1048576'/>
          </cpu>
          <power_management/>
          <migration_features/>
          <topology>
            <cells num='4'>
              <cell id='0'>
                <memory unit='KiB'>4048248</memory>
                <pages unit='KiB' size='4'>748382</pages>
                <pages unit='KiB' size='2048'>3</pages>
                <pages unit='KiB' size='1048576'>1</pages>
                <distances/>
                <cpus num='1'>
                  <cpu id='0' socket_id='0' core_id='0' siblings='0'/>
                </cpus>
              </cell>
              ...
            </cells>
          </topology>
        </host>
      </capabilities>
      
      You can see the beautiful thing about this: if you sum up all the
      <pages/> you'll get <memory/>.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      3499eedd
  7. 20 6月, 2014 3 次提交
  8. 19 6月, 2014 3 次提交
    • M
      nodeinfo: Implement nodeGetFreePages · 38fa03f4
      Michal Privoznik 提交于
      And add stubs to other drivers like: lxc, qemu, uml and vbox.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      38fa03f4
    • M
      virCaps: expose pages info · 02129b7c
      Michal Privoznik 提交于
      There are two places where you'll find info on page sizes. The first
      one is under <cpu/> element, where all supported pages sizes are
      listed. Then the second one is under each <cell/> element which refers
      to concrete NUMA node. At this place, the size of page's pool is
      reported. So the capabilities XML looks something like this:
      
      <capabilities>
      
        <host>
          <uuid>01281cda-f352-cb11-a9db-e905fe22010c</uuid>
          <cpu>
            <arch>x86_64</arch>
            <model>Westmere</model>
            <vendor>Intel</vendor>
            <topology sockets='1' cores='1' threads='1'/>
            ...
            <pages unit='KiB' size='4'/>
            <pages unit='KiB' size='2048'/>
            <pages unit='KiB' size='1048576'/>
          </cpu>
          ...
          <topology>
            <cells num='4'>
              <cell id='0'>
                <memory unit='KiB'>4054408</memory>
                <pages unit='KiB' size='4'>1013602</pages>
                <pages unit='KiB' size='2048'>3</pages>
                <pages unit='KiB' size='1048576'>1</pages>
                <distances/>
                <cpus num='1'>
                  <cpu id='0' socket_id='0' core_id='0' siblings='0'/>
                </cpus>
              </cell>
              <cell id='1'>
                <memory unit='KiB'>4071072</memory>
                <pages unit='KiB' size='4'>1017768</pages>
                <pages unit='KiB' size='2048'>3</pages>
                <pages unit='KiB' size='1048576'>1</pages>
                <distances/>
                <cpus num='1'>
                  <cpu id='1' socket_id='0' core_id='0' siblings='1'/>
                </cpus>
              </cell>
              ...
            </cells>
          </topology>
          ...
        </host>
      
        <guest/>
      
      </capabilities>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      02129b7c
    • M
      nodeinfo: Rename nodeGetFreeMemory to nodeGetMemory · 99a63aed
      Michal Privoznik 提交于
      For future work we want to get info for not only the free memory
      but overall memory size too. That's why the function must have
      new signature too.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      99a63aed
  9. 11 6月, 2014 1 次提交
    • E
      nodeinfo: avoid uninitialized variable on error · 10c10f43
      Eric Blake 提交于
      Commit 8ba0a58f introduced a compiler warning that I hit during
      a run of ./autobuild.sh:
      
      ../../src/nodeinfo.c: In function 'nodeCapsInitNUMA':
      ../../src/nodeinfo.c:1853:43: error: 'nsiblings' may be used uninitialized in this function [-Werror=maybe-uninitialized]
               if (virCapabilitiesAddHostNUMACell(caps, n, memory,
                                                 ^
      
      Sure enough, nsiblings starts uninitialized, and is set by a call
      to virNodeCapsGetSiblingInfo, but that function fails to assign
      through the pointer if virNumaGetDistances fails.
      
      * src/nodeinfo.c (nodeCapsInitNUMA): Initialize nsiblings.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      10c10f43
  10. 04 6月, 2014 1 次提交
    • M
      virCaps: Expose distance between host NUMA nodes · 8ba0a58f
      Michal Privoznik 提交于
      If user or management application wants to create a guest,
      it may be useful to know the cost of internode latencies
      before the guest resources are pinned. For example:
      
      <capabilities>
      
        <host>
          ...
          <topology>
            <cells num='2'>
              <cell id='0'>
                <memory unit='KiB'>4004132</memory>
                <distances>
                  <sibling id='0' value='10'/>
                  <sibling id='1' value='20'/>
                </distances>
                <cpus num='2'>
                  <cpu id='0' socket_id='0' core_id='0' siblings='0'/>
                  <cpu id='2' socket_id='0' core_id='2' siblings='2'/>
                </cpus>
              </cell>
              <cell id='1'>
                <memory unit='KiB'>4030064</memory>
                <distances>
                  <sibling id='0' value='20'/>
                  <sibling id='1' value='10'/>
                </distances>
                <cpus num='2'>
                  <cpu id='1' socket_id='0' core_id='0' siblings='1'/>
                  <cpu id='3' socket_id='0' core_id='2' siblings='3'/>
                </cpus>
              </cell>
            </cells>
          </topology>
          ...
        </host>
        ...
      </capabilities>
      
      We can see the distance from node1 to node0 is 20 and within nodes 10.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      8ba0a58f
  11. 29 4月, 2014 1 次提交
  12. 25 3月, 2014 1 次提交
  13. 20 3月, 2014 1 次提交
    • W
      bhyve: host API support · bc93c34e
      Wojciech Macek 提交于
      New functionalities:
      - connectGetMaxVcpus - on bhyve hardcode this value to 16
      - nodeGetFreeMemory - do not use physmem_get on FreeBSD, since
                            it might get wrong value on systems with
                            more than 100GB of RAM
      - nodeGetCPUMap - wrapper only for mapping function, currently not
                        supported by FreeBSD
      - nodeSet/GetMemoryParameters - wrapper only for future improvements,
                                      currently not supported by FreeBSD
      bc93c34e
  14. 18 3月, 2014 1 次提交
  15. 06 2月, 2014 1 次提交
  16. 01 2月, 2014 1 次提交
    • J
      Resolve Coverity dead_error_begin · 5c36e631
      John Ferlan 提交于
      Coverity complains about default: label in libxl_driver.c not be able
      to be reached. It's by design for the code and since it's not necessary
      in the code nor does it elicit any compiler/make check warnings - just
      remove it rather than adding a coverity[dead_error_begin] tag.
      
      While I'm at it, lxc_driver.c and nodeinfo.c have the same design, so I
      removed the default labels and the existing coverity tags.
      5c36e631
  17. 28 1月, 2014 2 次提交
  18. 27 1月, 2014 2 次提交
  19. 23 1月, 2014 1 次提交
  20. 22 1月, 2014 1 次提交
    • B
      linuxNodeGetCPUStats: Correctly handle cpu prefix · 94f82053
      Bing Bu Cao 提交于
      To retrieve node cpu statistics on Linux system, the
      linuxNodeGetCPUstats function simply uses STRPREFIX() to match the cpuid
      with the one read from /proc/stat. However, as the file is read line by
      line it may happen, that some CPUs share the same prefix. So if user
      requested stats for the first CPU, which is offline, then there's no
      cpu1 in the stats file so the one that we match is cpu10. Which is
      obviously wrong. Fortunately, the IDs are terminated by a space, so we
      can utilize that.
      Signed-off-by: NBing Bu Cao <mars@linux.vnet.ibm.com>
      94f82053
  21. 07 1月, 2014 1 次提交
  22. 07 11月, 2013 1 次提交
    • E
      nodeinfo: fix build on non-Linux · adb44955
      Eric Blake 提交于
      Commit b0f85462 broke the build on mingw, by exposing code that
      had Linux-specific dependencies but which was previously protected
      by libnuma ifdef guards:
      
      make[3]: Entering directory `/home/eblake/libvirt-tmp/build/src'
        CC       libvirt_driver_la-nodeinfo.lo
      ../../src/nodeinfo.c: In function 'virNodeGetSiblingsList':
      ../../src/nodeinfo.c:1543:30: error: 'SYSFS_THREAD_SIBLINGS_LIST_LENGTH_MAX' undeclared (first use in this function)
           if (virFileReadAll(path, SYSFS_THREAD_SIBLINGS_LIST_LENGTH_MAX, &buf) < 0)
                                    ^
      ../../src/nodeinfo.c:1543:30: note: each undeclared identifier is reported only once for each function it appears in
      ../../src/nodeinfo.c: In function 'virNodeCapsFillCPUInfo':
      ../../src/nodeinfo.c:1562:5: error: implicit declaration of function 'virNodeGetCpuValue' [-Werror=implicit-function-declaration]
           if ((tmp = virNodeGetCpuValue(SYSFS_CPU_PATH, cpu_id,
           ^
      ../../src/nodeinfo.c:1562:5: error: nested extern declaration of 'virNodeGetCpuValue' [-Werror=nested-externs]
      ../../src/nodeinfo.c:1562:35: error: 'SYSFS_CPU_PATH' undeclared (first use in this function)
           if ((tmp = virNodeGetCpuValue(SYSFS_CPU_PATH, cpu_id,
                                         ^
      cc1: all warnings being treated as errors
      
      * src/nodeinfo.c (virNodeCapsFillCPUInfo): Make conditional.
      (virNodeGetSiblingsList): Move into #ifdef linux block.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      adb44955
  23. 04 11月, 2013 8 次提交
  24. 22 10月, 2013 1 次提交
  25. 16 10月, 2013 1 次提交