1. 19 11月, 2010 2 次提交
    • E
      memory: make it easier to avoid quadratic scaling of arrays · 269d3b72
      Eric Blake 提交于
      * src/util/memory.h (VIR_RESIZE_N): New macro.
      * src/util/memory.c (virResizeN): New function.
      * src/libvirt_private.syms: Export new helper.
      * docs/hacking.html.in: Document it.
      * HACKING: Regenerate.
      269d3b72
    • E
      memory: make it safer to expand arrays · 5a0beacc
      Eric Blake 提交于
      * src/util/memory.h (VIR_REALLOC_N): Update docs.
      (VIR_EXPAND_N, VIR_SHRINK_N): New macros.
      (virAlloc, virAllocN, virReallocN, virAllocVar, virFree): Add some
      gcc attributes.
      * src/util/memory.c (virExpandN, virShrinkN): New functions.
      (virReallocN): Update docs.
      * src/libvirt_private.syms: Export new helpers.
      * docs/hacking.html.in: Prefer newer interfaces over
      VIR_REALLOC_N, since uninitialized memory can bite us.
      * HACKING: Regenerate.
      5a0beacc
  2. 18 11月, 2010 1 次提交
    • E
      maint: avoid remaining sprintf uses · e8aba782
      Eric Blake 提交于
      * cfg.mk (sc_prohibit_sprintf): New rule.
      (sc_prohibit_asprintf): Avoid false positives.
      * docs/hacking.html.in (Printf-style functions): Document the
      policy.
      * HACKING: Regenerate.
      * .x-sc_prohibit_sprintf: New exemptions.
      * Makefile.am (syntax_check_exceptions): Ship new file.
      * src/vbox/vbox_tmpl.c (vboxStartMachine, vboxAttachUSB): Use
      virAsprintf instead.
      * src/uml/uml_driver.c (umlOpenMonitor): Use snprintf instead.
      * tools/virsh.c (cmdDetachInterface): Likewise.
      * src/security/security_selinux.c (SELinuxGenSecurityLabel):
      Likewise.
      * src/openvz/openvz_driver.c (openvzDomainDefineCmd): Likewise,
      and ensure large enough buffer.
      e8aba782
  3. 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
  4. 13 11月, 2010 1 次提交
  5. 19 10月, 2010 1 次提交
    • S
      Introduce VIR_CLOSE to be used rather than close() · f04de501
      Stefan Berger 提交于
      Since bugs due to double-closed file descriptors are difficult to track down in a multi-threaded system, I am introducing the VIR_CLOSE(fd) macro to help avoid mistakes here.
      
      There are lots of places where close() is being used. In this patch I am only cleaning up usage of close() in src/conf where the problems were.
      
      I also dare to declare close() as being deprecated in libvirt code base (HACKING).
      f04de501
  6. 04 5月, 2010 1 次提交
  7. 18 3月, 2010 1 次提交
  8. 10 3月, 2010 3 次提交
  9. 08 3月, 2010 1 次提交
  10. 09 2月, 2010 1 次提交
  11. 05 2月, 2010 1 次提交
  12. 30 1月, 2010 1 次提交
  13. 09 1月, 2010 1 次提交
  14. 10 12月, 2009 1 次提交
    • M
      Add virBufferFreeAndReset() and replace free() · 1b9d0744
      Matthias Bolte 提交于
      Replace free(virBufferContentAndReset()) with virBufferFreeAndReset().
      Update documentation and replace all remaining calls to free() with
      calls to VIR_FREE(). Also add missing calls to virBufferFreeAndReset()
      and virReportOOMError() in OOM error cases.
      1b9d0744
  15. 06 11月, 2009 1 次提交
    • M
      Cleanup whitespace in docs · c6d5ac17
      Matthew Booth 提交于
      This patch is the result of running the following command in the docs
      directory: sed -i 's/\t/        /g; s/\s*$//' *.html.in
      
      * docs/*.html.in:convert tabs into 8 spaces and remove trailing whitespace
      c6d5ac17
  16. 29 6月, 2009 1 次提交