1. 19 7月, 2016 1 次提交
  2. 02 7月, 2016 1 次提交
    • L
      util: new function virNetDevIPInfoAddToDev · 95309424
      Laine Stump 提交于
      This patch takes the code out of
      lxcContainerRenameAndEnableInterfaces() that adds all IP addresses and
      IP routes to the interface, and puts it into a utility function
      virNetDevIPInfoAddToDev() in virnetdevip.c so that it can be used by
      anyone.
      
      One small change in functionality -
      lxcContainerRenameAndEnableInterfaces() previously would add all IP
      addresses to the interface while it was still offline, then set the
      interface online, and then add the routes. Because I don't want the
      utility function to set the interface online, I've moved this up so
      the interface is first set online, then IP addresses and routes are
      added. This is the same order that the network service from
      initscripts (in ifup-ether) does it, so it shouldn't pose any problem
      (and hasn't, in the tests that I've run).
      
      (This patch had been pushed earlier in commit
      f1e0d0da, but was reverted in commit
      05eab475 because it had been
      accidentally pushed during the freeze for release 2.0.0)
      95309424
  3. 27 6月, 2016 9 次提交
    • J
      Revert "util: new function virNetDevIPInfoAddToDev" · 05eab475
      Ján Tomko 提交于
      This reverts commit f1e0d0da.
      
      This feature was accidentally pushed in the feature freeze.
      05eab475
    • L
      util: new function virNetDevIPInfoAddToDev · f1e0d0da
      Laine Stump 提交于
      This patch takes the code out of
      lxcContainerRenameAndEnableInterfaces() that adds all IP addresses and
      IP routes to the interface, and puts it into a utility function
      virNetDevIPInfoAddToDev() in virnetdevip.c so that it can be used by
      anyone.
      
      One small change in functionality -
      lxcContainerRenameAndEnableInterfaces() previously would add all IP
      addresses to the interface while it was still offline, then set the
      interface online, and then add the routes. Because I don't want the
      utility function to set the interface online, I've moved this up so
      the interface is first set online, then IP addresses and routes are
      added. This is the same order that the network service from
      initscripts (in ifup-ether) does it, so it shouldn't pose any problem
      (and hasn't, in the tests that I've run).
      f1e0d0da
    • L
      lxc: move debug/error log when adding IP addresses to virNetDevIPAddrAdd · 4ff9ec7d
      Laine Stump 提交于
      It makes more sense to have the logging at the lower level so other
      callers can share the goodness.
      
      While removing so much stuff from / touching so many lines in
      lxcContainerRenameAndEnableInterfaces() (which used to have this
      debug/error logging), label names were changed and it was updated to
      use the now-more-common method of initializing ret to -1 (failure),
      then setting to 0 right before the cleanup label.
      4ff9ec7d
    • L
      conf: use virNetDevIPInfo for guest-side <interface> config · fbc1843d
      Laine Stump 提交于
      All the same information was already there, just in slightly different
      places in the virDomainNetDef.
      fbc1843d
    • L
      util: move IP route & address object-related functions to virnetdevip.c · fa18e814
      Laine Stump 提交于
      These functions all need to be called from a utility function that
      must be located in the util directory, so we move them all into
      util/virnetdevip.[ch] now that it exists.
      
      Function and struct names were appropriately changed for the new
      location, but all code is unchanged aside from motion and renaming.
      fa18e814
    • L
      util: new files virnetdevip.[ch] for IP-related netdev functions · cf0568b0
      Laine Stump 提交于
      This patch splits virnetdev.[ch] into multiple files, with the new
      virnetdevip.[ch] containing all the functions related to setting and
      retrieving IP-related info for a device (both addresses and routes).
      cf0568b0
    • L
      lxc: use correct prefix when setting veth IP address · 70a2c7e0
      Laine Stump 提交于
      Commit c9a641 (first appearred in 1.2.12) added support for setting
      the guest-side IP address of veth devices in lxc domains.
      Unfortunately, it hardcoded the assumption that the proper prefix for
      any IP address with no explicit prefix in the config should be "24";
      that is only correct for class C IPv4 addresses, but not for any other
      IPv4 address, nor for any IPv6 address.
      
      The good news is that there is already a function in libvirt that will
      determine the proper default prefix for any IP address. This patch
      replaces the use of the ill-fated VIR_SOCKET_ADDR_DEFAULT_PREFIX with
      calls to virSocketAddrGetIPPrefix().
      70a2c7e0
    • L
      lxc: eliminate extraneous free of netDef->ifname_guest · f03a4a2a
      Laine Stump 提交于
      lxcContainerRenameAndEnableInterfaces() isn't making a copy of the
      interface's ifname_guest (into newname), it's just copying the pointer
      to it. This means that when it later calls VIR_FREE(newname), it's
      actually freeing up (and fortunately NULLing out, so at least we don't
      try to access free'd memory) netDef->ifname_guest.
      f03a4a2a
    • L
      global: consistently use IP rather than Ip in identifiers · 22a6873a
      Laine Stump 提交于
      I'm tired of mistyping this all the time, so let's do it the same all
      the time (similar to how we changed all "Pci" to "PCI" awhile back).
      
      (NB: I've left alone some things in the esx and vbox drivers because
      I'm unable to compile them and they weren't obviously *not* a part of
      some API. I also didn't change a couple of variables named,
      e.g. "somethingIptables", because they were derived from the name of
      the "iptables" command)
      22a6873a
  4. 20 5月, 2016 1 次提交
  5. 30 4月, 2016 1 次提交
    • L
      Revert "lxc domain allow to set peer address" · 70aa318b
      Laine Stump 提交于
      This reverts commit afee47d0, which
      added support to lxc for the "peer" attribute in domain interface <ip>
      elements.
      
      It's being removed temporarily for the release of libvirt 1.3.4
      because the feature doesn't work, and there are concerns that it may
      need to be modified in an externally visible manner which could create
      backward compatibility problems.
      70aa318b
  6. 08 4月, 2016 2 次提交
  7. 08 3月, 2016 1 次提交
  8. 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
  9. 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
  10. 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
  11. 27 8月, 2015 3 次提交
  12. 26 8月, 2015 2 次提交
    • D
      lxc: ensure setns() syscall is defined · eff95ac8
      Daniel P. Berrange 提交于
      Older versions of glibc don't provide the setns() syscall
      function wrapper, so we must define it ourselves to prevent
      build failure on old distros.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      eff95ac8
    • I
      lxc: Inherit namespace feature · c27553b6
      ik.nitk 提交于
      This patch adds feature for lxc containers to inherit namespaces.
      This is very similar to what lxc-tools or docker provides.  Look
      for "man lxc-start" and you will find that you can pass command
      args as [ --share-[net|ipc|uts] name|pid ]. Or check out docker
      networking option in which you can give --net=container:NAME_or_ID
      as an option for sharing +namespace.
      
      >From this patch you can add extra libvirt option to share
      namespace in following way.
      
       <lxc:namespace>
         <lxc:sharenet type='netns' value='red'/>
         <lxc:shareipc type='pid' value='12345'/>
         <lxc:shareuts type='name' value='container1'/>
       </lxc:namespace>
      
      The netns option is specific to sharenet. It can be used to
      inherit from existing network namespace.
      
      Co-authored: Daniel P. Berrange <berrange@redhat.com>
      c27553b6
  13. 16 6月, 2015 1 次提交
  14. 07 5月, 2015 1 次提交
  15. 27 1月, 2015 1 次提交
    • D
      lxc: more logging during startup paths · e4fc4f0c
      Daniel P. Berrange 提交于
      Add more logging to the lxc controller and container files to
      facilitate debugging startup problems. Also make it clear when
      the container is going to close stdout and thus no longer do
      any logging.
      e4fc4f0c
  16. 16 1月, 2015 1 次提交
  17. 12 1月, 2015 1 次提交
  18. 06 1月, 2015 3 次提交
  19. 10 12月, 2014 1 次提交
    • C
      lxc: give RW access to /proc/sys/net/ipv[46] to containers · ba9b7252
      Cédric Bosdonnat 提交于
      Some programs want to change some values for the network interfaces
      configuration in /proc/sys/net/ipv[46] folders. Giving RW access on them
      allows wicked to work on openSUSE 13.2+.
      
      Reusing the lxcNeedNetworkNamespace function to tell
      lxcContainerMountBasicFS if the netns is disabled. When no netns is
      set up, then we don't mount the /proc/sys/net/ipv[46] folder RW as
      these would provide full access to the host NICs config.
      ba9b7252
  20. 28 11月, 2014 1 次提交
    • J
      Fix usage of virReportSystemError · 9340528a
      Jiri Denemark 提交于
      virReportSystemError is reserved for reporting system errors, calling it
      with VIR_ERR_* error codes produces error messages that do not make any
      sense, such as
      
          internal error: guest failed to start: Kernel doesn't support user
          namespace: Link has been severed
      
      We should prohibit wrong usage with a syntax-check rule.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      9340528a
  21. 25 11月, 2014 2 次提交
    • C
      lxc: don't unmount subtree if it contains the source of the mount · e50457dd
      Cédric Bosdonnat 提交于
      The typical case where we had a problem is with such a filesystem
      definition as created by virt-sandbox-service:
      
          <filesystem type='bind' accessmode='passthrough'>
            <source dir='/var/lib/libvirt/filesystems/mysshd/var'/>
            <target dir='/var'/>
          </filesystem>
      
      In this case, we don't want to unmount the /var subtree or we may
      loose the access to the source folder.
      e50457dd
    • C
      lxc: be more patient while resolving symlinks · 72fecf18
      Cédric Bosdonnat 提交于
      Resolving symlinks can fail before mounting any file system if one file
      system depends on another being mounted. Symlinks are now resolved in
      two passes:
      
        * Before any file system is mounted, but then we are more gentle if
          the source path can't be accessed
        * Right before mounting a file system, so that we are sure that we
          have the resolved path... but then if it can't be accessed we raise
          an error.
      72fecf18
  22. 15 11月, 2014 1 次提交
  23. 04 11月, 2014 1 次提交
  24. 31 10月, 2014 1 次提交