1. 05 9月, 2018 5 次提交
  2. 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
  3. 19 7月, 2018 1 次提交
  4. 06 6月, 2018 1 次提交
  5. 05 6月, 2018 1 次提交
  6. 12 5月, 2018 1 次提交
  7. 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
  8. 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
  9. 15 3月, 2018 1 次提交
  10. 08 3月, 2018 1 次提交
  11. 06 3月, 2018 1 次提交
  12. 31 1月, 2018 3 次提交
  13. 15 11月, 2017 1 次提交
  14. 07 11月, 2017 2 次提交
    • N
      rpc,lockd: Add missing netserver refcount increment on reload · 47eb77fb
      Nikolay Shirokovskiy 提交于
      After the virNetDaemonAddServerPostExec call in virtlogd we should have
      netserver refcount set to 2. One goes to netdaemon servers hashtable
      and one goes to virt{logd,lock} own reference to netserver. Let's add
      the missing increment in virNetDaemonAddServerPostExec itself while
      holding the daemon lock.
      
      Since lockd defers management of the @srv object by the presence
      in the hash table, virLockDaemonNewPostExecRestart must Unref the
      alloc'd Ref on the @srv object done as part of virNetDaemonAddServerPostExec
      and virNetServerNewPostExecRestart processing. The virNetDaemonGetServer
      in lock_daemon main will also take a reference which is Unref'd during
      main cleanup.
      47eb77fb
    • J
      lockd: Need to Unref @srv when done with it. · 82fa7fc3
      John Ferlan 提交于
      Commit id '252610f7' used a hash table to store the @srv, but
      didn't handle the virObjectUnref if virNetDaemonNew failed nor
      did it use virObjectUnref once successfully placed into the table
      which will now be managing it's lifetime (and would cause the
      virObjectRef if successfully inserted into the table).
      82fa7fc3
  15. 03 11月, 2017 1 次提交
    • A
      Remove backslash alignment attempts · 3e7db8d3
      Andrea Bolognani 提交于
      Right-aligning backslashes when defining macros or using complex
      commands in Makefiles looks cute, but as soon as any changes is
      required to the code you end up with either distractingly broken
      alignment or unnecessarily big diffs where most of the changes
      are just pushing all backslashes a few characters to one side.
      
      Generated using
      
        $ git grep -El '[[:blank:]][[:blank:]]\\$' | \
          grep -E '*\.([chx]|am|mk)$$' | \
          while read f; do \
            sed -Ei 's/[[:blank:]]*[[:blank:]]\\$/ \\/g' "$f"; \
          done
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      3e7db8d3
  16. 26 10月, 2017 1 次提交
  17. 16 10月, 2017 1 次提交
  18. 25 9月, 2017 1 次提交
  19. 05 9月, 2017 1 次提交
  20. 28 8月, 2017 1 次提交
    • E
      daemon: logging: Fix --verbose option being ignored by the daemon · b988f794
      Erik Skultety 提交于
      Commit 94c465d0 refactored the logging setup phase but introduced an
      issue, where the daemon ignores verbose mode when there are no outputs
      defined and the default must be used. The problem is that the default
      output was determined too early, thus ignoring the potential '--verbose'
      option taking effect. This patch postpones the creation of the default
      output to the very last moment when nothing else can change. Since the
      default output is only created during the init phase, it's safe to leave
      the pointer as NULL for a while, but it will be set eventually, thus not
      affecting runtime.
      Patch also adjusts both the other daemons.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1442947Signed-off-by: NErik Skultety <eskultet@redhat.com>
      b988f794
  21. 28 6月, 2017 1 次提交
  22. 27 4月, 2017 1 次提交
  23. 18 3月, 2017 1 次提交
    • P
      (log|lock)daemon: Don't spam logs with IO error messages after client disconnects · f0803dae
      Peter Krempa 提交于
      The log and lock protocol don't have an extra handshake to close the
      connection. Instead they just close the socket. Unfortunately that
      resulted into a lot of spurious garbage logged to the system log files:
      
      2017-03-17 14:00:09.730+0000: 4714: error : virNetSocketReadWire:1800 : End of file while reading data: Input/output error
      
      or in the journal as:
      
      Mar 13 16:19:33 xxxx virtlogd[32360]: End of file while reading data: Input/output error
      
      Use the new facility in the netserverclient to suppress the IO error
      report from the virNetSocket layer.
      f0803dae
  24. 16 3月, 2017 1 次提交
    • D
      Increase default file handle limits for daemons · 27cd7635
      Daniel P. Berrange 提交于
      Linux still defaults to a 1024 open file handle limit. This causes
      scalability problems for libvirtd / virtlockd / virtlogd on large
      hosts which might want > 1024 guest to be running. In fact if each
      guest needs > 1 FD, we can't even get to 500 guests. This is not
      good enough when we see machines with 100's of physical cores and
      TBs of RAM.
      
      In comparison to other memory requirements of libvirtd & related
      daemons, the resource usage associated with open file handles
      is essentially line noise. It is thus reasonable to increase the
      limits unconditionally for all installs.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      27cd7635
  25. 04 2月, 2017 1 次提交
  26. 20 12月, 2016 1 次提交
  27. 15 12月, 2016 2 次提交
  28. 14 12月, 2016 1 次提交
  29. 13 10月, 2016 1 次提交
    • M
      src: Treat PID as signed · b7d2d4af
      Michal Privoznik 提交于
      This initially started as a fix of some debug printing in
      virCgroupDetect. However it turned out that other places suffer
      from the similar problem. While dealing with pids, esp. in cases
      where we cannot use pid_t for ABI stability reasons, we often
      chose an unsigned integer type. This makes no sense as pid_t is
      signed.
      Also, new syntax-check rule is introduced so we won't repeat this
      mistake.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      b7d2d4af
  30. 10 10月, 2016 1 次提交