Unverified Commit ef72d7d6 by Christian Brauner Committed by Stéphane Graber

storage: add lxc_storage_get_path()

parent 187439b5
......@@ -609,3 +609,14 @@ bool rootfs_is_blockdev(struct lxc_conf *conf)
return false;
}
char *lxc_storage_get_path(char *src, const char *prefix)
{
size_t prefix_len;
prefix_len = strlen(prefix);
if (!strncmp(src, prefix, prefix_len) && (*(src + prefix_len) == ':'))
return (src + prefix_len + 1);
return src;
}
......@@ -125,5 +125,6 @@ bool bdev_destroy(struct lxc_conf *conf);
/* callback function to be used with userns_exec_1() */
int bdev_destroy_wrapper(void *data);
extern bool rootfs_is_blockdev(struct lxc_conf *conf);
extern char *lxc_storage_get_path(char *src, const char *prefix);
#endif // __LXC_BDEV_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment