1. 21 8月, 2018 1 次提交
  2. 07 8月, 2018 2 次提交
  3. 26 6月, 2018 1 次提交
    • J
      util: fix mount issue by moving NULL value to "none" in syscall. · 794b576c
      Julio Faracco 提交于
      After running libvirt daemon with valgrind tools, some errors are
      appearing when you try to start a domain. One example:
      
      ==18012== Syscall param mount(type) points to unaddressable byte(s)
      ==18012==    at 0x6FEE3CA: mount (syscall-template.S:78)
      ==18012==    by 0x531344D: virFileMoveMount (virfile.c:3828)
      ==18012==    by 0x27FE7675: qemuDomainBuildNamespace (qemu_domain.c:11501)
      ==18012==    by 0x2800C44E: qemuProcessHook (qemu_process.c:2870)
      ==18012==    by 0x52F7E1D: virExec (vircommand.c:726)
      ==18012==    by 0x52F7E1D: virCommandRunAsync (vircommand.c:2477)
      ==18012==    by 0x52F4EDD: virCommandRun (vircommand.c:2309)
      ==18012==    by 0x2800A731: qemuProcessLaunch (qemu_process.c:6235)
      ==18012==    by 0x2800D6B4: qemuProcessStart (qemu_process.c:6569)
      ==18012==    by 0x28074876: qemuDomainObjStart (qemu_driver.c:7314)
      ==18012==    by 0x280522EB: qemuDomainCreateWithFlags (qemu_driver.c:7367)
      ==18012==    by 0x55484BF: virDomainCreate (libvirt-domain.c:6531)
      ==18012==    by 0x12CDBD: remoteDispatchDomainCreate (remote_daemon_dispatch_stubs.h:4350)
      ==18012==    by 0x12CDBD: remoteDispatchDomainCreateHelper (remote_daemon_dispatch_stubs.h:4326)
      ==18012==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
      
      Some documentation recommends to use "none" when you don't have a
      filesystem type to use. Specially, for bind and move actions.
      Signed-off-by: NJulio Faracco <jcfaracco@gmail.com>
      794b576c
  4. 28 3月, 2017 1 次提交
  5. 07 2月, 2017 1 次提交
  6. 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
  7. 15 12月, 2016 1 次提交
  8. 25 11月, 2016 1 次提交
    • M
      virstring: Unify string list function names · c2a5a4e7
      Michal Privoznik 提交于
      We have couple of functions that operate over NULL terminated
      lits of strings. However, our naming sucks:
      
      virStringJoin
      virStringFreeList
      virStringFreeListCount
      virStringArrayHasString
      virStringGetFirstWithPrefix
      
      We can do better:
      
      virStringListJoin
      virStringListFree
      virStringListFreeCount
      virStringListHasString
      virStringListGetFirstWithPrefix
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      c2a5a4e7
  9. 21 11月, 2016 1 次提交
  10. 18 11月, 2016 1 次提交
    • M
      Fix scheduler support check · f2bf5fbb
      Martin Kletzander 提交于
      Commit 94cc5778 tried fixing build on systems that did not have
      SCHED_BATCH or SCHED_IDLE defined.  But instead of changing it to
      conditional support, it rather completely disabled the support for
      setting any scheduler.  Since then, such old systems are not
      supported, but rather than reverting that commit, let's change that to
      the conditional support.  That way any addition to the list of
      schedulers can follow the same style so that we're consistent in the
      future.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      f2bf5fbb
  11. 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
  12. 06 9月, 2016 1 次提交
  13. 24 6月, 2016 3 次提交
    • J
      Use virDirOpen · e81de04c
      Ján Tomko 提交于
      Switch from opendir to virDirOpen everywhere we need to report an error.
      e81de04c
    • J
      Do not ignore hidden files in /sys and /proc · 70a033ab
      Ján Tomko 提交于
      The directories we iterate over are unlikely to contain any entries
      starting with a dot, other than '.' and '..' which is already skipped
      by virDirRead.
      70a033ab
    • J
      Introduce VIR_DIR_CLOSE · a4e6f1eb
      Ján Tomko 提交于
      Introduce a helper that only calls closedir if DIR* is non-NULL
      and sets it to NULL afterwards.
      a4e6f1eb
  14. 19 2月, 2016 1 次提交
  15. 10 2月, 2016 1 次提交
  16. 17 12月, 2015 2 次提交
  17. 20 11月, 2015 1 次提交
  18. 04 11月, 2015 1 次提交
  19. 28 10月, 2015 1 次提交
  20. 27 8月, 2015 1 次提交
  21. 18 8月, 2015 1 次提交
    • E
      build: fix mingw build · 0a617b53
      Eric Blake 提交于
      Ever since commit e44b0269, 64-bit mingw compilation fails with:
      
      ../../src/util/virprocess.c: In function 'virProcessGetPids':
      ../../src/util/virprocess.c:628:50: error: passing argument 4 of 'virStrToLong_i' from incompatible pointer type [-Werror=incompatible-pointer-types]
               if (virStrToLong_i(ent->d_name, NULL, 10, &tmp_pid) < 0)
                                                        ^
      In file included from ../../src/util/virprocess.c:59:0:
      ../../src/util/virstring.h:53:5: note: expected 'int *' but argument is of type 'pid_t * {aka long long int *}'
       int virStrToLong_i(char const *s,
           ^
      cc1: all warnings being treated as errors
      
      Although mingw won't be using this function, it does compile the
      file, and the fix is relatively simple.
      
      * src/util/virprocess.c (virProcessGetPids): Don't assume pid_t
      fits in int.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      0a617b53
  22. 16 6月, 2015 2 次提交
  23. 11 6月, 2015 1 次提交
  24. 08 6月, 2015 1 次提交
    • R
      util: process: fix build on FreeBSD · 5ceb34ee
      Roman Bogorodskiy 提交于
      Commit 825df8c3 refactored virProcess{Set,Get}Affinity routines,
      however broke BSD implementation because of the incorrect variable
      name. Fix build by using a proper variable name.
      
      Pushing as trivial and build break fix.
      5ceb34ee
  25. 03 6月, 2015 1 次提交
    • P
      util: process: Refactor and fix virProcessSetAffinity · 825df8c3
      Peter Krempa 提交于
      Refactor the function to return the bitmap instead of an integer and the
      inner workings so that they make more sense.
      
      This patch also fixes possible segfault on old systems that was
      introduced by commit:
      
      commit f1a43a8e
      Author: Hu Tao <hutao@cn.fujitsu.com>
      Date:   Fri Sep 14 15:46:59 2012 +0800
      
          use virBitmap to store cpu affinity info
      825df8c3
  26. 02 6月, 2015 1 次提交
  27. 09 4月, 2015 1 次提交
  28. 23 3月, 2015 1 次提交
  29. 13 3月, 2015 1 次提交
    • J
      Introduce virBitmapIsBitSet · 22fd3ac3
      Ján Tomko 提交于
      A helper that never returns an error and treats bits out of bitmap range
      as false.
      
      Use it everywhere we use ignore_value on virBitmapGetBit, or loop over
      the bitmap size.
      22fd3ac3
  30. 13 2月, 2015 1 次提交
    • P
      virprocess: fix MinGW build and RHEL-5 build · 94cc5778
      Pavel Hrdina 提交于
      Commit b6a2828e introduced new functions to set process scheduler. There
      is a small typo in ELSE path for systems where scheduler is not
      available.
      
      Also some of the definitions were introduced later in kernel. For
      example RHEL-5 is running on kernel 2.6.18, but SCHED_IDLE was introduces
      in 2.6.23 [1] and SCHED_BATCH in 2.6.16 [1]. We should not count only on
      existence of function sched_setscheduler(), we must also check for
      existence of used macros as they might not be defined.
      
      [1] see 'man 7 sched'
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      94cc5778
  31. 12 2月, 2015 1 次提交
  32. 19 12月, 2014 1 次提交
    • D
      Don't setup fake CPU pids for old QEMU · b07f3d82
      Daniel P. Berrange 提交于
      The code assumes that def->vcpus == nvcpupids, so when we setup
      fake CPU pids for old QEMU with nvcpupids == 1, we cause the
      later code to read off the end of the array. This has fun results
      like sche_setaffinity(0, ...) which changes libvirtd's own CPU
      affinity, or even better sched_setaffinity($RANDOM, ...) which
      changes the affinity of a random OS process.
      b07f3d82
  33. 29 10月, 2014 1 次提交
    • E
      maint: avoid static zero init in core files · 39871fce
      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/libvirt.c: Fix initialization.
      * src/util/viralloc.c: Likewise.
      * src/util/virdbus.c: Likewise.
      * src/util/virevent.c: Likewise.
      * src/util/virfile.c (safezero): Likewise.
      * src/util/virlog.c: Likewise.
      * src/util/virnetlink.c: Likewise.
      * src/util/virthread.h (VIR_ONCE_GLOBAL_INIT): Likewise.
      * src/util/virprocess.c (virProcessGetStartTime): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      39871fce
  34. 12 10月, 2014 1 次提交
    • M
      Fix leftover typo '&' -> '&&' · 4d2a8a0a
      Martin Kletzander 提交于
      The actual origin of this so called typo are two commits.  The first one
      was commit 72f8a7f1 that came up with the following condition:
      
      if ((i == 8) & (flags & VIR_QEMU_PROCESS_KILL_FORCE))
      
      Fortunately this succeeded thanks to bool being (int)1 and
      VIR_QEMU_PROCESS_KILL_FORCE having the value of 1 << 0.  The check was
      then moved and altered in 8fd38231 to
      current state:
      
      if ((i == 50) & force)
      
      that will work again (both sides of '&' being booleans), but since this
      was missed so many times, it may pose a problem in the future in case it
      gets copy-pasted again.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      4d2a8a0a
  35. 02 10月, 2014 1 次提交
    • E
      build: fix build on non-Linux · 4acc03ae
      Eric Blake 提交于
      A cygwin build of 1.2.9 fails with:
      
      util/virprocess.c:87:27: fatal error: sys/syscall.h: No such file or directory
       #  include <sys/syscall.h>
      
      But in reality, the ONLY user of setns() is lxc, which is Linux-only.
      It's easiest to just limit the setns workarounds to Linux.
      
      * src/util/virprocess.c (setns): Limit definition to Linux.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      4acc03ae