1. 03 4月, 2017 1 次提交
    • M
      virGetDomain: Set domain ID too · 5683b213
      Michal Privoznik 提交于
      So far our code is full of the following pattern:
      
        dom = virGetDomain(conn, name, uuid)
        if (dom)
            dom->id = 42;
      
      There is no reasong why it couldn't be just:
      
        dom = virGetDomain(conn, name, uuid, id);
      
      After all, client domain representation consists of tuple (name,
      uuid, id).
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      5683b213
  2. 27 3月, 2017 3 次提交
    • M
      util: Fix naming in util/virnodesuspend · d2d1dec1
      Martin Kletzander 提交于
      That file has only two exported files and each one of them has
      different naming.  virNode is what all the other files use, so let's
      use it.  It wasn't used before because the clash with public API
      naming, so let's fix that by shortening the name (there is no other
      private variant of it anyway).
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      d2d1dec1
    • M
      Remove src/nodeinfo · 26ae4e48
      Martin Kletzander 提交于
      There is no "node driver" as there was before, drivers have to do
      their own ACL checking anyway, so they all specify their functions and
      nodeinfo is basically just extending conf/capablities.  Hence moving
      the code to src/conf/ is the right way to go.
      
      Also that way we can de-duplicate some code that is in virsysfs and/or
      virhostcpu that got duplicated during the virhostcpu.c split.  And
      Some cleanup is done throughout the changes, like adding the vir*
      prefix etc.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      26ae4e48
    • M
      Move src/fdstream to src/util/virfdstream · bdcb1995
      Martin Kletzander 提交于
      There is no reason for it not to be in the utils, all global symbols
      under that file already have prefix vir* and there is no reason for it
      to be part of DRIVER_SOURCES because that is just a leftover from
      older days (pre-driver modules era, I believe).
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      bdcb1995
  3. 12 1月, 2017 1 次提交
    • M
      lxc: Move lxcContainerAvailable to virprocess · 083fcd06
      Michal Privoznik 提交于
      Other drivers (like qemu) would like to know if the namespaces
      are available therefore it makes sense to move this function to
      a shared module.
      
      At the same time, this function had some default namespaces that
      are checked with every call. It is not necessary - let callers
      pass just those namespaces they are interested in.
      
      With the move the function is renamed to
      virProcessNamespaceAvailable.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      083fcd06
  4. 09 1月, 2017 1 次提交
  5. 09 12月, 2016 2 次提交
  6. 22 11月, 2016 1 次提交
  7. 27 10月, 2016 1 次提交
  8. 22 10月, 2016 1 次提交
  9. 14 10月, 2016 1 次提交
  10. 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
  11. 12 10月, 2016 1 次提交
  12. 26 9月, 2016 1 次提交
  13. 06 9月, 2016 1 次提交
    • M
      Make sure sys/types.h is included after sys/sysmacros.h · f3f15cc2
      Michal Privoznik 提交于
      In the latest glibc, major() and minor() functions are marked as
      deprecated (glibc commit dbab6577):
      
        CC       util/libvirt_util_la-vircgroup.lo
      util/vircgroup.c: In function 'virCgroupGetBlockDevString':
      util/vircgroup.c:768:5: error: '__major_from_sys_types' is deprecated:
        In the GNU C Library, `major' is defined by <sys/sysmacros.h>.
        For historical compatibility, it is currently defined by
        <sys/types.h> as well, but we plan to remove this soon.
        To use `major', include <sys/sysmacros.h> directly.
        If you did not intend to use a system-defined macro `major',
        you should #undef it after including <sys/types.h>.
        [-Werror=deprecated-declarations]
           if (virAsprintf(&ret, "%d:%d ", major(sb.st_rdev), minor(sb.st_rdev)) < 0)
           ^~
      In file included from /usr/include/features.h:397:0,
                       from /usr/include/bits/libc-header-start.h:33,
                       from /usr/include/stdio.h:28,
                       from ../gnulib/lib/stdio.h:43,
                       from util/vircgroup.c:26:
      /usr/include/sys/sysmacros.h:87:1: note: declared here
       __SYSMACROS_DEFINE_MAJOR (__SYSMACROS_FST_IMPL_TEMPL)
       ^
      
      Moreover, in the glibc commit, there's suggestion to keep
      ordering of including of header files as implemented here.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      f3f15cc2
  14. 05 8月, 2016 1 次提交
    • M
      lxcDomainCreateXMLWithFiles: Avoid crash · 5f5a5a42
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1363773
      
      Imagine that you're creating a transient domain, but for some reason,
      starting it fails. That is virLXCProcessStart() returns an error. With
      current code, in the error handling code the domain object is removed
      from the domain object list, @vm is set to NULL and controls jump to
      enjob label where virLXCDomainObjEndJob() is called which dereference vm
      leading to instant crash.
      
      The fix is to end the job in the error handling code and only after that
      remove the domain from the list and jump onto cleanup label instead of
      endjob.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      5f5a5a42
  15. 24 7月, 2016 1 次提交
  16. 07 7月, 2016 2 次提交
  17. 17 6月, 2016 1 次提交
  18. 10 6月, 2016 5 次提交
  19. 08 6月, 2016 9 次提交
  20. 07 6月, 2016 2 次提交
  21. 03 6月, 2016 1 次提交
    • M
      Fix building with -Og · 3470cd86
      Martin Kletzander 提交于
      When building using -Og, gcc sees that some variables can be used
      uninitialized  It can be debatable whether it is possible with our
      codeflow, but functions should be self-contained and initializations are
      always good.  The return instead of goto is due to actualType being used
      in the cleanup.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      3470cd86
  22. 27 5月, 2016 1 次提交
  23. 25 5月, 2016 1 次提交
    • J
      lxc: Fix lxcDomainDestroyFlags endjob processing · cb0159df
      John Ferlan 提交于
      Commit id '15ccb0db' added job functions for the lxc driver; however,
      for shutdown and nonpersistent path, the vm was removed from the domain
      object list and the vm pointer cleared before the endjob.
      
      Adjust the code to perform the endjob first and then perform the
      ObjListRemove as long as the vm wasn't NULL. This follows more closely
      models from qemu and libxl
      
      Found by Coverity (FORWARD_NULL)
      cb0159df