1. 07 3月, 2012 1 次提交
  2. 02 3月, 2012 1 次提交
  3. 30 12月, 2011 1 次提交
  4. 10 12月, 2011 1 次提交
    • S
      fix memory leak in src/nodeinfo.c · b1d6d56c
      Stefan Berger 提交于
      Fix memory leak:
      
      ==27534== 24 bytes in 1 blocks are definitely lost in loss record 207 of 530
      ==27534==    at 0x4A05E46: malloc (vg_replace_malloc.c:195)
      ==27534==    by 0x38EC26EC37: vasprintf (in /lib64/libc-2.13.so)
      ==27534==    by 0x4E998E6: virVasprintf (util.c:1677)
      ==27534==    by 0x4E999F1: virAsprintf (util.c:1695)
      ==27534==    by 0x4F1EAAC: nodeGetInfo (nodeinfo.c:593)
      ==27534==    by 0x47948F: qemuCapsInitCPU (qemu_capabilities.c:855)
      ==27534==    by 0x4796B1: qemuCapsInit (qemu_capabilities.c:915)
      ==27534==    by 0x456550: qemuCreateCapabilities (qemu_driver.c:245)
      ==27534==    by 0x4578C4: qemudStartup (qemu_driver.c:580)
      ==27534==    by 0x4F20886: virStateInitialize (libvirt.c:852)
      ==27534==    by 0x420E55: daemonRunStateInit (libvirtd.c:1156)
      ==27534==    by 0x4E94C56: virThreadHelper (threads-pthread.c:157)
      
      Mark this leaked variable as const char * when it is passed into another
      function. 
      b1d6d56c
  5. 08 12月, 2011 1 次提交
  6. 01 9月, 2011 1 次提交
    • O
      nodeinfo: Fix incorrect error codes · 03388b64
      Osier Yang 提交于
      Introduced by 5e495c8b, except the ones for checking if numa
      is supported by host, all the NO_SUPPORT are changed back. For
      the ones about numa checking, change them into INTERNAL_ERROR.
      03388b64
  7. 23 8月, 2011 1 次提交
  8. 22 7月, 2011 1 次提交
    • E
      build: rename files.h to virfile.h · 8e22e089
      Eric Blake 提交于
      In preparation for a future patch adding new virFile APIs.
      
      * src/util/files.h, src/util/files.c: Move...
      * src/util/virfile.h, src/util/virfile.c: ...here, and rename
      functions to virFile prefix.  Macro names are intentionally
      left alone.
      * *.c: All '#include "files.h"' uses changed.
      * src/Makefile.am (UTIL_SOURCES): Reflect rename.
      * cfg.mk (exclude_file_name_regexp--sc_prohibit_close): Likewise.
      * src/libvirt_private.syms: Likewise.
      * docs/hacking.html.in: Likewise.
      * HACKING: Regenerate.
      8e22e089
  9. 28 6月, 2011 1 次提交
  10. 20 6月, 2011 2 次提交
    • M
      Fix preprocessor indentation in nodeinfo.c · d967a8bf
      Matthias Bolte 提交于
      d967a8bf
    • W
      build: fix building error when building without libvirtd · 34e3ec90
      Wen Congyang 提交于
      When building libvirt without libvirtd, we will receive the following error
      message:
      
      make[3]: Entering directory `/home/wency/rpmbuild/BUILD/libvirt-0.9.2/tools'
        CC     virsh-virsh.o
        CC     virsh-console.o
        GEN    virt-xml-validate
        GEN    virt-pki-validate
        CCLD   virsh
      ./src/.libs/libvirt.so: undefined reference to `numa_available'
      ./src/.libs/libvirt.so: undefined reference to `numa_max_node'
      collect2: ld returned 1 exit status
      
      The reason is that: we check numactl only when building qemu driver, and qemu
      driver will not be built when bulding without libvirtd. So with_numactl's
      value is check and we will not link libnuma.so.
      
      In the other function, we call numa_available() and numa_max_node() only
      when HAVE_NUMACTL is 1. We should do the same check in the function nodeGetMemoryStats().
      34e3ec90
  11. 16 6月, 2011 1 次提交
  12. 15 6月, 2011 2 次提交
  13. 14 6月, 2011 1 次提交
  14. 22 4月, 2011 1 次提交
  15. 19 4月, 2011 1 次提交
  16. 17 4月, 2011 1 次提交
  17. 15 4月, 2011 2 次提交
    • E
      maint: silence cppi warnings · e6923526
      Eric Blake 提交于
      * src/nodeinfo.c (linuxNodeInfoCPUPopulate): Fix indentation of
      last patch.
      e6923526
    • S
      ppc: Enable starting of Qemu VMs on ppc host · d21f9d5a
      Stefan Berger 提交于
      Due to differences in /proc/cpuinfo the parsing of the cpu data is
      different between architectures. On PPC /proc/cpuinfo looks like this:
      
      [original formatting with tabs]
      
      processor    : 0
      cpu          : PPC970MP, altivec supported
      clock        : 2297.700000MHz
      revision     : 1.1 (pvr 0044 0101)
      
      processor    : 1
      cpu          : PPC970MP, altivec supported
      clock        : 2297.700000MHz
      revision     : 1.1 (pvr 0044 0101)
      
      [..]
      
      timebase     : 14318000
      platform     : pSeries
      model        : IBM,8844-AC1
      machine      : CHRP IBM,8844-AC1
      
      The patch adapts the parsing of the data found in /proc/cpuinfo.
      
      /sys/devices/system/cpu/cpuX/topology/physical_package_id also
      always returns -1. Check for it on ppc and make it '0' if found negative.
      d21f9d5a
  18. 24 2月, 2011 1 次提交
  19. 19 2月, 2011 1 次提交
    • M
      virsh: freecell --all getting wrong NUMA nodes count · 595174ae
      Michal Privoznik 提交于
      Virsh freecell --all was not only getting wrong NUMA nodes count, but
      even the NUMA nodes IDs. They doesn't have to be continuous, as I've
      found out during testing this. Therefore a modification of
      nodeGetCellsFreeMemory() error message.
      595174ae
  20. 21 12月, 2010 1 次提交
    • E
      tests: avoid spurious failure of nodeinfotest · bb11c553
      Eric Blake 提交于
      When running 'make check' under a multi-cpu Dom0 xen machine,
      nodeinfotest had a spurious failure it was reading from
      /sys/devices/system/cpu, but xen has no notion of topology.  The test
      was intended to be isolated from reading any real system files; the
      regression was introduced in Mar 2010 with commit aa2f6f96.
      
      Fix things by allowing an early exit for the testsuite.
      
      * src/nodeinfo.c (linuxNodeInfoCPUPopulate): Add parameter.
      (nodeGetInfo): Adjust caller.
      * tests/nodeinfotest.c (linuxTestCompareFiles): Likewise.
      bb11c553
  21. 25 11月, 2010 1 次提交
    • J
      Fix host CPU counting on unusual NUMA topologies · ac9dd4a6
      Jiri Denemark 提交于
      The nodeinfo structure includes
      
          nodes   : the number of NUMA cell, 1 for uniform mem access
          sockets : number of CPU socket per node
          cores   : number of core per socket
          threads : number of threads per core
      
      which does not work well for NUMA topologies where each node does not
      consist of integral number of CPU sockets.
      
      We also have VIR_NODEINFO_MAXCPUS macro in public libvirt.h which
      computes maximum number of CPUs as (nodes * sockets * cores * threads).
      
      As a result, we can't just change sockets to report total number of
      sockets instead of sockets per node. This would probably be the easiest
      since I doubt anyone is using the field directly. But because of the
      macro, some apps might be using sockets indirectly.
      
      This patch leaves sockets to be the number of CPU sockets per node (and
      fixes qemu driver to comply with this) on machines where sockets can be
      divided by nodes. If we can't divide sockets by nodes, we behave as if
      there was just one NUMA node containing all sockets. Apps interested in
      NUMA should consult capabilities XML, which is what they probably do
      anyway.
      
      This way, the only case in which apps that care about NUMA may break is
      on machines with funky NUMA topology. And there is a chance libvirt
      wasn't able to start any guests on those machines anyway (although it
      depends on the topology, total number of CPUs and kernel version).
      Nothing changes at all for apps that don't care about NUMA.
      ac9dd4a6
  22. 17 11月, 2010 1 次提交
    • S
      deprecate fclose() and introduce VIR_{FORCE_}FCLOSE() · 7b7cb1ec
      Stefan Berger 提交于
      Similarly to deprecating close(), I am now deprecating fclose() and
      introduce VIR_FORCE_FCLOSE() and VIR_FCLOSE(). Also, fdopen() is replaced with
      VIR_FDOPEN().
      
      Most of the files are opened in read-only mode, so usage of
      VIR_FORCE_CLOSE() seemed appropriate. Others that are opened in write
      mode already had the fclose()<  0 check and I converted those to
      VIR_FCLOSE()<  0.
      
      I did not find occurrences of possible double-closed files on the way.
      7b7cb1ec
  23. 22 9月, 2010 1 次提交
  24. 24 8月, 2010 1 次提交
    • D
      Fix handling of sparse NUMA topologies · 628c9357
      Daniel P. Berrange 提交于
      When finding a sparse NUMA topology, libnuma will return ENOENT
      the first time it is invoked. On subsequent invocations it
      will return success, but with an all-1's CPU mask. Check for
      this, to avoid polluting the capabilities XML with 4096 bogus
      CPUs
      
      * src/nodeinfo.c: Check for all-1s CPU mask
      628c9357
  25. 11 8月, 2010 1 次提交
  26. 07 5月, 2010 1 次提交
    • E
      build: use gnulib's uname · 5349cf1e
      Eric Blake 提交于
      * bootstrap.conf (gnulib_modules): Add uname.
      * configure.ac: Drop uname and sys/utsname.h checks.
      * src/nodeinfo.c (nodeGetInfo): Use uname unconditionally.
      5349cf1e
  27. 06 4月, 2010 2 次提交
  28. 15 3月, 2010 1 次提交
  29. 13 3月, 2010 1 次提交
  30. 12 3月, 2010 1 次提交
    • C
      Make nodeGetInfo report the correct number of NUMA nodes. · 83988bd4
      Chris Lalancette 提交于
      The nodeGetInfo code was always assuming that machine had a
      single NUMA node, which is not correct.  The good news is that
      libnuma gives us this information pretty easily, so let's
      properly report it.
      
      NOTE: With recent hardware starting to support CPU hot-add
      and hot-remove, both this code and the nodeCapsInitNUMA()
      code are quickly going to become obsolete.  We'll have to
      think of a more dynamic solution for dealing with NUMA
      nodes and CPUs that can come and go at will.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      83988bd4
  31. 10 3月, 2010 3 次提交
    • C
      Fix up nodeinfo parsing code. · 7be9270c
      Chris Lalancette 提交于
      As pointed out by eblake, I made a real hash of the
      nodeinfo code with commit
      aa2f6f96.  This patch
      cleans it up:
      
      1)  Do more work at compile time instead of runtime (minor)
      2)  Properly handle the hex digits that come from
      /sys/devices/system/cpu/cpu*/topology/thread_siblings
      3)  Fix up some error paths that could cause SEGV
      4)  Used unsigned's for the cpu numbers (cpu -1 doesn't
      make any sense)
      
      Along with the recent patch from jdenemar to zero out
      the nodeinfo structure, I've re-tested this on the
      machines having the problems, and it seems to be good.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      7be9270c
    • E
      build: consistently indent preprocessor directives · 36d8e7d8
      Eric Blake 提交于
      * global: patch created by running:
      for f in $(git ls-files '*.[ch]') ; do
          cppi $f > $f.t && mv $f.t $f
      done
      36d8e7d8
    • J
      Wipe nodeinfo structure before filling it · 22e39d0e
      Jiri Denemark 提交于
      The nodeinfo structure wasn't initialized in qemu driver and with the
      recent change in CPU topology parsing, old value of nodeinfo->sockets
      could be used and incremented giving totally bogus results.
      
      Let's just wipe the structure completely.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      22e39d0e
  32. 08 3月, 2010 2 次提交
    • C
      Get thread and socket information in virsh nodeinfo. · aa2f6f96
      Chris Lalancette 提交于
      The current code for "nodeinfo" is pretty naive
      about socket and thread information.  To determine the
      sockets, it just takes the number of cpus and divides
      by the number of cores.  For the thread count, it always
      sets it to 1.  With more recent Intel machines, however,
      hyperthreading is again an option, meaning that these
      heuristics no longer work and give bogus numbers.  This
      patch goes through /sys to get the additional
      information so we properly report it.
      
      Note that I had to edit the tests not to report on
      socket and thread counts, since these are determined
      dynamically now.
      
      v2: As pointed out by Eric Blake, gnulib provides
          count-one-bits (which is LGPLv2+).  Use it instead
          of a hand-coded popcnt.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      aa2f6f96
    • E
      build: consistently use C99 varargs macros · 2e56fb2b
      Eric Blake 提交于
      Prior to this patch, there was an inconsistent mix between GNU and C99.
      
      For consistency, and potential portability to other compilers, stick
      with the C99 vararg macro syntax.
      
      * src/conf/cpu_conf.c (virCPUReportError): Use C99 rather than GNU
        vararg macro syntax.
      * src/conf/domain_conf.c (virDomainReportError): Likewise.
      * src/conf/domain_event.c (eventReportError): Likewise.
      * src/conf/interface_conf.c (virInterfaceReportError): Likewise.
      * src/conf/network_conf.c (virNetworkReportError): Likewise.
      * src/conf/node_device_conf.h (virNodeDeviceReportError): Likewise.
      * src/conf/secret_conf.h (virSecretReportError): Likewise.
      * src/conf/storage_conf.h (virStorageReportError): Likewise.
      * src/esx/esx_device_monitor.c (ESX_ERROR): Use C99 rather than
        GNU vararg macro syntax.
      * src/esx/esx_driver.c (ESX_ERROR): Likewise.
      * src/esx/esx_interface_driver.c (ESX_ERROR): Likewise.
      * src/esx/esx_network_driver.c (ESX_ERROR): Likewise.
      * src/esx/esx_secret_driver.c (ESX_ERROR): Likewise.
      * src/esx/esx_storage_driver.c (ESX_ERROR): Likewise.
      * src/esx/esx_util.c (ESX_ERROR): Likewise.
      * src/esx/esx_vi.c (ESX_VI_ERROR): Likewise.
      * src/esx/esx_vi_methods.c (ESX_VI_ERROR): Likewise.
      * src/esx/esx_vi_types.c (ESX_VI_ERROR): Likewise.
      * src/esx/esx_vmx.c (ESX_ERROR): Likewise.
      * src/util/hostusb.c (usbReportError): Use C99 rather than GNU
        vararg macro syntax.
      * src/util/json.c (virJSONError): Likewise.
      * src/util/macvtap.c (ReportError): Likewise.
      * src/util/pci.c (pciReportError): Likewise.
      * src/util/stats_linux.c (virStatsError): Likewise.
      * src/util/util.c (virUtilError): Likewise.
      * src/util/xml.c (virXMLError): Likewise.
      * src/xen/proxy_internal.c (virProxyError): Use C99 rather than
        GNU vararg macro syntax.
      * src/xen/sexpr.c (virSexprError): Likewise.
      * src/xen/xen_driver.c (xenUnifiedError): Likewise.
      * src/xen/xen_hypervisor.c (virXenError): Likewise.
      * src/xen/xen_inotify.c (virXenInotifyError): Likewise.
      * src/xen/xend_internal.c (virXendError): Likewise.
      * src/xen/xm_internal.c (xenXMError): Likewise.
      * src/xen/xs_internal.c (virXenStoreError): Likewise.
      * src/cpu/cpu.h (virCPUReportError): Use C99 rather than GNU
        vararg macro syntax.
      * src/datatypes.c (virLibConnError): Likewise.
      * src/interface/netcf_driver.c (interfaceReportError): Likewise.
      * src/libvirt.c (virLibStreamError): Likewise.
      * src/lxc/lxc_conf.h (lxcError): Likewise.
      * src/network/bridge_driver.c (networkReportError): Likewise.
      * src/nodeinfo.c (nodeReportError): Likewise.
      * src/opennebula/one_conf.h (oneError): Likewise.
      * src/openvz/openvz_conf.h (openvzError): Likewise.
      * src/phyp/phyp_driver.c (PHYP_ERROR): Likewise.
      * src/qemu/qemu_conf.h (qemuReportError): Likewise.
      * src/remote/remote_driver.c (errorf): Likewise.
      * src/security/security_driver.h (virSecurityReportError): Likewise.
      * src/test/test_driver.c (testError): Likewise.
      * src/uml/uml_conf.h (umlReportError): Likewise.
      * src/vbox/vbox_driver.c (vboxError): Likewise.
      * src/vbox/vbox_tmpl.c (vboxError): Likewise.
      2e56fb2b
  33. 09 2月, 2010 1 次提交