public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2 lib/config/config.c lib/config/config.h t ...
@ 2009-07-27 21:02 wysochanski
0 siblings, 0 replies; only message in thread
From: wysochanski @ 2009-07-27 21:02 UTC (permalink / raw)
To: lvm-devel, lvm2-cvs
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: wysochanski@sourceware.org 2009-07-27 21:01:59
Modified files:
lib/config : config.c config.h
tools : lvmcmdline.c
Log message:
Rename _override_settings into override_config_tree_from_string and move.
Move _override_settings from tools/lvmcmdline.c into lib/config/config.c
and export so we can re-use in liblvm.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/config/config.c.diff?cvsroot=lvm2&r1=1.74&r2=1.75
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/config/config.h.diff?cvsroot=lvm2&r1=1.27&r2=1.28
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvmcmdline.c.diff?cvsroot=lvm2&r1=1.103&r2=1.104
--- LVM2/lib/config/config.c 2009/07/09 11:29:00 1.74
+++ LVM2/lib/config/config.c 2009/07/27 21:01:56 1.75
@@ -186,6 +186,17 @@
return cft;
}
+int override_config_tree_from_string(struct cmd_context *cmd,
+ const char *config_settings)
+{
+ if (!(cmd->cft_override = create_config_tree_from_string(cmd,config_settings))) {
+ log_error("Failed to set overridden configuration entries.");
+ return 1;
+ }
+
+ return 0;
+}
+
int read_config_fd(struct config_tree *cft, struct device *dev,
off_t offset, size_t size, off_t offset2, size_t size2,
checksum_fn_t checksum_fn, uint32_t checksum)
--- LVM2/lib/config/config.h 2009/07/09 11:29:00 1.27
+++ LVM2/lib/config/config.h 2009/07/27 21:01:58 1.28
@@ -56,6 +56,8 @@
struct config_tree *create_config_tree(const char *filename, int keep_open);
struct config_tree *create_config_tree_from_string(struct cmd_context *cmd,
const char *config_settings);
+int override_config_tree_from_string(struct cmd_context *cmd,
+ const char *config_settings);
void destroy_config_tree(struct config_tree *cft);
typedef uint32_t (*checksum_fn_t) (uint32_t initial, const void *buf, uint32_t size);
--- LVM2/tools/lvmcmdline.c 2009/07/27 21:01:36 1.103
+++ LVM2/tools/lvmcmdline.c 2009/07/27 21:01:58 1.104
@@ -887,16 +887,6 @@
return ret;
}
-static int _override_settings(struct cmd_context *cmd, const char *config_settings)
-{
- if (!(cmd->cft_override = create_config_tree_from_string(cmd, config_settings))) {
- log_error("Failed to set overridden configuration entries.");
- return EINVALID_CMD_LINE;
- }
-
- return 0;
-}
-
static void _apply_settings(struct cmd_context *cmd)
{
init_debug(cmd->current_settings.debug);
@@ -986,9 +976,11 @@
set_cmd_name(cmd->command->name);
if (arg_count(cmd, config_ARG))
- if ((ret = _override_settings(cmd,
- arg_str_value(cmd, config_ARG, ""))))
+ if ((ret = override_config_tree_from_string(cmd,
+ arg_str_value(cmd, config_ARG, "")))) {
+ ret = EINVALID_CMD_LINE;
goto_out;
+ }
if (arg_count(cmd, config_ARG) || !cmd->config_valid || config_files_changed(cmd)) {
/* Reinitialise various settings inc. logging, filters */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-07-27 21:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-27 21:02 LVM2 lib/config/config.c lib/config/config.h t wysochanski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).