1. 22 7月, 2015 7 次提交
  2. 20 7月, 2015 1 次提交
    • R
      nodeinfo: fix build on FreeBSD · e46791e0
      Roman Bogorodskiy 提交于
      Currently, build fails on FreeBSD with:
      
        CC       libvirt_driver_la-nodeinfo.lo
      nodeinfo.c:1941:56: error: use of undeclared identifier 'SYSFS_SYSTEM_PATH'
          const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SYSTEM_PATH;
                                                             ^
      1 error generated.
      
      This is caused by commit b97b3048 that added sysfs_prefix to
      nodeCapsInitNUMA and used SYSFS_CPU_PATH.
      
      Fix it by unconditionally defining SYSFS_CPU_PATH instead of defining it
      under #ifdef __linux__.
      e46791e0
  3. 15 7月, 2015 2 次提交
    • A
      nodeinfo: Formatting changes · aa6c3fee
      Andrea Bolognani 提交于
      aa6c3fee
    • A
      nodeinfo: Make sysfs_prefix usage more consistent · 75f6f545
      Andrea Bolognani 提交于
      Make sure sysfs_prefix, when present, is always the first argument
      to a function; don't use a different name to refer to it; check
      whether it is NULL, and hence SYSFS_SYSTEM_PATH should be used, only
      when using it directly and not just passing it down to another
      function; always pass down the same value we've been passed when
      calling another function.
      75f6f545
  4. 14 7月, 2015 9 次提交
  5. 02 6月, 2015 2 次提交
  6. 28 5月, 2015 1 次提交
  7. 27 3月, 2015 1 次提交
    • W
      nodeinfo: Increase the num of CPU thread siblings to a larger value · c13de016
      Wei Huang 提交于
      Current libvirt can only handle up to 1023 bytes when it
      reads Linux sysfs topology/thread_siblings. This isn't enough for
      Linux distributions that support a large value. This patch fixes
      the problem by using VIR_ALLOC()/VIR_FREE(), instead of using a
      fixed-size (1024) local char array. In the meanwhile
      SYSFS_THREAD_SIBLINGS_LIST_LENGTH_MAX is increased to 8192 which
      should be large enough for a foreseeable future.
      Signed-off-by: NWei Huang <wei@redhat.com>
      c13de016
  8. 13 3月, 2015 1 次提交
    • J
      Introduce virBitmapIsBitSet · 22fd3ac3
      Ján Tomko 提交于
      A helper that never returns an error and treats bits out of bitmap range
      as false.
      
      Use it everywhere we use ignore_value on virBitmapGetBit, or loop over
      the bitmap size.
      22fd3ac3
  9. 23 1月, 2015 1 次提交
    • J
      Fix virCgroupGetPercpuStats with non-continuous present CPUs · af1c98e4
      Ján Tomko 提交于
      Per-cpu stats are only shown for present CPUs in the cgroups,
      but we were only parsing the largest CPU number from
      /sys/devices/system/cpu/present and looking for stats even for
      non-present CPUs.
      This resulted in:
      internal error: cpuacct parse error
      af1c98e4
  10. 10 11月, 2014 1 次提交
  11. 25 9月, 2014 2 次提交
  12. 24 9月, 2014 1 次提交
  13. 23 9月, 2014 2 次提交
  14. 11 9月, 2014 1 次提交
  15. 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
  16. 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
  17. 20 6月, 2014 3 次提交
  18. 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