1. 18 4月, 2013 1 次提交
  2. 11 2月, 2013 1 次提交
  3. 08 2月, 2013 1 次提交
  4. 30 1月, 2013 1 次提交
    • M
      docs: aesthetical cleanups · 901f4b6b
      Martin Kletzander 提交于
      Adding dots inside "exempli gratia" where missing.  While on that, I
      took the liberty of changing it where found with simple grep.
      901f4b6b
  5. 14 1月, 2013 1 次提交
    • D
      Add a test suite for validating SELinux labelling · 907a39e7
      Daniel P. Berrange 提交于
      There are many aspects of the guest XML which result in the
      SELinux driver applying file labelling. With the increasing
      configuration options it is desirable to test this behaviour.
      It is not possible to assume that the test suite has the
      ability to set SELinux labels. Most filesystems though will
      support extended attributes. Thus for the purpose of testing,
      it is possible to extend the existing LD_PRELOAD hack to
      override setfilecon() and getfilecon() to simply use the
      'user.libvirt.selinux' attribute for the sake of testing.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      907a39e7
  6. 12 1月, 2013 2 次提交
  7. 02 11月, 2012 1 次提交
    • D
      Document bracket whitespace rules & add syntax-check rule · a3e95abe
      Daniel P. Berrange 提交于
      This documents the following whitespace rules
      
            if(foo)   // Bad
            if (foo)  // Good
      
            int foo (int wizz)  // Bad
            int foo(int wizz)   // Good
      
            bar = foo (wizz);  // Bad
            bar = foo(wizz);   // Good
      
            typedef int (*foo) (int wizz);  // Bad
            typedef int (*foo)(int wizz);   // Good
      
            int foo( int wizz );  // Bad
            int foo(int wizz);    // Good
      
      There is a syntax-check rule extension to validate all these rules.
      Checking for 'function (...args...)' is quite difficult since it
      needs to ignore valid usage with keywords like 'if (...test...)'
      and while/for/switch. It must also ignore source comments and
      quoted strings.
      
      It is not possible todo this with a simple regex in the normal
      syntax-check style. So a short Perl script is created instead
      to analyse the source. In practice this works well enough. The
      only thing it can't cope with is multi-line quoted strings of
      the form
      
       "start of string\
      more lines\
      more line\
      the end"
      
      but this can and should be written as
      
       "start of string"
       "more lines"
       "more line"
       "the end"
      
      with this simple change, the bracket checking script does not
      have any false positives across libvirt source, provided it
      is only run against .c files. It is not practical to run it
      against .h files, since those use whitespace extensively to
      get alignment (though this is somewhat inconsistent and could
      arguably be fixed).
      
      The only limitation is that it cannot detect a violation where
      the first arg starts with a '*', eg
      
         foo(*wizz);
      
      since this generates too many false positives on function
      typedefs which can't be supressed efficiently.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      a3e95abe
  8. 12 10月, 2012 1 次提交
  9. 25 9月, 2012 1 次提交
  10. 12 9月, 2012 1 次提交
  11. 09 9月, 2012 1 次提交
    • L
      docs: point out git send-email location, be more stern about make check · 70383229
      Laine Stump 提交于
      An email came to libvir-list wondering why the git send-email command
      was missing in spite of having git installed; this is due to the
      send-email command being in a sub-package of the main git package.
      
      While touching the hacking file, I thought it would be useful to 1)
      indicate the location of the source (docs/hacking.html.in) in the
      message at the top of HACKING, and also to make the note about running
      "make check" and "make syntax-check" a bit more stern.
      70383229
  12. 16 7月, 2012 1 次提交
  13. 06 10月, 2011 1 次提交
  14. 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
  15. 06 5月, 2011 1 次提交
    • E
      maint: rename virBufferVSprintf to virBufferAsprintf · 68ea80cf
      Eric Blake 提交于
      We already have virAsprintf, so picking a similar name helps for
      seeing a similar purpose.  Furthermore, the prefix V before printf
      generally implies 'va_list', even though this variant was '...', and
      the old name got in the way of adding a new va_list version.
      
      global rename performed with:
      
      $ git grep -l virBufferVSprintf \
        | xargs -L1 sed -i 's/virBufferVSprintf/virBufferAsprintf/g'
      
      then revert the changes in ChangeLog-old.
      68ea80cf
  16. 31 3月, 2011 1 次提交
    • E
      docs: mention C89 syntax preferences · 06732e1a
      Eric Blake 提交于
      * docs/hacking.html.in (Code formatting): Document that // comment
      and declaration-after-statement are discouraged.
      * HACKING: Regenerate.
      06732e1a
  17. 18 3月, 2011 1 次提交
  18. 06 1月, 2011 1 次提交
  19. 26 11月, 2010 1 次提交
  20. 23 11月, 2010 1 次提交
  21. 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
  22. 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
  23. 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
  24. 13 11月, 2010 1 次提交
  25. 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
  26. 04 5月, 2010 1 次提交
  27. 10 3月, 2010 4 次提交
  28. 09 2月, 2010 1 次提交
  29. 05 2月, 2010 1 次提交
  30. 30 1月, 2010 1 次提交
  31. 09 1月, 2010 1 次提交
  32. 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
  33. 21 10月, 2009 1 次提交
    • C
      tests: Centralize VIR_TEST_DEBUG lookup, and document it · 9710856b
      Cole Robinson 提交于
      Provide a simple interface for other tests to lookup the testDebug variable.
      Also remove a redundant error message in interface tests.
      
      If anyone feels inclined to change this env variable to match the existing
      LIBVIRT_* format, it should now be easier to do so.
      9710856b
  34. 23 9月, 2009 1 次提交
    • C
      Introduce virStrncpy. · 03d777f3
      Chris Lalancette 提交于
      Add the virStrncpy function, which takes a dst string, source string,
      the number of bytes to copy and the number of bytes available in the
      dest string.  If the source string is too large to fit into the
      destination string, including the \0 byte, then no data is copied and
      the function returns NULL.  Otherwise, this function copies n bytes
      from source into dst, including the \0, and returns a pointer to the
      dst string.  This function is intended to replace all unsafe uses
      of strncpy in the code base, since strncpy does *not* guarantee that
      the buffer terminates with a \0.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      03d777f3
  35. 23 7月, 2009 1 次提交
    • D
      Fix misc Win32 compile warnings · 899ae0d2
      Daniel P. Berrange 提交于
      GCC >= 4.4 assumes the 'printf' attribute refers to the native
      runtime libraries format specifiers. Thanks to gnulib, libvirt
      has GNU format specifiers everywhere.  This means we need to
      use 'gnu_printf' with GCC >= 4.4 to get correct compiler
      checking of printf format specifiers.
      
      * HACKING: Document new rules for ATTRIBUTE_FMT_PRINTF
      * autobuild.sh, mingw32-libvirt.spec.in: Disable OpenNebula
        driver on mingw32 builds
      * qemud/dispatch.h, qemud/qemu.h, src/buf.h src/internal.h,
        src/logging.h, src/security.h, src/sexpr.h, src/util.h,
        src/virterror_internal.h, src/xend_internal.c: Change
        over to ATTRIBUTE_FMT_PRINTF.
      * src/virsh.c: Disable 'cd' and 'pwd' commands on Win32
        since they don't compile
      * src/threads-win32.c: Add missing return value check
      899ae0d2