1. 21 5月, 2013 1 次提交
  2. 09 5月, 2013 1 次提交
  3. 03 5月, 2013 1 次提交
  4. 02 5月, 2013 1 次提交
    • M
      virutil: Move string related functions to virstring.c · 7c9a2d88
      Michal Privoznik 提交于
      The source code base needs to be adapted as well. Some files
      include virutil.h just for the string related functions (here,
      the include is substituted to match the new file), some include
      virutil.h without any need (here, the include is removed), and
      some require both.
      7c9a2d88
  5. 25 1月, 2013 1 次提交
  6. 17 1月, 2013 1 次提交
  7. 08 1月, 2013 1 次提交
    • E
      maint: avoid potential promotion issues with [ug]id_t · 798ff667
      Eric Blake 提交于
      POSIX does not guarantee whether uid_t and gid_t are signed or
      unsigned, nor does it guarantee whether they are smaller, same
      size, or larger than int (or even the same size as one another).
      Therefore, it is possible to have platforms where '(uid_t)-1==-1'
      is false or where 'uid = gid = -1' sets uid to the wrong value,
      thanks to integer promotion rules.  The only portable way to use
      the placeholder value of these two types is to always use a cast.
      Thankfully, the issue is mostly theoretical - sanlock only
      compiles on Linux for now, and on Linux, these types do not
      suffer from strange promotion problems.
      
      * src/locking/lock_driver_sanlock.c
      (virLockManagerSanlockSetupLockspace, virLockManagerSanlockInit)
      (virLockManagerSanlockCreateLease): Cast -1 to proper type before
      comparing with uid_t or gid_t.
      798ff667
  8. 28 12月, 2012 1 次提交
    • M
      sanlock: Chown lease files as well · ce753ec5
      Michal Privoznik 提交于
      Since sanlock doesn't run under root:root, we have chown()'ed the
      __LIBVIRT__DISKS__ lease file to the user:group defined in the
      sanlock config. However, when writing the patch I've forgot about
      lease files for each disk (this is the
      /var/lib/libvirt/sanlock/<md5>) file.
      ce753ec5
  9. 21 12月, 2012 5 次提交
  10. 14 12月, 2012 1 次提交
    • M
      sanlock: Re-add lockspace unconditionally · 11cfa288
      Michal Privoznik 提交于
      Currently, if sanlock is already registering a lockspace other
      libvirtd instances (from other hosts) obtain -EINPROGRESS. On
      sufficiently new sanlock, sanlock_inq_lockspace() is called,
      which suspend execution until lockspace state is changed. With
      current libvirt implementation, we fail to retry adding the
      lockspace again but continue in error path. Therefore we produce
      meaningless error message:
      
      virLockManagerSanlockSetupLockspace:363 : Unable to add lockspace
      /var/lib/libvirt/sanlock/__LIBVIRT__DISKS__: Success
      qemudLoadDriverConfig:558 : Failed to load lock manager sanlock
      
      We should try to re-add the lockspace after its state change to
      be sure it was added successfully. In fact, with sufficiently new
      sanlock we can just avoid dummy usleep() which is used if there's
      no inquire API.
      11cfa288
  11. 16 11月, 2012 1 次提交
    • M
      sanlock: Retry after EINPROGRESS · 96a02703
      Michal Privoznik 提交于
      It may take some time for sanlock to add a lockspace. And if user
      restart libvirtd service meanwhile, the fresh daemon can fail adding
      the same lockspace with EINPROGRESS. Recent sanlock has
      sanlock_inq_lockspace() function which should block until lockspace
      changes state. If we are building against older sanlock we should
      retry a few times before claiming an error. This issue can be easily
      reproduced:
      
      for i in {1..1000} ; do echo $i; service libvirtd restart; sleep 2; done
      20
      Stopping libvirtd daemon:                                  [FAILED]
      Starting libvirtd daemon:                                  [  OK  ]
      21
      Stopping libvirtd daemon:                                  [  OK  ]
      Starting libvirtd daemon:                                  [  OK  ]
      22
      Stopping libvirtd daemon:                                  [  OK  ]
      Starting libvirtd daemon:                                  [  OK  ]
      
       error : virLockManagerSanlockSetupLockspace:334 : Unable to add
       lockspace /var/lib/libvirt/sanlock/__LIBVIRT__DISKS__: Operation now in
       progress
      96a02703
  12. 02 11月, 2012 1 次提交
  13. 30 10月, 2012 1 次提交
  14. 17 10月, 2012 1 次提交
    • J
      locking: Fix build with sanlock < 2.4 · 5ce6d95e
      Jiri Denemark 提交于
      libvirt started using sanlock_killpath to implement on_lockfailure
      action. Since sanlock_killpath was introduced in sanlock 2.4, libvirt
      fails to build with older sanlock.
      5ce6d95e
  15. 11 10月, 2012 2 次提交
    • J
      locking: Implement lock failure action in sanlock driver · 89364767
      Jiri Denemark 提交于
      While the changes to sanlock driver should be stable, the actual
      implementation of sanlock_helper is supposed to be replaced in the
      future. However, before we can implement a better sanlock_helper, we
      need an administrative interface to libvirtd so that the helper can just
      pass a "leases lost" event to the particular libvirt driver and
      everything else will be taken care of internally. This approach will
      also allow libvirt to pass such event to applications and use
      appropriate reasons when changing domain states.
      
      The temporary implementation handles all actions directly by calling
      appropriate libvirt APIs (which among other things means that it needs
      to know the credentials required to connect to libvirtd).
      89364767
    • J
      locking: Add support for lock failure action · 297c704a
      Jiri Denemark 提交于
      297c704a
  16. 21 9月, 2012 1 次提交
  17. 22 8月, 2012 1 次提交
    • J
      sanlock: Provide better error if lockspace directory is missing · 2560a51e
      Jiri Denemark 提交于
      Generating "Unable to add lockspace /lock/space/dir/__LIBVIRT__DISKS__:
      No such file or directory" is correct but not exactly clear. This patch
      changes the error message to "Unable to create lockspace
      /lock/space/dir/__LIBVIRT__DISKS__: parent directory does not exist or
      is not a directory".
      2560a51e
  18. 14 8月, 2012 2 次提交
  19. 23 7月, 2012 1 次提交
    • O
      Desert the FSF address in copyright · f9ce7dad
      Osier Yang 提交于
      Per the FSF address could be changed from time to time, and GNU
      recommends the following now: (http://www.gnu.org/licenses/gpl-howto.html)
      
        You should have received a copy of the GNU General Public License
        along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
      
      This patch removes the explicit FSF address, and uses above instead
      (of course, with inserting 'Lesser' before 'General').
      
      Except a bunch of files for security driver, all others are changed
      automatically, the copyright for securify files are not complete,
      that's why to do it manually:
      
        src/security/security_selinux.h
        src/security/security_driver.h
        src/security/security_selinux.c
        src/security/security_apparmor.h
        src/security/security_apparmor.c
        src/security/security_driver.c
      f9ce7dad
  20. 20 7月, 2012 2 次提交
  21. 18 7月, 2012 1 次提交
  22. 25 6月, 2012 3 次提交
  23. 15 5月, 2012 1 次提交
  24. 08 3月, 2012 2 次提交
  25. 22 9月, 2011 1 次提交
    • E
      sanlock: fix memory leak · a55f1892
      Eric Blake 提交于
      Detected by Coverity.  The only way to get to error_unlink is if
      path was successfully assigned, so the if was useless.  Meanwhile,
      there was a return statement that did not free path.
      
      * src/locking/lock_driver_sanlock.c
      (virLockManagerSanlockSetupLockspace): Fix mem-leak, and drop
      useless if.
      a55f1892
  26. 20 9月, 2011 1 次提交
    • D
      Update to require sanlock 1.8 for license compliance · 19ff0ddf
      Daniel P. Berrange 提交于
      Inexplicably the sanlock code all got placed under the GPLv2-only,
      so libvirt's use of sanlock introduces a license incompatibility.
      The sanlock developers have now rearranged the code such that there
      is a 'sanlock_client.so' which is LGPLv2+ while their daemon remains
      GPLv2-only. To use the new client library we need to call the new
      sanlock_init and sanlock_align APIs instead of sanlock_direct_init
      and sanlock_direct_align. These APIs calls are now routed via the
      sanlock daemon, instead of doing direct I/O calls to disk.
      
      For all this we require sanlock >= 1.8
      
      * configure.ac: Check for sanlock_client.so instead of sanlock.so
        and fix various comments
      * libvirt.spec.in: Mandate sanlock >= 1.8
      * src/Makefile.am: Link to -lsanlock_client
      * src/locking/lock_driver_sanlock.c: Use sanlock_init and
        sanlock_align
      19ff0ddf
  27. 31 8月, 2011 1 次提交
  28. 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
  29. 16 7月, 2011 1 次提交
    • E
      maint: fix typos · 37754a74
      Eric Blake 提交于
      Our XML prefers "shareable" over "sharable".
      
      * docs/internals/locking.html.in: s/sharable/shareable/
      * src/locking/lock_driver_sanlock.c
      (virLockManagerSanlockAddResource): Likewise.
      37754a74
  30. 13 7月, 2011 1 次提交
    • E
      maint: print flags in hex during debug · 06dbfa6d
      Eric Blake 提交于
      Continuation of commit 313ac7fd, and enforce things with a syntax
      check.
      
      Technically, virNetServerClientCalculateHandleMode is not printing
      a mode_t, but rather a collection of VIR_EVENT_HANDLE_* bits;
      however, these bits are < 8, so there is no different in the
      output, and that was the easiest way to silence the new syntax check.
      
      * cfg.mk (sc_flags_debug): New syntax check.
      (exclude_file_name_regexp--sc_flags_debug): Add exemptions.
      * src/fdstream.c (virFDStreamOpenFileInternal): Print flags in
      hex, mode_t in octal.
      * src/libvirt-qemu.c (virDomainQemuMonitorCommand)
      (virDomainQemuAttach): Likewise.
      * src/locking/lock_driver_nop.c (virLockManagerNopInit): Likewise.
      * src/locking/lock_driver_sanlock.c (virLockManagerSanlockInit):
      Likewise.
      * src/locking/lock_manager.c: Likewise.
      * src/qemu/qemu_migration.c: Likewise.
      * src/qemu/qemu_monitor.c: Likewise.
      * src/rpc/virnetserverclient.c
      (virNetServerClientCalculateHandleMode): Print mode with %o.
      06dbfa6d