Unverified Commit 187439b5 by Christian Brauner Committed by Stéphane Graber

storage: add storage_utils.{c.h}

non-functional changes Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent 65883989
......@@ -17,6 +17,7 @@ noinst_HEADERS = \
bdev/lxcrbd.h \
bdev/lxcrsync.h \
bdev/lxczfs.h \
bdev/storage_utils.h \
cgroups/cgroup.h \
caps.h \
conf.h \
......@@ -82,6 +83,7 @@ liblxc_la_SOURCES = \
bdev/lxcrbd.c bdev/lxcrbd.h \
bdev/lxcrsync.c bdev/lxcrsync.h \
bdev/lxczfs.c bdev/lxczfs.h \
bdev/storage_utils.c bdev/storage_utils.h \
cgroups/cgfs.c \
cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \
......
......@@ -124,26 +124,6 @@ bool bdev_destroy(struct lxc_conf *conf);
/* callback function to be used with userns_exec_1() */
int bdev_destroy_wrapper(void *data);
/* Some helpers for lvm, rdb, and/or loop:
* Maybe they should move to a separate implementation and header-file
* (bdev_utils.{c,h}) which can be included in bdev.c?
*/
int blk_getsize(struct bdev *bdev, uint64_t *size);
int detect_fs(struct bdev *bdev, char *type, int len);
int do_mkfs_exec_wrapper(void *args);
int is_blktype(struct bdev *b);
int mount_unknown_fs(const char *rootfs, const char *target,
const char *options);
bool rootfs_is_blockdev(struct lxc_conf *conf);
/*
* these are really for qemu-nbd support, as container shutdown
* must explicitly request device detach.
*/
bool attach_block_device(struct lxc_conf *conf);
void detach_block_device(struct lxc_conf *conf);
bool is_valid_bdev_type(const char *type);
extern bool rootfs_is_blockdev(struct lxc_conf *conf);
#endif // __LXC_BDEV_H
......@@ -34,6 +34,7 @@
#include "bdev.h"
#include "log.h"
#include "lxcloop.h"
#include "storage_utils.h"
#include "utils.h"
lxc_log_define(lxcloop, lxc);
......
......@@ -36,6 +36,7 @@
#include "config.h"
#include "log.h"
#include "lxclvm.h"
#include "storage_utils.h"
#include "utils.h"
/* major()/minor() */
......
......@@ -34,6 +34,7 @@
#include "bdev.h"
#include "log.h"
#include "lxcnbd.h"
#include "storage_utils.h"
#include "utils.h"
lxc_log_define(lxcnbd, lxc);
......
......@@ -31,6 +31,7 @@
#include "bdev.h"
#include "log.h"
#include "storage_utils.h"
#include "utils.h"
lxc_log_define(lxcrbd, lxc);
......
/*
* lxc: linux Container library
*
* Copyright © 2017 Canonical Ltd.
*
* Authors:
* Christian Brauner <christian.brauner@ubuntu.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __LXC_STORAGE_UTILS_H
#define __LXC_STORAGE_UTILS_H
#include "config.h"
#include <stdio.h>
#include <stdbool.h>
#include <stdint.h>
#include "conf.h"
struct bdev;
struct lxc_conf;
extern char *dir_new_path(char *src, const char *oldname, const char *name,
const char *oldpath, const char *lxcpath);
extern bool attach_block_device(struct lxc_conf *conf);
extern void detach_block_device(struct lxc_conf *conf);
extern int blk_getsize(struct bdev *bdev, uint64_t *size);
extern int detect_fs(struct bdev *bdev, char *type, int len);
extern int do_mkfs_exec_wrapper(void *args);
extern int is_blktype(struct bdev *b);
extern int mount_unknown_fs(const char *rootfs, const char *target,
const char *options);
extern int find_fstype_cb(char *buffer, void *data);
extern char *linkderef(char *path, char *dest);
extern bool unpriv_snap_allowed(struct bdev *b, const char *t, bool snap,
bool maybesnap);
extern bool is_valid_bdev_type(const char *type);
extern int bdev_destroy_wrapper(void *data);
#endif // __LXC_STORAGE_UTILS_H
......@@ -39,6 +39,7 @@
#include <dirent.h>
#include "bdev.h"
#include "bdev/storage_utils.h"
#include "parse.h"
#include "config.h"
#include "confile.h"
......
......@@ -64,6 +64,7 @@
#include "console.h"
#include "error.h"
#include "log.h"
#include "lxccontainer.h"
#include "lxclock.h"
#include "lxcseccomp.h"
#include "lxcutmp.h"
......@@ -71,6 +72,7 @@
#include "monitor.h"
#include "namespace.h"
#include "start.h"
#include "storage_utils.h"
#include "sync.h"
#include "utils.h"
#include "lsm/lsm.h"
......
......@@ -30,6 +30,7 @@
#include "bdev.h"
#include "log.h"
#include "lxc.h"
#include "storage_utils.h"
#include "utils.h"
lxc_log_define(lxc_create_ui, lxc);
......
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