1. 31 1月, 2019 1 次提交
  2. 18 12月, 2018 1 次提交
  3. 14 12月, 2018 3 次提交
    • D
      Enforce a standard header file guard symbol name · 568a4172
      Daniel P. Berrangé 提交于
      Require that all headers are guarded by a symbol named
      
        LIBVIRT_$FILENAME
      
      where $FILENAME is the uppercased filename, with all characters
      outside a-z changed into '_'.
      
      Note we do not use a leading __ because that is technically a
      namespace reserved for the toolchain.
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      568a4172
    • D
      Fix many mistakes & inconsistencies in header file layout · 4cfd7090
      Daniel P. Berrangé 提交于
      This introduces a syntax-check script that validates header files use a
      common layout:
      
        /*
         ...copyright header...
         */
        <one blank line>
        #ifndef SYMBOL
        # define SYMBOL
        ....content....
        #endif /* SYMBOL */
      
      For any file ending priv.h, before the #ifndef, we will require a
      guard to prevent bogus imports:
      
        #ifndef SYMBOL_ALLOW
        # error ....
        #endif /* SYMBOL_ALLOW */
        <one blank line>
      
      The many mistakes this script identifies are then fixed.
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      4cfd7090
    • D
      Remove all Author(s): lines from source file headers · 60046283
      Daniel P. Berrangé 提交于
      In many files there are header comments that contain an Author:
      statement, supposedly reflecting who originally wrote the code.
      In a large collaborative project like libvirt, any non-trivial
      file will have been modified by a large number of different
      contributors. IOW, the Author: comments are quickly out of date,
      omitting people who have made significant contribitions.
      
      In some places Author: lines have been added despite the person
      merely being responsible for creating the file by moving existing
      code out of another file. IOW, the Author: lines give an incorrect
      record of authorship.
      
      With this all in mind, the comments are useless as a means to identify
      who to talk to about code in a particular file. Contributors will always
      be better off using 'git log' and 'git blame' if they need to  find the
      author of a particular bit of code.
      
      This commit thus deletes all Author: comments from the source and adds
      a rule to prevent them reappearing.
      
      The Copyright headers are similarly misleading and inaccurate, however,
      we cannot delete these as they have legal meaning, despite being largely
      inaccurate. In addition only the copyright holder is permitted to change
      their respective copyright statement.
      Reviewed-by: NErik Skultety <eskultet@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      60046283
  4. 16 11月, 2018 7 次提交
  5. 20 9月, 2018 2 次提交
  6. 18 9月, 2018 7 次提交
  7. 17 9月, 2018 1 次提交
  8. 05 9月, 2018 6 次提交
  9. 23 7月, 2018 2 次提交
    • A
      src: Make virStr*cpy*() functions return an int · 6c0d0210
      Andrea Bolognani 提交于
      Currently, the functions return a pointer to the
      destination buffer on success or NULL on failure.
      
      Not only does this kind of error handling look quite
      alien in the context of libvirt, where most functions
      return zero on success and a negative int on failure,
      but it's also somewhat pointless because unless there's
      been a failure the returned pointer will be the same
      one passed in by the user, thus offering no additional
      value.
      
      Change the functions so that they return an int
      instead.
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      6c0d0210
    • A
      src: Don't rely on strncpy()-like behavior · 583bdfa6
      Andrea Bolognani 提交于
      The strncpy() function has this quirk where it will copy
      *up* to the requested number of bytes, that is, it will
      stop early if it encounters a NULL byte in the source
      string.
      
      This makes it legal to pass the size of the destination
      buffer (minus one byte needed for the string terminator)
      as the number of bytes to copy and still get something
      somewhat reasonable out of the operation; unfortunately,
      it also makes the function difficult to reason about
      and way too easy to misuse.
      
      We want to move away from the way strncpy() behaves and
      towards better defined semantics, where virStrncpy()
      will always copy *exactly* the number of bytes it's
      been asked to copy; before we can do that, though, we
      have to change a few of the callers.
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      583bdfa6
  10. 19 7月, 2018 1 次提交
  11. 06 6月, 2018 1 次提交
  12. 05 6月, 2018 1 次提交
  13. 12 5月, 2018 1 次提交
  14. 11 5月, 2018 1 次提交
    • J
      util: Clean up consumers of virJSONValueArraySize · 4a3d6ed5
      John Ferlan 提交于
      Rather than have virJSONValueArraySize return a -1 when the input
      is not an array and then splat an error message, let's check for
      an array before calling and then change the return to be a size_t
      instead of ssize_t.
      
      That means using the helper virJSONValueIsArray as well as using a
      more generic error message such as "Malformed <something> array".
      In some cases we can remove stack variables and when we cannot,
      those variables should be size_t not ssize_t. Alter a few references
      of if (!value) to be if (value == 0) instead as well.
      
      Some callers can already assume an array is being worked on based
      on the previous call, so there's less to do.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      4a3d6ed5
  15. 23 3月, 2018 2 次提交
    • D
      rpc: avoid duplicating config in virtlockd/virtlogd augeas tests · 76e1720c
      Daniel P. Berrangé 提交于
      Most of the augeas test files use ::CONFIG:: to pull in the master
      config file for testing. This ensures that entries added to the config
      file are actually tested by augeas.
      
      This identified the missing admin_max_clients example in the virtlogd
      config file, which in turn prompted a change in description of the
      max_clients parameter, since these daemons don't have separate
      readonly & readwrite sockets.
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      76e1720c
    • D
      rpc: remove remains of obsolete log_buffer_size config parameter · 65824a7e
      Daniel P. Berrangé 提交于
      The global log buffer feature was deleted in:
      
        commit c0c8c1d7
        Author: Daniel P. Berrange <berrange@redhat.com>
        Date:   Mon Mar 3 14:54:33 2014 +0000
      
          Remove global log buffer feature entirely
      
          A earlier commit changed the global log buffer so that it only
          records messages that are explicitly requested via the log
          filters setting. This removes the performance burden, and
          improves the signal/noise ratio for messages in the global
          buffer. At the same time though, it is somewhat pointless, since
          all the recorded log messages are already going to be sent to an
          explicit log output like syslog, stderr or the journal. The
          global log buffer is thus just duplicating this data on stderr
          upon crash.
      
          The log_buffer_size config parameter is left in the augeas
          lens to prevent breakage for users on upgrade. It is however
          completely ignored hereafter.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      
      This was in the 1.2.3 release, and 4 years is sufficient time for a
      graceful upgrade path for augeas, so all remaining traces are now
      removed.
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      65824a7e
  16. 15 3月, 2018 1 次提交
  17. 08 3月, 2018 1 次提交
  18. 06 3月, 2018 1 次提交