[lxc-devel] [lxc/master] use more accurate bdev_type name for rootfs.bdev

hallyn on Github lxc-bot at linuxcontainers.org
Sat Apr 2 21:09:17 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 395 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160402/fee0baac/attachment.bin>
-------------- next part --------------
From b3b8c97f08457274a9fe6aebdb118a0af51e40be Mon Sep 17 00:00:00 2001
From: Serge Hallyn <serge.hallyn at ubuntu.com>
Date: Sat, 2 Apr 2016 16:08:18 -0500
Subject: [PATCH] use more accurate bdev_type name for rootfs.bdev

It'll make future code reading easier.

Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
---
 src/lxc/bdev/bdev.c | 4 ++--
 src/lxc/conf.c      | 2 +-
 src/lxc/conf.h      | 4 ++--
 src/lxc/confile.c   | 8 ++++----
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/lxc/bdev/bdev.c b/src/lxc/bdev/bdev.c
index d57386c..1114a41 100644
--- a/src/lxc/bdev/bdev.c
+++ b/src/lxc/bdev/bdev.c
@@ -858,8 +858,8 @@ static const struct bdev_type *bdev_query(struct lxc_conf *conf, const char *src
 {
 	int i;
 
-	if (conf->rootfs.bdev)
-		return get_bdev_by_name(conf->rootfs.bdev);
+	if (conf->rootfs.bdev_type)
+		return get_bdev_by_name(conf->rootfs.bdev_type);
 
 	for (i = 0; i < numbdevs; i++) {
 		int r;
diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index 98cd384..ff2bcf3 100644
--- a/src/lxc/conf.c
+++ b/src/lxc/conf.c
@@ -4142,7 +4142,7 @@ void lxc_conf_free(struct lxc_conf *conf)
 	free(conf->console.log_path);
 	free(conf->console.path);
 	free(conf->rootfs.mount);
-	free(conf->rootfs.bdev);
+	free(conf->rootfs.bdev_type);
 	free(conf->rootfs.options);
 	free(conf->rootfs.path);
 	free(conf->logfile);
diff --git a/src/lxc/conf.h b/src/lxc/conf.h
index 50516fd..2593ce5 100644
--- a/src/lxc/conf.h
+++ b/src/lxc/conf.h
@@ -220,13 +220,13 @@ struct lxc_console {
  * @path       : the rootfs source (directory or device)
  * @mount      : where it is mounted
  * @options    : mount options
- * @bev        : optional backing store type
+ * @bev_type   : optional backing store type
  */
 struct lxc_rootfs {
 	char *path;
 	char *mount;
 	char *options;
-	char *bdev;
+	char *bdev_type;
 };
 
 /*
diff --git a/src/lxc/confile.c b/src/lxc/confile.c
index 15f2e7b..64cce02 100644
--- a/src/lxc/confile.c
+++ b/src/lxc/confile.c
@@ -73,7 +73,7 @@ static int config_fstab(const char *, const char *, struct lxc_conf *);
 static int config_rootfs(const char *, const char *, struct lxc_conf *);
 static int config_rootfs_mount(const char *, const char *, struct lxc_conf *);
 static int config_rootfs_options(const char *, const char *, struct lxc_conf *);
-static int config_rootfs_bdev(const char *, const char *, struct lxc_conf *);
+static int config_rootfs_bdev_type(const char *, const char *, struct lxc_conf *);
 static int config_pivotdir(const char *, const char *, struct lxc_conf *);
 static int config_utsname(const char *, const char *, struct lxc_conf *);
 static int config_hook(const char *, const char *, struct lxc_conf *lxc_conf);
@@ -132,7 +132,7 @@ static struct lxc_config_t config[] = {
 	{ "lxc.mount",                config_fstab                },
 	{ "lxc.rootfs.mount",         config_rootfs_mount         },
 	{ "lxc.rootfs.options",       config_rootfs_options       },
-	{ "lxc.rootfs.bdev",          config_rootfs_bdev          },
+	{ "lxc.rootfs.bdev",          config_rootfs_bdev_type     },
 	{ "lxc.rootfs",               config_rootfs               },
 	{ "lxc.pivotdir",             config_pivotdir             },
 	{ "lxc.utsname",              config_utsname              },
@@ -1856,7 +1856,7 @@ static int config_rootfs_options(const char *key, const char *value,
 	return config_string_item(&lxc_conf->rootfs.options, value);
 }
 
-static int config_rootfs_bdev(const char *key, const char *value,
+static int config_rootfs_bdev_type(const char *key, const char *value,
 			       struct lxc_conf *lxc_conf)
 {
 	if (!is_valid_bdev_type(value)) {
@@ -1864,7 +1864,7 @@ static int config_rootfs_bdev(const char *key, const char *value,
 		return -1;
 	}
 
-	return config_string_item(&lxc_conf->rootfs.bdev, value);
+	return config_string_item(&lxc_conf->rootfs.bdev_type, value);
 }
 
 static int config_pivotdir(const char *key, const char *value,


More information about the lxc-devel mailing list