1. 15 12月, 2016 1 次提交
  2. 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
  3. 21 11月, 2016 1 次提交
  4. 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
  5. 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
  6. 06 9月, 2016 1 次提交
  7. 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
  8. 19 2月, 2016 1 次提交
  9. 10 2月, 2016 1 次提交
  10. 17 12月, 2015 2 次提交
  11. 20 11月, 2015 1 次提交
  12. 04 11月, 2015 1 次提交
  13. 28 10月, 2015 1 次提交
  14. 27 8月, 2015 1 次提交
  15. 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
  16. 16 6月, 2015 2 次提交
  17. 11 6月, 2015 1 次提交
  18. 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
  19. 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
  20. 02 6月, 2015 1 次提交
  21. 09 4月, 2015 1 次提交
  22. 23 3月, 2015 1 次提交
  23. 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
  24. 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
  25. 12 2月, 2015 1 次提交
  26. 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
  27. 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
  28. 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
  29. 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
  30. 16 9月, 2014 1 次提交
    • M
      virprocess: Extend list of platforms for setns wrapper · 735a15a6
      Michal Privoznik 提交于
      Currently, the setns() wrapper is supported only for x86_64 and i686
      which leaves us failing to build on other platforms like arm, aarch64
      and so on. This means, that the wrapper needs to be extended to those
      platforms and make to fail on runtime not compile time.
      
      The syscall numbers for other platforms was fetched using this
      command:
      
      kernel.git $ git grep "define.*__NR_setns" | grep -e arm -e powerpc -e s390
      arch/arm/include/uapi/asm/unistd.h:#define __NR_setns                   (__NR_SYSCALL_BASE+375)
      arch/arm64/include/asm/unistd32.h:#define __NR_setns 375
      arch/powerpc/include/uapi/asm/unistd.h:#define __NR_setns               350
      arch/s390/include/uapi/asm/unistd.h:#define __NR_setns          339
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      735a15a6
  31. 11 9月, 2014 1 次提交
  32. 10 9月, 2014 2 次提交
  33. 12 8月, 2014 1 次提交
    • G
      Include param.h in case of HAVE_BSD_CPU_AFFINITY · 712374d1
      Guido Günther 提交于
      This fixes compilation on kFreeBSD which otherwise fails like
      
        CC       util/libvirt_util_la-virprocess.lo
      In file included from /usr/include/sys/cpuset.h:35:0,
                       from util/virprocess.c:43:
      /usr/include/sys/_cpuset.h:49:43: error: 'NBBY' undeclared here (not in
      a function)
        long __bits[howmany(CPU_SETSIZE, _NCPUBITS)];
                                                 ^
      In file included from util/virprocess.c:43:0:
      /usr/include/sys/cpuset.h:215:12: error: unknown type name 'cpusetid_t'
       int cpuset(cpusetid_t *);
                  ^
      /usr/include/sys/cpuset.h:216:30: error: expected ')' before 'id_t'
       int cpuset_setid(cpuwhich_t, id_t, cpusetid_t);
                                    ^
      /usr/include/sys/cpuset.h:217:42: error: expected ')' before 'id_t'
       int cpuset_getid(cpulevel_t, cpuwhich_t, id_t, cpusetid_t *);
                                                ^
      /usr/include/sys/cpuset.h:218:48: error: expected ')' before 'id_t'
       int cpuset_getaffinity(cpulevel_t, cpuwhich_t, id_t, size_t, cpuset_t
      *);
                                                      ^
      /usr/include/sys/cpuset.h:219:48: error: expected ')' before 'id_t'
       int cpuset_setaffinity(cpulevel_t, cpuwhich_t, id_t, size_t, const
      cpuset_t *);
      
      And it's the correct usage as documented in
      
        http://www.freebsd.org/cgi/man.cgi?query=cpuset_setid
      
      Also change the #ifdef HAVE_BSH_CPU_AFFINITY to #if for consistency.
      712374d1
  34. 27 3月, 2014 1 次提交
  35. 25 3月, 2014 1 次提交