1. 03 1月, 2020 1 次提交
  2. 13 11月, 2019 1 次提交
    • J
      locking: fix build with older sanlock · 54dd0938
      Ján Tomko 提交于
      ../../src/locking/lock_driver_sanlock.c:106:17: error: incompatible pointer types
      assigning to 'char **' from 'char *' [-Werror,-Wincompatible-pointer-types]
              message = g_strdup_printf(_("sanlock error %d"), err);
                      ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      Fixes: b1d58418Signed-off-by: NJán Tomko <jtomko@redhat.com>
      54dd0938
  3. 12 11月, 2019 1 次提交
  4. 25 10月, 2019 1 次提交
  5. 21 10月, 2019 2 次提交
  6. 16 10月, 2019 1 次提交
  7. 15 10月, 2019 1 次提交
  8. 14 10月, 2019 1 次提交
  9. 10 9月, 2019 1 次提交
  10. 16 11月, 2018 3 次提交
  11. 20 9月, 2018 2 次提交
  12. 18 9月, 2018 3 次提交
  13. 05 9月, 2018 1 次提交
  14. 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
  15. 25 9月, 2017 1 次提交
  16. 05 9月, 2017 1 次提交
  17. 27 4月, 2017 1 次提交
  18. 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
  19. 29 9月, 2016 3 次提交
    • M
      sanlock: Properly init io_timeout · 5fe66ea3
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1292984
      
      Hold on to your hats, because this is gonna be wild.
      
      In bd3e16a3 I've tried to expose sanlock io_timeout. What I had
      not realized (because there is like no documentation for sanlock
      at all) was very unusual way their APIs work. Basically, what we
      do currently is:
      
          sanlock_add_lockspace_timeout(&ls, io_timeout);
      
      which adds a lockspace to sanlock daemon. One would expect that
      io_timeout sets the io_timeout for it. Nah! That's where you are
      completely off the tracks. It sets timeout for next lockspace you
      will probably add later. Therefore:
      
         sanlock_add_lockspace_timeout(&ls, io_timeout = 10);
         /* adds new lockspace with default io_timeout */
      
         sanlock_add_lockspace_timeout(&ls, io_timeout = 20);
         /* adds new lockspace with io_timeout = 10 */
      
         sanlock_add_lockspace_timeout(&ls, io_timeout = 40);
         /* adds new lockspace with io_timeout = 20 */
      
      And so on. You get the picture.
      Fortunately, we don't allow setting io_timeout per domain or per
      domain disk. So we just need to set the default used in the very
      first step and hope for the best (as all the io_timeout-s used
      later will have the same value).
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      5fe66ea3
    • M
      m4: Check for sanlock_write_lockspace · 2bca7cec
      Michal Privoznik 提交于
      Currently, we are checking for sanlock_add_lockspace_timeout
      which is good for now. But in a subsequent patch we are going to
      use sanlock_write_lockspace (which sets an initial value for io
      timeout for sanlock). Now, there is no reason to check for both
      functions in sanlock library as the sanlock_write_lockspace was
      introduced in 2.7 release and the one we are currently checking
      for in the 2.5 release. Therefore it is safe to assume presence
      of sanlock_add_lockspace_timeout when sanlock_write_lockspace
      is detected.
      
      Moreover, the macro for conditional compilation is renamed to
      HAVE_SANLOCK_IO_TIMEOUT (as it now encapsulates two functions).
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      2bca7cec
    • M
      lock_driver_sanlock: Avoid global driver variable whenever possible · 78da4296
      Michal Privoznik 提交于
      Global variables are bad, we should avoid using them.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      78da4296
  20. 12 7月, 2016 1 次提交
  21. 18 11月, 2015 1 次提交
  22. 15 4月, 2015 1 次提交
  23. 09 3月, 2015 1 次提交
    • J
      sanlock: Don't spam logs with "target pid not found" · 54972be8
      Jiri Denemark 提交于
      Commit v1.2.4-52-gda879e59 fixed issues with domains started before
      sanlock driver was enabled by checking whether a running domain is
      registered with sanlock and if it's not, sanlock driver is basically
      ignored for the domain.
      
      However, it was checking this even for domain which has just been
      started and no sanlock_* API was called for them yet. This results in
      
          cmd 9 target pid 2135544 not found
      
      error messages to appear in sanlock.log whenever we start a new domain.
      
      This patch avoids this useless check for freshly started domains.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      54972be8
  24. 09 1月, 2015 1 次提交
    • J
      safezero: fall back to writing zeroes even when resizing · 1390c268
      Ján Tomko 提交于
      Remove the resize flag and use the same code path for all callers.
      This flag was added by commit 18f03166 to allow virStorageFileResize
      use 'safezero' while preserving the behavior.
      
      Explicitly return -2 when a fallback to a different method should
      be done, to make the code path more obvious.
      
      Fail immediately when ftruncate fails in the mmap method,
      as we did before commit 18f03166.
      1390c268
  25. 17 12月, 2014 1 次提交
    • J
      virstoragefile: Have virStorageFileResize use safezero · 18f03166
      John Ferlan 提交于
      Currently virStorageFileResize() function uses build conditionals to
      choose either the posix_fallocate() or syscall(SYS_fallocate) with no
      fallback in order to preallocate the space in the newly resized file.
      
      Since the safezero code has a similar set of conditionals modify the
      resize and safezero code in order to allow the resize logic to make use
      of safezero to unify the look/feel of the code paths.
      
      Add a new boolean (resize) to safezero() to make the optional decision
      whether to try syscall(SYS_fallocate) if the posix_fallocate fails because
      HAVE_POSIX_FALLOCATE is not defined (eg, return -1 and errno == 0).
      
      Create a local safezero_sys_fallocate in order to handle the resize
      code paths that support that.  If not present, the set errno = ENOSYS
      in order to allow the caller to handle the failure scenarios.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      18f03166
  26. 15 12月, 2014 2 次提交
  27. 15 11月, 2014 1 次提交
  28. 29 10月, 2014 1 次提交
    • E
      maint: avoid static zero init in helpers · ff99c791
      Eric Blake 提交于
      C guarantees that static variables are zero-initialized.  Some older
      compilers (and also gcc -fno-zero-initialized-in-bss) create larger
      binaries if you explicitly zero-initialize a static variable.
      
      * src/conf/nwfilter_conf.c: Fix initialization.
      * src/cpu/cpu_x86.c: Likewise.
      * src/interface/interface_backend_netcf.c: Likewise.
      * src/locking/lock_daemon.c: Likewise.
      * src/locking/lock_driver_lockd.c: Likewise.
      * src/locking/lock_driver_sanlock.c: Likewise.
      * src/network/bridge_driver.c: Likewise.
      * src/node_device/node_device_udev.c: Likewise.
      * src/nwfilter/nwfilter_learnipaddr.c: Likewise.
      * src/rpc/virnetserver.c: Likewise.
      * src/security/security_selinux.c
      (virSecuritySELinuxGenSecurityLabel): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      ff99c791
  29. 03 9月, 2014 1 次提交
  30. 22 8月, 2014 1 次提交