1. 21 Aug, 2013 1 commit
    • Track snapshot dependencies (v2) · dfb31b25
      Serge Hallyn authored
      (Will push in a bit barring any objections)
      
      lvm, btrfs, and zfs snapshots each do an ok job of handling deletions
      for us - a btrfs snapshot does fine after the original is removed,
      while zfs and lvm will both refuse to allow the original to be deleted
      while the snapshot exists.
      
      Overlayfs doesn't do this for us.  So, for overlayfs snapshots, track
      the dependencies.
      
      When c2 is created as an overlayfs snapshot of dir-backed c1, then
      
      1. c2's lxc_rdepends file will contain
      
      	c1_lxcpath
      	c1_lxcname
      
      2. c1's lxc_snapshots will contain "1"
      
      c1 cannot be deleted so long as lxc_snapshots exists and contains
      a non-zero number.
      
      The contents of lxc_snapshots and lxc_rdepends are protected by
      container_disk_lock() and at lxc_clone by the new container not yet
      being accessible.
      
      (Originally I was going to keep them in the container config, but the
      problem with using $lxcpath/$name/config is that api users could end up
      calling c->save_config() with a cached old value of snapshots/rdepends.)
      
      Changelog:
      	aug 21: check for fprintf and fclose failures
      Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
      Acked-by: 's avatarDwight Engen <dwight.engen@oracle.com>
  2. 20 Aug, 2013 8 commits
  3. 19 Aug, 2013 25 commits
  4. 16 Aug, 2013 5 commits
  5. 15 Aug, 2013 1 commit