]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
loop: adapt to new config rootfs parser
authorChristian Brauner <christian.brauner@ubuntu.com>
Tue, 28 Nov 2017 00:16:34 +0000 (01:16 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Fri, 15 Dec 2017 11:31:02 +0000 (12:31 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Adrian Reber <areber@redhat.com>
src/lxc/storage/loop.c

index 68a1b0ffecc120d3311a8d07a1343e3de142edc8..f98ebcb273bfc3e4c4322a659db9f08456ab0742 100644 (file)
@@ -204,7 +204,13 @@ int loop_create(struct lxc_storage *bdev, const char *dest, const char *n,
 }
 
 int loop_destroy(struct lxc_storage *orig) {
-       return unlink(orig->src + 5);
+       char *dir;
+
+       dir = orig->src;
+       if (strncmp(orig->src, "loop:", 5) == 0)
+               dir += 5;
+
+       return unlink(dir);
 }
 
 bool loop_detect(const char *path)