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