1. 26 11月, 2015 1 次提交
  2. 18 11月, 2015 1 次提交
  3. 27 10月, 2015 1 次提交
  4. 16 10月, 2015 1 次提交
    • M
      virtlockd: Don't SIGSEGV on SIGUSR1 · 499e302f
      Michal Privoznik 提交于
      So we have this mechanism that on SIGUSR1 the virtlockd dumps its
      internal state into a JSON file, reexec itself and the reloads
      the internal state back. However, there's a bug in our
      implementation:
      
        (gdb) signal SIGUSR1
        Continuing with signal SIGUSR1.
        [Thread 0x7fd094f7b700 (LWP 10602) exited]
        process 10600 is executing new program: /home/zippy/work/libvirt/libvirt.git/src/virtlockd
        warning: Could not load shared library symbols for linux-vdso.so.1.
        Do you need "set solib-search-path" or "set sysroot"?
        [Thread debugging using libthread_db enabled]
        Using host libthread_db library "/lib64/libthread_db.so.1".
        [New Thread 0x7fb28bc3c700 (LWP 14501)]
      
        Program received signal SIGSEGV, Segmentation fault.
        0x00007fb29133d530 in virExpandN (ptrptr=0x70, size=8, countptr=0x68, add=1, report=true, domcode=7, filename=0x7fb29138aeab "rpc/virnetserver.c", funcname=0x7fb29138b680 <__FUNCTION__.15821> "virNetServerAddProgram", linenr=661) at util/viralloc.c:288
        288         if (*countptr + add < *countptr) {
        (gdb) bt
        #0  0x00007fb29133d530 in virExpandN (ptrptr=0x70, size=8, countptr=0x68, add=1, report=true, domcode=7, filename=0x7fb29138aeab "rpc/virnetserver.c", funcname=0x7fb29138b680 <__FUNCTION__.15821> "virNetServerAddProgram", linenr=661) at util/viralloc.c:288
        #1  0x00007fb29132a267 in virNetServerAddProgram (srv=0x0, prog=0x7fb2915d08b0) at rpc/virnetserver.c:661
        #2  0x00007fb29131f27f in main (argc=1, argv=0x7fff8f771298) at locking/lock_daemon.c:1445
      
      Notice the NULL @srv passed to frame 2? Usually, the @srv
      variable is initialized on fresh start. However, in case of
      daemon reload, the code path that is responsible for initializing
      the value was not triggered and therefore we crashed immediately.
      Fix this by always setting the variable.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      499e302f
  5. 09 10月, 2015 1 次提交
    • M
      virJSONValueArraySize: return ssize_t · 4f77c48c
      Michal Privoznik 提交于
      The internal representation of a JSON array counts the items in
      size_t. However, for some reason, when asking for the count it's
      reported as int. Firstly, we need the function to return a signed
      type as it's returning -1 on an error. But, not every system has
      integer the same size as size_t. Therefore, lets return ssize_t.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      4f77c48c
  6. 24 8月, 2015 1 次提交
    • E
      locking: Remove redundant 'srv' element from virLockDaemon · f08b1c58
      Erik Skultety 提交于
      Now that we have virNetDaemon object holding all the data and being
      capable of referencing multiple servers, having a duplicate reference to
      a single server stored in virLockDaemon isn't necessary anymore. This
      patch removes the above described element.
      f08b1c58
  7. 10 8月, 2015 1 次提交
    • M
      rpc: Remove keepalive_required option · a8743c39
      Martin Kletzander 提交于
      Since its introduction in 2011 (particularly in commit f4324e32),
      the option doesn't work.  It just effectively disables all incoming
      connections.  That's because the client private data that contain the
      'keepalive_supported' boolean, are initialized to zeroes so the bool is
      false and the only other place where the bool is used is when checking
      whether the client supports keepalive.  Thus, according to the server,
      no client supports keepalive.
      
      Removing this instead of fixing it is better because a) apparently
      nobody ever tried it since 2011 (4 years without one month) and b) we
      cannot know whether the client supports keepalive until we get a ping or
      pong keepalive packet.  And that won't happen until after we dispatched
      the ConnectOpen call.
      
      Another two reasons would be c) the keepalive_required was tracked on
      the server level, but keepalive_supported was in private data of the
      client as well as the check that was made in the remote layer, thus
      making all other instances of virNetServer miss this feature unless they
      all implemented it for themselves and d) we can always add it back in
      case there is a request and a use-case for it.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      a8743c39
  8. 16 6月, 2015 1 次提交
  9. 23 4月, 2015 1 次提交
    • J
      locking: relax PID requirement · ee3eddb3
      Jim Fehlig 提交于
      Some hypervisors like Xen do not have PIDs associated with domains.
      Relax the requirement for PID != 0 in the locking code so it can
      be used by hypervisors that do not represent domains as a process
      running on the host.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      ee3eddb3
  10. 15 4月, 2015 1 次提交
  11. 02 4月, 2015 1 次提交
    • J
      Remove unused macros · a0482396
      Ján Tomko 提交于
      In the order of appearance:
      
      * MAX_LISTEN - never used
        added by 23ad665c (qemud) and addec57 (lock daemon)
      
      * NEXT_FREE_CLASS_ID - never used, added by 07d1b6b5
      
      * virLockError - never used, added by eb8268a4
      
      * OPENVZ_MAX_ARG, CMDBUF_LEN, CMDOP_LEN
        unused since the removal of ADD_ARG_LIT in d8b31306
      
      * QEMU_NB_PER_CPU_STAT_PARAM - unused since 897808e7
      
      * QEMU_CMD_PROMPT, QEMU_PASSWD_PROMPT - unused since 1dc10a7b
      
      * TEST_MODEL_WORDSIZE - unused since c25c18f7
      
      * TEMPDIR - never used, added by 714bef5b
      
      * NSIG - workaround around old headers
        added by commit 60ed1d2a
        unused since virExec was moved by commit 02e86910
      
      * DO_TEST_PARSE - never used, added by 9afa0060
      
      * DIFF_MSEC, GETTIMEOFDAY - unused since eee6eb66
      a0482396
  12. 25 3月, 2015 1 次提交
  13. 09 3月, 2015 2 次提交
    • 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
    • J
      locking: Fix flags in virLockManagerLockDaemonNew · 6beb75d9
      Jiri Denemark 提交于
      virLockManager*New APIs are never called with
      VIR_LOCK_MANAGER_USES_STATE. Moreover, lockd driver does not maintain
      any state that would need to be transferred during migration and thus it
      should not mention VIR_LOCK_MANAGER_USES_STATE at all.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      6beb75d9
  14. 19 2月, 2015 1 次提交
    • J
      Search for schemas and cpu_map.xml in source tree · bc6e2063
      Jiri Denemark 提交于
      Not all files we want to find using virFileFindResource{,Full} are
      generated when libvirt is built, some of them (such as RNG schemas) are
      distributed with sources. The current API was not able to find source
      files if libvirt was built in VPATH.
      
      Both RNG schemas and cpu_map.xml are distributed in source tarball.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      bc6e2063
  15. 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
  16. 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
  17. 15 12月, 2014 3 次提交
  18. 03 12月, 2014 1 次提交
    • J
      Replace virDomainFree with virObjectUnref · 8fb3aee2
      John Ferlan 提交于
      Since virDomainFree will call virObjectUnref anyway, let's just use that
      directly so as to avoid the possibility that we inadvertently clear out
      a pending error message when using the public API.
      8fb3aee2
  19. 15 11月, 2014 1 次提交
  20. 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
  21. 15 9月, 2014 1 次提交
  22. 03 9月, 2014 1 次提交
  23. 22 8月, 2014 3 次提交
  24. 16 7月, 2014 1 次提交
    • M
      Fix const correctness · 607806f8
      Michal Privoznik 提交于
      In many places we define a variable as a 'const char *' when in fact
      we modify it just a few lines below. Or even free it. We should not do
      that.
      
      There's one exception though, in xenSessionFree() xenapi_utils.c. We
      are freeing the xen_session structure which is defined in
      xen/api/xen_common.h public header. The structure contains session_id
      which is type of 'const char *' when in fact it should have been just
      'char *'. So I'm leaving this unmodified, just noticing the fact in
      comment.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      607806f8
  25. 09 7月, 2014 1 次提交
  26. 08 7月, 2014 1 次提交
  27. 07 7月, 2014 1 次提交
  28. 03 7月, 2014 1 次提交
    • J
      Use virBufferCheckError everywhere we report OOM error · 92a8e72f
      Ján Tomko 提交于
      Replace:
      if (virBufferError(&buf)) {
          virBufferFreeAndReset(&buf);
          virReportOOMError();
          ...
      }
      
      with:
      if (virBufferCheckError(&buf) < 0)
          ...
      
      This should not be a functional change (unless some callers
      misused the virBuffer APIs - a different error would be reported
      then)
      92a8e72f
  29. 06 6月, 2014 1 次提交
  30. 13 5月, 2014 3 次提交
  31. 28 4月, 2014 2 次提交
  32. 25 4月, 2014 1 次提交