storage: keep a reference to lxc_rootfs in lxc_storage

parent 1633166b
...@@ -598,14 +598,13 @@ struct lxc_storage *storage_init(struct lxc_conf *conf) ...@@ -598,14 +598,13 @@ struct lxc_storage *storage_init(struct lxc_conf *conf)
if (!q) if (!q)
return NULL; return NULL;
bdev = malloc(sizeof(struct lxc_storage)); bdev = zalloc(sizeof(struct lxc_storage));
if (!bdev) if (!bdev)
return NULL; return NULL;
memset(bdev, 0, sizeof(struct lxc_storage)); bdev->ops = q->ops;
bdev->type = q->name;
bdev->ops = q->ops; bdev->rootfs = &conf->rootfs;
bdev->type = q->name;
if (mntopts) if (mntopts)
bdev->mntopts = strdup(mntopts); bdev->mntopts = strdup(mntopts);
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#endif #endif
#include "compiler.h" #include "compiler.h"
#include "conf.h"
#ifndef MS_DIRSYNC #ifndef MS_DIRSYNC
#define MS_DIRSYNC 128 #define MS_DIRSYNC 128
...@@ -87,6 +88,7 @@ struct lxc_storage { ...@@ -87,6 +88,7 @@ struct lxc_storage {
/* index for the connected nbd device. */ /* index for the connected nbd device. */
int nbd_idx; int nbd_idx;
int flags; int flags;
struct lxc_rootfs *rootfs;
}; };
/** /**
......
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