1. 03 7月, 2019 1 次提交
    • M
      qemusecuritymock: Mock virProcessRunInFork · 0a9dcfab
      Michal Privoznik 提交于
      This test is beautiful. It checks if we haven't messed up
      refcounting on security labels (well, XATTRs where the original
      owner is stored). It does this by setting up tracking of XATTR
      setting/removing into a hash table, then calling
      qemuSecuritySetAllLabel() followed by immediate
      qemuSecurityRestoreAllLabel() at which point, the hash table must
      be empty. The test so beautifully written that no matter
      what you do it won't fail. The reason is that all seclabel work
      is done in a child process. Therefore, the hash table in the
      parent is never changed and thus always empty.
      
      There are two reasons for forking (only one of them makes sense
      here though):
      
      1) namespaces - when chown()-ing a file we have to fork() and
      make the child enter desired namespace,
      2) locking - because of exclusive access to XATTRs we lock the
      files we chown() and this is done in a fork (see 20786092 for
      more info).
      
      While we want to fork in real world, we don't want that in a test
      suite. Override virProcessRunInFork() then.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      0a9dcfab
  2. 19 6月, 2019 1 次提交
  3. 10 4月, 2019 1 次提交
  4. 14 12月, 2018 1 次提交
  5. 16 11月, 2018 1 次提交
  6. 21 8月, 2018 1 次提交
  7. 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
  8. 15 12月, 2016 1 次提交
  9. 06 9月, 2016 1 次提交
  10. 17 12月, 2015 1 次提交
    • A
      process: Add virProcessGetMaxMemLock() · bbefc9cc
      Andrea Bolognani 提交于
      This function can be used to retrieve the current locked memory
      limit for a process, so that the setting can be later restored.
      
      Add a configure check for getrlimit(), which we now use.
      bbefc9cc
  11. 16 6月, 2015 1 次提交
  12. 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
  13. 12 2月, 2015 1 次提交
  14. 04 3月, 2014 3 次提交
    • E
      util: make it easier to grab only regular process exit · c72e76c3
      Eric Blake 提交于
      Right now, a caller waiting for a child process either requires
      the child to have status 0, or must use WIFEXITED() and friends
      itself.  But in many cases, we want the middle ground of treating
      fatal signals as an error, and directly accessing the normal exit
      value without having to use WEXITSTATUS(), in order to easily
      detect an expected non-zero exit status.  This adds the middle
      ground to the low-level virProcessWait; the next patch will add
      it to virCommand.
      
      * src/util/virprocess.h (virProcessWait): Alter signature.
      * src/util/virprocess.c (virProcessWait): Add parameter.
      (virProcessRunInMountNamespace): Adjust caller.
      * src/util/vircommand.c (virCommandWait): Likewise.
      * src/util/virfile.c (virFileAccessibleAs): Likewise.
      * src/lxc/lxc_container.c (lxcContainerHasReboot)
      (lxcContainerAvailable): Likewise.
      * daemon/libvirtd.c (daemonForkIntoBackground): Likewise.
      * tools/virt-login-shell.c (main): Likewise.
      * tools/virsh-domain.c (cmdLxcEnterNamespace): Likewise.
      * tests/testutils.c (virtTestCaptureProgramOutput): Likewise.
      * tests/commandtest.c (test23): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      c72e76c3
    • E
      util: preserve exit status from mount namespace callback · 8b24a803
      Eric Blake 提交于
      The documentation of namespace callbacks was inconsistent on whether
      it preserved positive return values.  Now that we have a dedicated
      EXIT_CANCELED to flag all errors before getting to the callback,
      it is possible to use positive return values (not that any of the
      current callers do, but it is better to match the docs).
      
      Also, while vircommand.c is careful to close fds that a child should
      not have, it's still better to be in the practice of setting
      FD_CLOEXEC up front.
      
      * src/util/virprocess.c (virProcessRunInMountNamespace): Tweak
      return value to pass back non-zero status.  Avoid leaking pipe fds
      to other threads.
      * src/util/virprocess.h: Fix comment.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      8b24a803
    • E
      util: make it easier to reflect child exit status · 2b4f162e
      Eric Blake 提交于
      Thanks to namespaces, we have a couple of places in the code
      base that want to reflect a child exit status, including the
      ability to detect death by a signal, back to a grandparent.
      Best to make it a reusable function.
      
      * src/util/virprocess.h (virProcessExitWithStatus): New prototype.
      * src/libvirt_private.syms (util/virprocess.h): Export it.
      * src/util/virprocess.c (virProcessExitWithStatus): New function.
      * tests/commandtest.c (test23): Test it.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      2b4f162e
  15. 18 2月, 2014 1 次提交
  16. 08 5月, 2013 1 次提交
  17. 26 4月, 2013 1 次提交
    • L
      util: new virCommandSetMax(MemLock|Processes|Files) · 776d49f4
      Laine Stump 提交于
      This patch adds two sets of functions:
      
      1) lower level virProcessSet*() functions that will immediately set
      the RLIMIT_MEMLOCK. RLIMIT_NPROC, or RLIMIT_NOFILE of either the
      current process (using setrlimit()) or any other process (using
      prlimit()). "current process" is indicated by passing a 0 for pid.
      
      2) functions for virCommand* that will setup a virCommand object to
      set those limits at a later time just after it has forked a new
      process, but before it execs the new program.
      
      configure.ac has prlimit and setrlimit added to the list of functions
      to check for, and the low level functions log an "unsupported" error)
      on platforms that don't support those functions.
      776d49f4
  18. 08 1月, 2013 1 次提交
  19. 21 12月, 2012 1 次提交
  20. 27 9月, 2012 1 次提交
  21. 26 9月, 2012 2 次提交
  22. 21 9月, 2012 1 次提交
  23. 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
  24. 19 7月, 2012 1 次提交
  25. 10 3月, 2010 1 次提交
  26. 21 9月, 2009 1 次提交
    • D
      Move LXC driver into src/lxc/ · c93125b1
      Daniel P. Berrange 提交于
      * src/lxc_conf.c, src/lxc_conf.h, src/lxc_container.c,
        src/lxc_container.h, src/lxc_controller.c, src/lxc_driver.c,
        src/lxc_driver.h, src/veth.c, src/veth.h: Move to src/lxc/
      * src/opennebula/one_driver.c: Remove bogus veth.h include
      * src/Makefile.am: Adjust for lxc paths
      * daemon/qemud.c: Adjust include for lxc
      c93125b1
  27. 21 8月, 2008 1 次提交
  28. 11 4月, 2008 1 次提交
  29. 21 3月, 2008 1 次提交
    • D
      Initial Linux containers work · f1638952
      Daniel Veillard 提交于
      * configure.in include/libvirt/virterror.h src/Makefile.am
        src/driver.h src/lxc_conf.[ch] src/lxc_driver.[ch] src/virterror.c:
        Applied 3 patches from Dave Leskovec for intial support of
        Linux containers, configured off by default, work in progress.
      * src/libvirt.c: improve virDomainCreateLinux xmlDesc description
      Daniel
      f1638952
  30. 30 1月, 2008 1 次提交
    • J
      Enable the <config.h>-requiring test; fix violations · a3781881
      Jim Meyering 提交于
      Use <config.h>, not "config.h", per autoconf documentation.
      * Makefile.cfg (local-checks-to-skip) [sc_require_config_h]: Enable.
      * .x-sc_require_config_h: New file, to list exempted files.
      * Makefile.am (EXTRA_DIST): Add .x-sc_require_config_h.
      a3781881
  31. 26 11月, 2007 1 次提交
  32. 29 6月, 2007 1 次提交
  33. 27 6月, 2007 5 次提交