]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
ensure btrfs subvolume is removed when container creating fails
authorFrederic Crozat <fcrozat@suse.com>
Wed, 14 Nov 2012 15:11:08 +0000 (16:11 +0100)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 14 Nov 2012 15:54:54 +0000 (10:54 -0500)
Signed-off-by: Frederic Crozat <fcrozat@suse.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/lxc-create.in

index e3b50ab627b08eb30bbbb9392f13bf3641e2ad90..101e48942375409359ea6f0ca6d9ed7be547a4e8 100644 (file)
@@ -249,6 +249,8 @@ cleanup() {
     if [ $backingstore = "lvm" ]; then
         umount $rootfs
         lvremove -f $rootdev
+    elif [ $backingstore = "btrfs" ]; then
+        btrfs subvolume delete "$rootfs"
     fi
     ${bindir}/lxc-destroy -n $lxc_name
     echo "$(basename $0): aborted" >&2