1. 17 2月, 2016 2 次提交
    • P
      util: cgroup: Allow ignoring EACCES in virCgroup(Allow|Deny)DevicePath · cf113e8d
      Peter Krempa 提交于
      When adding disk images to ACL we may call those functions on NFS
      shares. In that case we might get an EACCES, which isn't really relevant
      since NFS would not hold a block device. This patch adds a flag that
      allows to stop reporting an error on EACCES to avoid spaming logs.
      
      Currently there's no functional change.
      cf113e8d
    • P
      util: cgroup: Drop virCgroup(Allow|Deny)DeviceMajor · 9cd5da71
      Peter Krempa 提交于
      Since commit 47e5b5ae virCgroupAllowDevice allows to pass -1 as either
      the minor or major device number and it automatically uses '*' in place
      of that. Reuse the new approach through the code and drop the duplicated
      functions.
      9cd5da71
  2. 10 2月, 2016 1 次提交
  3. 08 2月, 2016 1 次提交
  4. 05 2月, 2016 2 次提交
    • M
      systemd: Modernize machine naming · c3bd0019
      Martin Kletzander 提交于
      So, systemd-machined has this philosophy that machine names are like
      hostnames and hence should follow the same rules.  But we always allowed
      international characters in domain names.  Thus we need to modify the
      machine name we are passing to systemd.
      
      In order to change some machine names that we will be passing to systemd,
      we also need to call TerminateMachine at the end of a lifetime of a
      domain.  Even for domains that were started with older libvirt.  That
      can be achieved thanks to virSystemdGetMachineNameByPID().  And because
      we can change machine names, we can get rid of the inconsistent and
      pointless escaping of domain names when creating machine names.
      
      So this patch modifies the naming in the following way.  It creates the
      name as <drivername>-<id>-<name> where invalid hostname characters are
      stripped out of the name and if the resulting name is longer, it
      truncates it to 64 characters.  That way we can start domains we
      couldn't start before.  Well, at least on systemd.
      
      To make it work all together, the machineName (which is needed only with
      systemd) is saved in domain's private data.  That way the generation is
      moved to the driver and we don't need to pass various unnecessary
      arguments to cgroup functions.
      
      The only thing this complicates a bit is the scope generation when
      validating a cgroup where we must check both old and new naming, so a
      slight modification was needed there.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1282846Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      c3bd0019
    • D
      conf: add caps to virDomainObjFormat/SaveStatus · 1036ddad
      Daniel P. Berrange 提交于
      The virDomainObjFormat and virDomainSaveStatus methods
      both call into virDomainDefFormat, so should be providing
      a non-NULL virCapsPtr instance.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      1036ddad
  5. 04 2月, 2016 2 次提交
  6. 27 1月, 2016 1 次提交
    • D
      lxc: don't try to hide parent cgroups inside container · dc576025
      Daniel P. Berrange 提交于
      On the host when we start a container, it will be
      placed in a cgroup path of
      
         /machine.slice/machine-lxc\x2ddemo.scope
      
      under /sys/fs/cgroup/*
      
      Inside the containers' namespace we need to setup
      /sys/fs/cgroup mounts, and currently will bind
      mount /machine.slice/machine-lxc\x2ddemo.scope on
      the host to appear as / in the container.
      
      While this may sound nice, it confuses applications
      dealing with cgroups, because /proc/$PID/cgroup
      now does not match the directory in /sys/fs/cgroup
      
      This particularly causes problems for systems and
      will make it create repeated path components in
      the cgroup for apps run in the container eg
      
        /machine.slice/machine-lxc\x2ddemo.scope/machine.slice/machine-lxc\x2ddemo.scope/user.slice/user-0.slice/session-61.scope
      
      This also causes any systemd service that uses
      sd-notify to fail to start, because when systemd
      receives the notification it won't be able to
      identify the corresponding unit it came from.
      In particular this break rabbitmq-server startup
      
      Future kernels will provide proper cgroup namespacing
      which will handle this problem, but until that time
      we should not try to play games with hiding parent
      cgroups.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      dc576025
  7. 26 1月, 2016 1 次提交
  8. 22 1月, 2016 4 次提交
  9. 15 1月, 2016 2 次提交
  10. 12 1月, 2016 1 次提交
  11. 11 1月, 2016 1 次提交
  12. 18 12月, 2015 1 次提交
    • J
      lxc_cgroup: Add check for NULL cgroup before AddTask call · ae09988e
      John Ferlan 提交于
      Commit id '71ce4759' altered the cgroup processing with respect to the
      call to virCgroupAddTask being moved out from lower layers into the calling
      layers especially for qemu processing of emulator and vcpu threads. The
      movement affected lxc insomuch as it is possible for a code path to
      return a NULL cgroup *and* a 0 return status via virCgroupNewPartition
      failure when virCgroupNewIgnoreError succeeded when virCgroupNewMachineManual
      returns. Coverity pointed out that would cause virCgroupAddTask to core.
      
      This patch will check for a NULL cgroup as well as the negative return
      and just return the NULL cgroup to the caller (as it would have previously)
      ae09988e
  13. 15 12月, 2015 1 次提交
  14. 11 12月, 2015 2 次提交
  15. 09 12月, 2015 4 次提交
  16. 18 11月, 2015 2 次提交
    • R
      lxc: Bind mount container TTYs · 370707a7
      Richard Weinberger 提交于
      Instead of creating symlinks, bind mount the devices to
      /dev/pts/XY.
      Using bind mounts it is no longer needed to add pts devices
      to files like /etc/securetty.
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      370707a7
    • R
      lxc: Don't make container's TTY a controlling TTY · ea542455
      Richard Weinberger 提交于
      Userspace does not expect that the initial console
      is a controlling TTY. systemd can deal with that, others not.
      On sysv init distros getty will fail to spawn a controlling on
      /dev/console or /dev/tty1. Which will cause to whole container
      to reboot upon ctrl-c.
      
      This patch changes the behavior of libvirt to match the kernel
      behavior where the initial TTY is also not controlling.
      
      The only user visible change should be that a container with
      bash as PID 1 would complain. But this matches exactly the kernel
      be behavior with init=/bin/bash.
      To get a controlling TTY for bash just run "setsid /bin/bash".
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      ea542455
  17. 21 10月, 2015 1 次提交
  18. 07 10月, 2015 1 次提交
  19. 24 9月, 2015 2 次提交
  20. 22 9月, 2015 1 次提交
  21. 15 9月, 2015 1 次提交
  22. 05 9月, 2015 1 次提交
    • J
      lxc: Avoid Coverity SIZEOF_MISMATCH · 11822fff
      John Ferlan 提交于
      Commit id '692e9fac' used virProcessSetNamespaces instead of inlining
      the similar functionality; however, Coverity notes that the function
      prototype expects a size_t value and not an enum and complains. So,
      just typecast the enum as a size_t to avoid the noise.
      11822fff
  23. 02 9月, 2015 1 次提交
    • J
      qemu: add udp interface support · 5c668a78
      Jonathan Toppins 提交于
      Adds a new interface type using UDP sockets, this seems only applicable
      to QEMU but have edited tree-wide to support the new interface type.
      
      The interface type required the addition of a "localaddr" (local
      address), this then maps into the following xml and qemu call.
      
      <interface type='udp'>
        <mac address='52:54:00:5c:67:56'/>
        <source address='127.0.0.1' port='11112'>
          <local address='127.0.0.1' port='22222'/>
        </source>
        <model type='virtio'/>
        <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
      </interface>
      
      QEMU call:
      	-net socket,udp=127.0.0.1:11112,localaddr=127.0.0.1:22222
      
      Notice the xml "local" entry becomes the "localaddr" for the qemu call.
      
      reference:
      http://lists.gnu.org/archive/html/qemu-devel/2011-11/msg00629.htmlSigned-off-by: NJonathan Toppins <jtoppins@cumulusnetworks.com>
      Signed-off-by: NJán Tomko <jtomko@redhat.com>
      5c668a78
  24. 28 8月, 2015 1 次提交
  25. 27 8月, 2015 3 次提交