1. 04 1月, 2017 1 次提交
    • A
      HACKING: Regenerate · d39e3b71
      Andrea Bolognani 提交于
      When updating the source file in commit bd4f4d16, I forgot
      that we also store the generated plain text version in git and
      didn't regenerate it.
      
      I also missed one spot that required an additional <p> tag, so
      fix both mistakes in one go.
      d39e3b71
  2. 02 7月, 2016 1 次提交
  3. 14 5月, 2016 1 次提交
    • M
      virtestmock: Print invalid file accesses into a file · 6326865e
      Michal Privoznik 提交于
      All the accesses to files outside our build or source directories
      are now identified and appended into a file for later processing.
      The location of the file that contains all the records can be
      controlled via VIR_TEST_FILE_ACCESS env variable and defaults to
      abs_builddir "/test_file_access.txt".
      
      The script that will process the access file is to be added in
      next commit.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      6326865e
  4. 11 6月, 2015 1 次提交
  5. 24 4月, 2015 1 次提交
    • C
      tests: Add VIR_TEST_REGENERATE_OUTPUT · edb27a70
      Cole Robinson 提交于
      If this enviroment variable is set, the virTestCompareToFile helper
      will overwrite the file content we are comparing against, if the
      file doesn't exist or it doesn't match the expected input.
      
      This is useful when adding new test cases, or making changes that
      generate a lot of output churn.
      edb27a70
  6. 10 12月, 2014 1 次提交
  7. 08 12月, 2014 1 次提交
  8. 15 11月, 2014 1 次提交
  9. 22 10月, 2014 1 次提交
  10. 21 10月, 2014 1 次提交
  11. 05 9月, 2014 1 次提交
    • E
      maint: tighten curly brace syntax checking · bc7e63d3
      Eric Blake 提交于
      Now that hanging brace offenders have been fixed, we can automate
      the check, and document our style.  Done as a separate commit from
      code changes, to make it easier to just backport code changes, if
      that is ever needed.
      
      * cfg.mk (sc_curly_braces_style): Catch hanging braces.
      * docs/hacking.html.in: Document it.
      * HACKING: Regenerate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      bc7e63d3
  12. 22 8月, 2014 1 次提交
  13. 05 7月, 2014 1 次提交
  14. 03 7月, 2014 1 次提交
    • J
      Introduce virBufferCheckError · 058d89b9
      Ján Tomko 提交于
      Check if the buffer is in error state and report an error if it is.
      
      This replaces the pattern:
      if (virBufferError(buf)) {
          virReportOOMError();
          goto cleanup;
      }
      with:
      
      if (virBufferCheckError(buf) < 0)
          goto cleanup;
      
      Document typical buffer usage to favor this.
      Also remove the redundant FreeAndReset - if an error has
      been set via virBufferSetError, the content is already freed.
      058d89b9
  15. 10 6月, 2014 1 次提交
  16. 25 3月, 2014 1 次提交
  17. 21 11月, 2013 1 次提交
  18. 07 10月, 2013 1 次提交
  19. 13 8月, 2013 2 次提交
    • E
      docs: mention VIR_TEST_RANGE · 70547bac
      Eric Blake 提交于
      Commit ab92ae33 added a cool feature, but didn't document it.
      
      * docs/hacking.html.in: Document debugging a subset of tests.
      * HACKING: Regenerate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      70547bac
    • E
      build: add configure option to disable gnulib tests · 70363ea9
      Eric Blake 提交于
      The gnulib testsuite is relatively stable - the only times it is
      likely to have a test change from pass to fail is on a gnulib
      submodule update or a major system change (such as moving from
      Fedora 18 to 19, or other large change to libc).  While it is an
      important test for end users on arbitrary machines (to make sure
      that the portability glue works for their machine), it mostly
      wastes time for development testing (as most developers aren't
      making any of the major changes that would cause gnulib tests
      to alter behavior).  Thus, it pays to make the tests optional
      at configure time, defaulting to off for development, on for
      tarballs, with autobuilders requesting it to be on.  It also
      helps to allow a make-time override, via VIR_TEST_EXPENSIVE=[01]
      (much the way automake sets up V=[01] for overriding the configure
      time default of how verbose to be).
      
      Automake has some pretty hard-coded magic with regards to the
      TESTS variable; I had quite a job figuring out how to keep
      'make distcheck' passing regardless of the configure option
      setting in use, while still disabling the tests at runtime
      when I did not configure them on and did not use the override
      variable.  Thankfully, we require GNU make, which lets me
      hide some information from Automake's magic handling of TESTS.
      
      * bootstrap.conf (bootstrap_epilogue): Munge gnulib test variable.
      * configure.ac (--enable-expensive-tests): Add new enable switch.
      (VIR_TEST_EXPENSIVE_DEFAULT, WITH_EXPENSIVE_TESTS): Set new
      witnesses.
      * gnulib/tests/Makefile.am (TESTS): Make tests conditional on
      configure settings and the VIR_TEST_EXPENSIVE variable.
      * tests/Makefile.am (TESTS_ENVIRONMENT): Expose VIR_TEST_EXPENSIVE
      to all tests.
      * autobuild.sh: Enable all tests during autobuilds.
      * libvirt.spec.in (%configure): Likewise.
      * mingw-libvirt.spec.in (%mingw_configure): Likewise.
      * docs/hacking.html.in: Document the option.
      * HACKING: Regenerate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      70363ea9
  20. 30 7月, 2013 1 次提交
  21. 10 7月, 2013 3 次提交
    • M
      Adapt to VIR_ALLOC and virAsprintf in docs/ · 9021488a
      Michal Privoznik 提交于
      9021488a
    • E
      build: honor autogen.sh --no-git · 1e503ee5
      Eric Blake 提交于
      Based on a report by Chandrashekar Shastri, at
      https://bugzilla.redhat.com/show_bug.cgi?id=979360
      
      On systems where git cannot access the outside world, a developer
      can instead arrange to get a copy of gnulib at the right commit
      via side channels (such as NFS share drives), set GNULIB_SRCDIR,
      then use ./autogen.sh --no-git.  In this setup, we will now
      avoid direct use of git.  Of course, this means no automatic
      gnulib updates when libvirt.git updates its submodule, but it
      is expected that any developer in such a situation is already
      prepared to deal with the fallout.
      
      * .gnulib: Update to latest, for bootstrap.
      * bootstrap: Synchronize from gnulib.
      * autogen.sh (no_git): Avoid git when requested.
      * cfg.mk (_update_required): Skip automatic rerun of bootstrap if
      we can't use git.
      * docs/compiling.html.in: Document this setup.
      * docs/hacking.html.in: Mention this.
      * HACKING: Regenerate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      1e503ee5
    • E
      maint: tweak use of <a> in HACKING · 040d3f77
      Eric Blake 提交于
      The previous handling of <a> tags led to some less-than-ideal
      layout in HACKING (most noticeable on a mid-sentence reference
      to the valgrind home page).
      
      * docs/hacking.html.in: Slight tweaks to <a> tags.
      * docs/hacking1.xsl: Move <a> handling...
      * docs/hacking2.xsl: ...here.
      * HACKING: Regenerate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      040d3f77
  22. 28 5月, 2013 1 次提交
  23. 08 5月, 2013 2 次提交
    • E
      string: make VIR_STRDUP easier to use · 6b74a9f5
      Eric Blake 提交于
      While reviewing proposed VIR_STRDUP conversions, I've already noticed
      several places that do:
      
      if (str && VIR_STRDUP(dest, str) < 0)
      
      which can be simplified by allowing str to be NULL (something that
      strdup() doesn't allow).  Meanwhile, code that wants to ensure a
      non-NULL dest regardless of the source can check for <= 0.
      
      Also, make it part of the VIR_STRDUP contract that macro arguments
      are evaluated exactly once.
      
      * src/util/virstring.h (VIR_STRDUP, VIR_STRDUP_QUIET, VIR_STRNDUP)
      (VIR_STRNDUP_QUIET): Improve contract.
      * src/util/virstring.c (virStrdup, virStrndup): Change return
      conventions.
      * docs/hacking.html.in: Document this.
      * HACKING: Regenerate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      6b74a9f5
    • E
      alloc: make VIR_APPEND_ELEMENT safer · ddcfc549
      Eric Blake 提交于
      VIR_APPEND_ELEMENT(array, size, elem) was not safe if the expression
      for 'size' had side effects.  While no one in the current code base
      was trying to pass side effects, we might as well be robust and
      explicitly document our intentions.
      
      * src/util/viralloc.c (virInsertElementsN): Add special case.
      * src/util/viralloc.h (VIR_APPEND_ELEMENT): Use it.
      (VIR_ALLOC, VIR_ALLOC_N, VIR_REALLOC_N, VIR_EXPAND_N)
      (VIR_RESIZE_N, VIR_SHRINK_N, VIR_INSERT_ELEMENT)
      (VIR_DELETE_ELEMENT, VIR_ALLOC_VAR, VIR_FREE): Document
      which macros are safe in the presence of side effects.
      * docs/hacking.html.in: Document this.
      * HACKING: Regenerate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      ddcfc549
  24. 05 5月, 2013 1 次提交
    • M
      virstring: Introduce VIR_STRDUP and VIR_STRNDUP · c3abb5c4
      Michal Privoznik 提交于
      The code adaptation is not done right now, but in subsequent patches.
      Hence I am not implementing syntax-check rule as it would break
      compilation. Developers are strongly advised to use these new macros.
      They are similar to VIR_ALLOC() logic: VIR_STRDUP(dst, src) returns zero
      on success, -1 otherwise. In case you don't want to report OOM error,
      use the _QUIET variant of a macro.
      c3abb5c4
  25. 20 4月, 2013 1 次提交
    • E
      docs: fix usage of 'onto' · 1bf25ba2
      Eric Blake 提交于
      http://www.uhv.edu/ac/newsletters/writing/grammartip2009.07.01.htm
      (and several other sites) give hints that 'onto' is best used if
      you can also add 'up' just before it and still make sense. In many
      cases in the code base, we really want the two-word form, or even
      a simplification to just 'on' or 'to'.
      
      * docs/hacking.html.in: Use correct 'on to'.
      * python/libvirt-override.c: Likewise.
      * src/lxc/lxc_controller.c: Likewise.
      * src/util/virpci.c: Likewise.
      * daemon/THREADS.txt: Use simpler 'on'.
      * docs/formatdomain.html.in: Better usage.
      * docs/internals/rpc.html.in: Likewise.
      * src/conf/domain_event.c: Likewise.
      * src/rpc/virnetclient.c: Likewise.
      * tests/qemumonitortestutils.c: Likewise.
      * HACKING: Regenerate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      1bf25ba2
  26. 18 4月, 2013 1 次提交
  27. 11 2月, 2013 1 次提交
  28. 08 2月, 2013 1 次提交
  29. 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
  30. 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
  31. 12 1月, 2013 2 次提交
  32. 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
  33. 12 10月, 2012 1 次提交
  34. 25 9月, 2012 1 次提交
  35. 12 9月, 2012 1 次提交