1. 22 7月, 2013 1 次提交
  2. 18 7月, 2013 1 次提交
  3. 17 7月, 2013 1 次提交
  4. 16 7月, 2013 3 次提交
  5. 12 7月, 2013 3 次提交
    • D
      Add a couple of debug statements to LXC driver · f45dbdb2
      Daniel P. Berrange 提交于
      When failing to start a container due to inaccessible root
      filesystem path, we did not log any meaningful error. Add a
      few debug statements to assist diagnosis
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      f45dbdb2
    • E
      util: make virSetUIDGID async-signal-safe · ee777e99
      Eric Blake 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=964358
      
      POSIX states that multi-threaded apps should not use functions
      that are not async-signal-safe between fork and exec, yet we
      were using getpwuid_r and initgroups.  Although rare, it is
      possible to hit deadlock in the child, when it tries to grab
      a mutex that was already held by another thread in the parent.
      I actually hit this deadlock when testing multiple domains
      being started in parallel with a command hook, with the following
      backtrace in the child:
      
       Thread 1 (Thread 0x7fd56bbf2700 (LWP 3212)):
       #0  __lll_lock_wait ()
           at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:136
       #1  0x00007fd5761e7388 in _L_lock_854 () from /lib64/libpthread.so.0
       #2  0x00007fd5761e7257 in __pthread_mutex_lock (mutex=0x7fd56be00360)
           at pthread_mutex_lock.c:61
       #3  0x00007fd56bbf9fc5 in _nss_files_getpwuid_r (uid=0, result=0x7fd56bbf0c70,
           buffer=0x7fd55c2a65f0 "", buflen=1024, errnop=0x7fd56bbf25b8)
           at nss_files/files-pwd.c:40
       #4  0x00007fd575aeff1d in __getpwuid_r (uid=0, resbuf=0x7fd56bbf0c70,
           buffer=0x7fd55c2a65f0 "", buflen=1024, result=0x7fd56bbf0cb0)
           at ../nss/getXXbyYY_r.c:253
       #5  0x00007fd578aebafc in virSetUIDGID (uid=0, gid=0) at util/virutil.c:1031
       #6  0x00007fd578aebf43 in virSetUIDGIDWithCaps (uid=0, gid=0, capBits=0,
           clearExistingCaps=true) at util/virutil.c:1388
       #7  0x00007fd578a9a20b in virExec (cmd=0x7fd55c231f10) at util/vircommand.c:654
       #8  0x00007fd578a9dfa2 in virCommandRunAsync (cmd=0x7fd55c231f10, pid=0x0)
           at util/vircommand.c:2247
       #9  0x00007fd578a9d74e in virCommandRun (cmd=0x7fd55c231f10, exitstatus=0x0)
           at util/vircommand.c:2100
       #10 0x00007fd56326fde5 in qemuProcessStart (conn=0x7fd53c000df0,
           driver=0x7fd55c0dc4f0, vm=0x7fd54800b100, migrateFrom=0x0, stdin_fd=-1,
           stdin_path=0x0, snapshot=0x0, vmop=VIR_NETDEV_VPORT_PROFILE_OP_CREATE,
           flags=1) at qemu/qemu_process.c:3694
       ...
      
      The solution is to split the work of getpwuid_r/initgroups into the
      unsafe portions (getgrouplist, called pre-fork) and safe portions
      (setgroups, called post-fork).
      
      * src/util/virutil.h (virSetUIDGID, virSetUIDGIDWithCaps): Adjust
      signature.
      * src/util/virutil.c (virSetUIDGID): Add parameters.
      (virSetUIDGIDWithCaps): Adjust clients.
      * src/util/vircommand.c (virExec): Likewise.
      * src/util/virfile.c (virFileAccessibleAs, virFileOpenForked)
      (virDirCreate): Likewise.
      * src/security/security_dac.c (virSecurityDACSetProcessLabel):
      Likewise.
      * src/lxc/lxc_container.c (lxcContainerSetID): Likewise.
      * configure.ac (AC_CHECK_FUNCS_ONCE): Check for setgroups, not
      initgroups.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      ee777e99
    • J
      testutils: Resolve Coverity issues · 8283ef9e
      John Ferlan 提交于
      Recent changes uncovered a NEGATIVE_RETURNS in the return from sysconf()
      when processing a for loop in virtTestCaptureProgramExecChild() in
      testutils.c
      
      Code review uncovered 3 other code paths with the same condition that
      weren't found by Covirity, so fixed those as well.
      8283ef9e
  6. 11 7月, 2013 2 次提交
  7. 10 7月, 2013 1 次提交
  8. 09 7月, 2013 2 次提交
  9. 03 7月, 2013 1 次提交
  10. 02 7月, 2013 5 次提交
  11. 14 6月, 2013 1 次提交
  12. 05 6月, 2013 1 次提交
  13. 21 5月, 2013 2 次提交
  14. 17 5月, 2013 2 次提交
  15. 16 5月, 2013 2 次提交
  16. 15 5月, 2013 4 次提交
  17. 09 5月, 2013 1 次提交
  18. 08 5月, 2013 1 次提交
  19. 02 5月, 2013 1 次提交
    • M
      virutil: Move string related functions to virstring.c · 7c9a2d88
      Michal Privoznik 提交于
      The source code base needs to be adapted as well. Some files
      include virutil.h just for the string related functions (here,
      the include is substituted to match the new file), some include
      virutil.h without any need (here, the include is removed), and
      some require both.
      7c9a2d88
  20. 16 4月, 2013 1 次提交
  21. 09 4月, 2013 3 次提交
    • D
      Unmount existing filesystems under user specified mounts in LXC · 1bd955ed
      Daniel P. Berrange 提交于
      If the user requests a mount for /run, this may hide any existing
      mounts that are lower down in /run. The result is that the
      container still sees the mounts in /proc/mounts, but cannot
      access them
      
      sh-4.2# df
      df: '/run/user/501/gvfs': No such file or directory
      df: '/run/media/berrange/LIVE': No such file or directory
      df: '/run/media/berrange/SecureDiskA1': No such file or directory
      df: '/run/libvirt/lxc/sandbox': No such file or directory
      Filesystem                      1K-blocks      Used Available Use% Mounted on
      /dev/mapper/vg_t500wlan-lv_root 151476396 135390200   8384900  95% /
      tmpfs                             1970888      3204   1967684   1% /run
      /dev/sda1                          194241    155940     28061  85% /boot
      devfs                                  64         0        64   0% /dev
      tmpfs                                  64         0        64   0% /sys/fs/cgroup
      tmpfs                             1970888      1200   1969688   1% /etc/libvirt-sandbox/scratch
      
      Before mounting any filesystem at a particular location, we
      must recursively unmount anything at or below the target mount
      point
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      1bd955ed
    • D
      Move lxcContainerUnmountSubtree further up in file · 2863ca22
      Daniel P. Berrange 提交于
      Ensure lxcContainerUnmountSubtree is at the top of the
      lxc_container.c file so it is easily referenced from
      any other method. No functional change
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      2863ca22
    • B
      Implement support for <hostdev caps=net> · 442d6a05
      Bogdan Purcareata 提交于
      This allows a container-type domain to have exclusive access to one of
      the host's NICs.
      
      Wire <hostdev caps=net> with the lxc_controller - when moving the newly
      created veth devices into a new namespace, also look for any hostdev
      devices that should be moved. Note: once the container domain has been
      destroyed, there is no code that moves the interfaces back to the
      original namespace. This does happen, though, probably due to default
      cleanup on namespace destruction.
      Signed-off-by: NBogdan Purcareata <bogdan.purcareata@freescale.com>
      442d6a05
  22. 04 4月, 2013 1 次提交