• D
    Fix startup of LXC containers with filesystems containing symlinks · c53ba61b
    Daniel P. Berrange 提交于
    Given an LXC guest with a root filesystem path of
    
      /export/lxc/roots/helloworld/root
    
    During startup, we will pivot the root filesystem to end up
    at
    
      /.oldroot/export/lxc/roots/helloworld/root
    
    We then try to open
    
      /.oldroot/export/lxc/roots/helloworld/root/dev/pts
    
    Now consider if '/export/lxc' is an absolute symlink pointing
    to '/media/lxc'. The kernel will try to open
    
      /media/lxc/roots/helloworld/root/dev/pts
    
    whereas it should be trying to open
    
      /.oldroot//media/lxc/roots/helloworld/root/dev/pts
    
    To deal with the fact that the root filesystem can be moved,
    we need to resolve symlinks in *any* part of the filesystem
    source path.
    
    * src/libvirt_private.syms, src/util/util.c,
      src/util/util.h: Add virFileResolveAllLinks to resolve
      all symlinks in a path
    * src/lxc/lxc_container.c: Resolve all symlinks in filesystem
      paths during startup
    c53ba61b
libvirt_private.syms 30.9 KB