master - libdm-config: Interpret barewords after '=' as strings.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8bc996676345bd...
Commit: 8bc996676345bdaa69e0bdaaebb490a9da5a7d4b
Parent: 274a7a68b80fdce9e9398ffbe45e788b13b04642
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Wed Nov 19 18:48:47 2014 +0100
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Thu Nov 20 16:51:06 2014 +0100
libdm-config: Interpret barewords after '=' as strings.
---
libdm/libdm-config.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/libdm/libdm-config.c b/libdm/libdm-config.c
index e6b2b90..1bc88e1 100644
--- a/libdm/libdm-config.c
+++ b/libdm/libdm-config.c
@@ -30,6 +30,7 @@ enum {
TOK_FLOAT,
TOK_STRING, /* Single quotes */
TOK_STRING_ESCAPED, /* Double quotes */
+ TOK_STRING_BARE, /* No quotes */
TOK_EQ,
TOK_SECTION_B,
TOK_SECTION_E,
@@ -638,6 +639,15 @@ static struct dm_config_value *_type(struct parser *p)
match(TOK_STRING);
break;
+ case TOK_STRING_BARE:
+ v->type = DM_CFG_STRING;
+
+ if (!(v->v.str = _dup_tok(p)))
+ return_NULL;
+
+ match(TOK_STRING_BARE);
+ break;
+
case TOK_STRING_ESCAPED:
v->type = DM_CFG_STRING;
@@ -783,6 +793,8 @@ static void _get_token(struct parser *p, int tok_prev)
(*te != SECTION_B_CHAR) &&
(*te != SECTION_E_CHAR))
te++;
+ if (values_allowed)
+ p->t = TOK_STRING_BARE;
break;
}
9 years, 5 months
master - libdm-config: Implement dm_config_flatten.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=274a7a68b80fdc...
Commit: 274a7a68b80fdce9e9398ffbe45e788b13b04642
Parent: 956c19284195f3200a1370166bd8847e5d159588
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Wed Nov 19 18:37:31 2014 +0100
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Thu Nov 20 16:51:06 2014 +0100
libdm-config: Implement dm_config_flatten.
---
libdm/libdevmapper.h | 5 ++++
libdm/libdm-config.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 58 insertions(+), 0 deletions(-)
diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h
index 6e237c0..3400c28 100644
--- a/libdm/libdevmapper.h
+++ b/libdm/libdevmapper.h
@@ -1848,6 +1848,11 @@ struct dm_config_tree *dm_config_insert_cascaded_tree(struct dm_config_tree *fir
*/
struct dm_config_tree *dm_config_remove_cascaded_tree(struct dm_config_tree *cft);
+/*
+ * Create a new, uncascaded config tree equivalent to the input cascade.
+ */
+struct dm_config_tree *dm_config_flatten(struct dm_config_tree *cft);
+
void dm_config_destroy(struct dm_config_tree *cft);
/* Simple output line by line. */
diff --git a/libdm/libdm-config.c b/libdm/libdm-config.c
index c026385..e6b2b90 100644
--- a/libdm/libdm-config.c
+++ b/libdm/libdm-config.c
@@ -1315,3 +1315,56 @@ struct dm_pool *dm_config_memory(struct dm_config_tree *cft)
{
return cft->mem;
}
+
+static int _override_path(const char *path, struct dm_config_node *node, void *baton)
+{
+ struct dm_config_tree *cft = baton;
+ struct dm_config_node dummy, *target;
+ dummy.child = cft->root;
+ if (!(target = _find_or_make_node(cft->mem, &dummy, path)))
+ return_0;
+ if (!(target->v = _clone_config_value(cft->mem, node->v)))
+ return_0;
+ cft->root = dummy.child;
+ return 1;
+}
+
+static int _enumerate(const char *path, struct dm_config_node *cn, int (*cb)(const char *, struct dm_config_node *, void *), void *baton)
+{
+ char *sub = NULL;
+
+ while (cn) {
+ if (dm_asprintf(&sub, "%s/%s", path, cn->key) < 0)
+ return_0;
+ if (cn->child) {
+ if (!_enumerate(sub, cn->child, cb, baton))
+ goto_bad;
+ } else
+ if (!cb(sub, cn, baton))
+ goto_bad;
+ dm_free(sub);
+ cn = cn->sib;
+ }
+ return 1;
+bad:
+ dm_free(sub);
+ return 0;
+}
+
+struct dm_config_tree *dm_config_flatten(struct dm_config_tree *cft)
+{
+ struct dm_config_tree *res = dm_config_create(), *done = NULL, *current = NULL;
+
+ if (!res)
+ return_NULL;
+
+ while (done != cft) {
+ current = cft;
+ while (current->cascade != done)
+ current = current->cascade;
+ _enumerate("", current->root, _override_path, res);
+ done = current;
+ }
+
+ return res;
+}
9 years, 5 months
master - libdm-config: Re-link config trees to reflect file order of keys/sections.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=956c19284195f3...
Commit: 956c19284195f3200a1370166bd8847e5d159588
Parent: 687029cbbd5b97d545363b4f7448b5a1fe71f3c5
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Tue Nov 18 23:39:11 2014 +0100
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Thu Nov 20 16:51:06 2014 +0100
libdm-config: Re-link config trees to reflect file order of keys/sections.
---
libdm/libdm-config.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/libdm/libdm-config.c b/libdm/libdm-config.c
index 4965e32..c026385 100644
--- a/libdm/libdm-config.c
+++ b/libdm/libdm-config.c
@@ -154,6 +154,24 @@ struct dm_config_tree *dm_config_insert_cascaded_tree(struct dm_config_tree *fir
return first_cft;
}
+static struct dm_config_node *_config_reverse(struct dm_config_node *head)
+{
+ if (!head)
+ return NULL;
+
+ struct dm_config_node *left = head, *middle = NULL, *right = NULL;
+
+ do {
+ right = middle;
+ middle = left;
+ left = left->sib;
+ middle->sib = right;
+ middle->child = _config_reverse(middle->child);
+ } while (left);
+
+ return middle;
+};
+
int dm_config_parse(struct dm_config_tree *cft, const char *start, const char *end)
{
/* TODO? if (start == end) return 1; */
@@ -172,6 +190,8 @@ int dm_config_parse(struct dm_config_tree *cft, const char *start, const char *e
if (!(cft->root = _file(p)))
return_0;
+ cft->root = _config_reverse(cft->root);
+
return 1;
}
9 years, 5 months
master - libdm-config: Allow paths (section/key = value) in config files.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=687029cbbd5b97...
Commit: 687029cbbd5b97d545363b4f7448b5a1fe71f3c5
Parent: 9f2961f259ff990d3a21e8edac5f7caa564b0e2e
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Mon Nov 10 07:38:19 2014 +0100
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Thu Nov 20 16:47:30 2014 +0100
libdm-config: Allow paths (section/key = value) in config files.
The order of the resulting tree is based on the first appearance of
sections. With no section repeats, the sections stay as listed in the
config file. Sections using the brace syntax 'section { key = value }' are
treated the same way: 'section { x = 1 } section { y = 2 }' is the same as
'section/x = 1 section/y = 2' is the same as 'section { x = 1 y = 2 }'
---
libdm/libdm-config.c | 165 ++++++++++++++++++++++++++++----------------------
1 files changed, 92 insertions(+), 73 deletions(-)
diff --git a/libdm/libdm-config.c b/libdm/libdm-config.c
index f8d6b1b..4965e32 100644
--- a/libdm/libdm-config.c
+++ b/libdm/libdm-config.c
@@ -61,13 +61,14 @@ struct config_output {
static void _get_token(struct parser *p, int tok_prev);
static void _eat_space(struct parser *p);
static struct dm_config_node *_file(struct parser *p);
-static struct dm_config_node *_section(struct parser *p);
+static struct dm_config_node *_section(struct parser *p, struct dm_config_node *parent);
static struct dm_config_value *_value(struct parser *p);
static struct dm_config_value *_type(struct parser *p);
static int _match_aux(struct parser *p, int t);
static struct dm_config_value *_create_value(struct dm_pool *mem);
static struct dm_config_node *_create_node(struct dm_pool *mem);
static char *_dup_tok(struct parser *p);
+static char *_dup_token(struct dm_pool *mem, const char *b, const char *e);
static const int sep = '/';
@@ -419,71 +420,121 @@ static char *_dup_string_tok(struct parser *p)
static struct dm_config_node *_file(struct parser *p)
{
- struct dm_config_node *root = NULL, *n, *l = NULL;
- while (p->t != TOK_EOF) {
- if (!(n = _section(p)))
+ struct dm_config_node root = { 0 };
+ root.key = "<root>";
+
+ while (p->t != TOK_EOF)
+ if (!_section(p, &root))
return_NULL;
+ return root.child;
+}
+
+static struct dm_config_node *_make_node(struct dm_pool *mem,
+ const char *key_b, const char *key_e,
+ struct dm_config_node *parent)
+{
+ struct dm_config_node *n;
+
+ if (!(n = _create_node(mem)))
+ return_NULL;
- if (!root)
- root = n;
- else
- l->sib = n;
- n->parent = root;
- l = n;
+ n->key = _dup_token(mem, key_b, key_e);
+ if (parent) {
+ n->parent = parent;
+ n->sib = parent->child;
+ parent->child = n;
}
- return root;
+ return n;
+}
+
+/* when mem is not NULL, we create the path if it doesn't exist yet */
+static struct dm_config_node *_find_or_make_node(struct dm_pool *mem,
+ struct dm_config_node *parent,
+ const char *path)
+{
+ const char *e;
+ struct dm_config_node *cn = parent ? parent->child : NULL;
+ struct dm_config_node *cn_found = NULL;
+
+ while (cn || mem) {
+ /* trim any leading slashes */
+ while (*path && (*path == sep))
+ path++;
+
+ /* find the end of this segment */
+ for (e = path; *e && (*e != sep); e++) ;
+
+ /* hunt for the node */
+ cn_found = NULL;
+
+ while (cn) {
+ if (_tok_match(cn->key, path, e)) {
+ /* Inefficient */
+ if (!cn_found)
+ cn_found = cn;
+ else
+ log_warn("WARNING: Ignoring duplicate"
+ " config node: %s ("
+ "seeking %s)", cn->key, path);
+ }
+
+ cn = cn->sib;
+ }
+
+ if (!cn_found && mem) {
+ if (!(cn_found = _make_node(mem, path, e, parent)))
+ return_NULL;
+ }
+
+ if (cn_found && *e) {
+ parent = cn_found;
+ cn = cn_found->child;
+ } else
+ return cn_found;
+ path = e;
+ }
+
+ return NULL;
}
-static struct dm_config_node *_section(struct parser *p)
+static struct dm_config_node *_section(struct parser *p, struct dm_config_node *parent)
{
/* IDENTIFIER SECTION_B_CHAR VALUE* SECTION_E_CHAR */
struct dm_config_node *root, *n, *l = NULL;
char *str;
- if (!(root = _create_node(p->mem))) {
- log_error("Failed to allocate section node");
- return NULL;
- }
-
if (p->t == TOK_STRING_ESCAPED) {
if (!(str = _dup_string_tok(p)))
return_NULL;
dm_unescape_double_quotes(str);
- root->key = str;
match(TOK_STRING_ESCAPED);
} else if (p->t == TOK_STRING) {
if (!(str = _dup_string_tok(p)))
return_NULL;
- root->key = str;
match(TOK_STRING);
} else {
- if (!(root->key = _dup_tok(p)))
+ if (!(str = _dup_tok(p)))
return_NULL;
match(TOK_IDENTIFIER);
}
- if (!strlen(root->key)) {
+ if (!strlen(str)) {
log_error("Parse error at byte %" PRIptrdiff_t " (line %d): empty section identifier",
p->tb - p->fb + 1, p->line);
return NULL;
}
+ root = _find_or_make_node(p->mem, parent, str);
+
if (p->t == TOK_SECTION_B) {
match(TOK_SECTION_B);
while (p->t != TOK_SECTION_E) {
- if (!(n = _section(p)))
+ if (!(n = _section(p, root)))
return_NULL;
-
- if (!l)
- root->child = n;
- else
- l->sib = n;
- n->parent = root;
- l = n;
}
match(TOK_SECTION_E);
} else {
@@ -751,19 +802,24 @@ static struct dm_config_node *_create_node(struct dm_pool *mem)
return dm_pool_zalloc(mem, sizeof(struct dm_config_node));
}
-static char *_dup_tok(struct parser *p)
+static char *_dup_token(struct dm_pool *mem, const char *b, const char *e)
{
- size_t len = p->te - p->tb;
- char *str = dm_pool_alloc(p->mem, len + 1);
+ size_t len = e - b;
+ char *str = dm_pool_alloc(mem, len + 1);
if (!str) {
log_error("Failed to duplicate token.");
return 0;
}
- memcpy(str, p->tb, len);
+ memcpy(str, b, len);
str[len] = '\0';
return str;
}
+static char *_dup_tok(struct parser *p)
+{
+ return _dup_token(p->mem, p->tb, p->te);
+}
+
/*
* Utility functions
*/
@@ -778,46 +834,9 @@ static char *_dup_tok(struct parser *p)
*/
typedef const struct dm_config_node *node_lookup_fn(const void *start, const char *path);
-static const struct dm_config_node *_find_config_node(const void *start,
- const char *path)
-{
- const char *e;
- const struct dm_config_node *cn = start;
- const struct dm_config_node *cn_found = NULL;
-
- while (cn) {
- /* trim any leading slashes */
- while (*path && (*path == sep))
- path++;
-
- /* find the end of this segment */
- for (e = path; *e && (*e != sep); e++) ;
-
- /* hunt for the node */
- cn_found = NULL;
- while (cn) {
- if (_tok_match(cn->key, path, e)) {
- /* Inefficient */
- if (!cn_found)
- cn_found = cn;
- else
- log_warn("WARNING: Ignoring duplicate"
- " config node: %s ("
- "seeking %s)", cn->key, path);
- }
-
- cn = cn->sib;
- }
-
- if (cn_found && *e)
- cn = cn_found->child;
- else
- return cn_found;
-
- path = e;
- }
-
- return NULL;
+static const struct dm_config_node *_find_config_node(const void *start, const char *path) {
+ struct dm_config_node dummy = { .child = (void *) start };
+ return _find_or_make_node(NULL, &dummy, path);
}
static const struct dm_config_node *_find_first_config_node(const void *start, const char *path)
9 years, 5 months
master - cache: check for internal error
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9f2961f259ff99...
Commit: 9f2961f259ff990d3a21e8edac5f7caa564b0e2e
Parent: e55c6999ae62506dd8798451bb95d7a3aa7da765
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Nov 20 16:35:46 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Nov 20 16:35:46 2014 +0100
cache: check for internal error
Don't try to duplicate NULL on internal error path.
---
lib/metadata/lv.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/lib/metadata/lv.c b/lib/metadata/lv.c
index bf2d04e..fb1cd78 100644
--- a/lib/metadata/lv.c
+++ b/lib/metadata/lv.c
@@ -130,7 +130,12 @@ char *lvseg_discards_dup(struct dm_pool *mem, const struct lv_segment *seg)
char *lvseg_cachemode_dup(struct dm_pool *mem, const struct lv_segment *seg)
{
- return dm_pool_strdup(mem, get_cache_pool_cachemode_name(seg));
+ const char *name = get_cache_pool_cachemode_name(seg);
+
+ if (!name)
+ return_NULL;
+
+ return dm_pool_strdup(mem, name);
}
#ifdef DMEVENTD
9 years, 5 months
master - toollib: release vg on ignore path
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e55c6999ae6250...
Commit: e55c6999ae62506dd8798451bb95d7a3aa7da765
Parent: a61c5c5b3a88716697fcebe49c822ad6d5f4f66a
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Nov 20 08:52:44 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Nov 20 08:53:30 2014 +0100
toollib: release vg on ignore path
Missing call to release_vg().
---
tools/toollib.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/tools/toollib.c b/tools/toollib.c
index 30dc980..d33de79 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -2201,6 +2201,7 @@ static int _process_pvs_in_vgs(struct cmd_context *cmd, uint32_t flags,
if (ignore_vg(vg, vg_name, flags & READ_ALLOW_INCONSISTENT, &skip)) {
stack;
ret_max = ECMD_FAILED;
+ release_vg(vg);
continue;
}
9 years, 5 months
master - revert: 7639eae and 4a52a92
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a61c5c5b3a8871...
Commit: a61c5c5b3a88716697fcebe49c822ad6d5f4f66a
Parent: 8d8c1b66241bea0b6b67bde7ebd04b9db10d3208
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Nov 20 08:22:34 2014 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Nov 20 08:22:34 2014 +0100
revert: 7639eae and 4a52a92
Revert 7639eae8919e5872143562db8118d039f5a41225 and
4a52a9212cc5d3ae90196776f28dbfb319002c74. We need a better fix here.
---
configure | 14 +++++++-------
configure.in | 14 +++++++-------
scripts/lvm2_clvmd_systemd_red_hat.service.in | 2 +-
scripts/lvm2_cmirrord_systemd_red_hat.service.in | 2 +-
4 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/configure b/configure
index 42adc6c..a2a094c 100755
--- a/configure
+++ b/configure
@@ -8441,7 +8441,7 @@ $as_echo "$OCF" >&6; }
if test "${with_ocfdir+set}" = set; then :
withval=$with_ocfdir; OCFDIR=$withval
else
- OCFDIR="${prefix}/lib/ocf/resource.d/lvm2"
+ OCFDIR='${prefix}/lib/ocf/resource.d/lvm2'
fi
@@ -11935,7 +11935,7 @@ fi
if test "${with_localedir+set}" = set; then :
withval=$with_localedir; LOCALEDIR=$withval
else
- LOCALEDIR="${prefix}/share/locale"
+ LOCALEDIR='${prefix}/share/locale'
fi
fi
@@ -11955,7 +11955,7 @@ fi
if test "${with_staticdir+set}" = set; then :
withval=$with_staticdir; STATICDIR=$withval
else
- STATICDIR="${exec_prefix}/sbin"
+ STATICDIR='${exec_prefix}/sbin'
fi
@@ -11964,7 +11964,7 @@ fi
if test "${with_usrlibdir+set}" = set; then :
withval=$with_usrlibdir; usrlibdir=$withval
else
- usrlibdir="${prefix}/lib"
+ usrlibdir='${prefix}/lib'
fi
@@ -11973,7 +11973,7 @@ fi
if test "${with_usrsbindir+set}" = set; then :
withval=$with_usrsbindir; usrsbindir=$withval
else
- usrsbindir="${prefix}/sbin"
+ usrsbindir='${prefix}/sbin'
fi
@@ -11983,7 +11983,7 @@ fi
if test "${with_udev_prefix+set}" = set; then :
withval=$with_udev_prefix; udev_prefix=$withval
else
- udev_prefix="${exec_prefix}"
+ udev_prefix='${exec_prefix}'
fi
@@ -12019,7 +12019,7 @@ test -z "$systemdutildir" && systemdutildir='${exec_prefix}/lib/systemd';
if test "${with_tmpfilesdir+set}" = set; then :
withval=$with_tmpfilesdir; tmpfilesdir=$withval
else
- tmpfilesdir="${prefix}/lib/tmpfiles.d"
+ tmpfilesdir='${prefix}/lib/tmpfiles.d'
fi
################################################################################
diff --git a/configure.in b/configure.in
index 952aef9..d4e367d 100644
--- a/configure.in
+++ b/configure.in
@@ -628,7 +628,7 @@ AC_MSG_RESULT($OCF)
AC_ARG_WITH(ocfdir,
AC_HELP_STRING([--with-ocfdir=DIR],
[install OCF files in [PREFIX/lib/ocf/resource.d/lvm2]]),
- OCFDIR=$withval, OCFDIR="${prefix}/lib/ocf/resource.d/lvm2")
+ OCFDIR=$withval, OCFDIR='${prefix}/lib/ocf/resource.d/lvm2')
################################################################################
dnl -- Init pkg-config with dummy invokation:
@@ -1438,7 +1438,7 @@ if test "$INTL" = yes; then
AC_ARG_WITH(localedir,
AC_HELP_STRING([--with-localedir=DIR],
[translation files in DIR [PREFIX/share/locale]]),
- LOCALEDIR=$withval, LOCALEDIR="${prefix}/share/locale")
+ LOCALEDIR=$withval, LOCALEDIR='${prefix}/share/locale')
fi
################################################################################
@@ -1451,23 +1451,23 @@ AC_ARG_WITH(confdir,
AC_ARG_WITH(staticdir,
AC_HELP_STRING([--with-staticdir=DIR],
[static binaries in DIR [EPREFIX/sbin]]),
- STATICDIR=$withval, STATICDIR="${exec_prefix}/sbin")
+ STATICDIR=$withval, STATICDIR='${exec_prefix}/sbin')
AC_ARG_WITH(usrlibdir,
AC_HELP_STRING([--with-usrlibdir=DIR],
[usrlib in DIR [PREFIX/lib]]),
- usrlibdir=$withval, usrlibdir="${prefix}/lib")
+ usrlibdir=$withval, usrlibdir='${prefix}/lib')
AC_ARG_WITH(usrsbindir,
AC_HELP_STRING([--with-usrsbindir=DIR],
[usrsbin executables in DIR [PREFIX/sbin]]),
- usrsbindir=$withval, usrsbindir="${prefix}/sbin")
+ usrsbindir=$withval, usrsbindir='${prefix}/sbin')
################################################################################
AC_ARG_WITH(udev_prefix,
AC_HELP_STRING([--with-udev-prefix=UPREFIX],
[install udev rule files in UPREFIX [EPREFIX]]),
- udev_prefix=$withval, udev_prefix="${exec_prefix}")
+ udev_prefix=$withval, udev_prefix='${exec_prefix}')
AC_ARG_WITH(udevdir,
AC_HELP_STRING([--with-udevdir=DIR],
@@ -1494,7 +1494,7 @@ test -z "$systemdutildir" && systemdutildir='${exec_prefix}/lib/systemd';
AC_ARG_WITH(tmpfilesdir,
AC_HELP_STRING([--with-tmpfilesdir=DIR],
[install configuration files for management of volatile files and directories in DIR [PREFIX/lib/tmpfiles.d]]),
- tmpfilesdir=$withval, tmpfilesdir="${prefix}/lib/tmpfiles.d")
+ tmpfilesdir=$withval, tmpfilesdir='${prefix}/lib/tmpfiles.d')
################################################################################
dnl -- Ensure additional headers required
if test "$READLINE" = yes; then
diff --git a/scripts/lvm2_clvmd_systemd_red_hat.service.in b/scripts/lvm2_clvmd_systemd_red_hat.service.in
index 2da5114..2978d21 100644
--- a/scripts/lvm2_clvmd_systemd_red_hat.service.in
+++ b/scripts/lvm2_clvmd_systemd_red_hat.service.in
@@ -14,7 +14,7 @@ Conflicts=shutdown.target
Type=forking
Environment=CLVMD_OPTS=-T30
EnvironmentFile=-@sysconfdir@/sysconfig/clvmd
-ExecStart=@usrsbindir@/clvmd $CLVMD_OPTS
+ExecStart=@sbindir@/clvmd $CLVMD_OPTS
SuccessExitStatus=5
TimeoutStartSec=30
TimeoutStopSec=10
diff --git a/scripts/lvm2_cmirrord_systemd_red_hat.service.in b/scripts/lvm2_cmirrord_systemd_red_hat.service.in
index e3bf62d..16d38ce 100644
--- a/scripts/lvm2_cmirrord_systemd_red_hat.service.in
+++ b/scripts/lvm2_cmirrord_systemd_red_hat.service.in
@@ -9,7 +9,7 @@ Conflicts=shutdown.target
[Service]
Type=forking
-ExecStart=@usrsbindir@/cmirrord
+ExecStart=@sbindir@/cmirrord
PIDFile=@CMIRRORD_PIDFILE@
Restart=on-abort
9 years, 5 months
master - tests: use snapshot targets
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8d8c1b66241bea...
Commit: 8d8c1b66241bea0b6b67bde7ebd04b9db10d3208
Parent: c75548300d63452b4fa615d71cb40cb10382aa33
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Nov 19 23:24:18 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Nov 19 23:24:18 2014 +0100
tests: use snapshot targets
---
test/shell/lvconvert-snapshot.sh | 2 +-
test/shell/snapshot-usage.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/shell/lvconvert-snapshot.sh b/test/shell/lvconvert-snapshot.sh
index 3d81573..55fcb1a 100644
--- a/test/shell/lvconvert-snapshot.sh
+++ b/test/shell/lvconvert-snapshot.sh
@@ -18,7 +18,7 @@ aux prepare_pvs 1
vgcreate -s 1k $vg $(cat DEVICES)
-lvcreate -V50 -L1 -n $lv1 -s $vg
+lvcreate --type snapshot -V50 -L1 -n $lv1 -s $vg
lvcreate -aey -L1 -n $lv2 $vg
lvcreate -L1 -s -n $lv3 $vg/$lv2
diff --git a/test/shell/snapshot-usage.sh b/test/shell/snapshot-usage.sh
index a3dd7a6..74f54de 100644
--- a/test/shell/snapshot-usage.sh
+++ b/test/shell/snapshot-usage.sh
@@ -78,7 +78,7 @@ lvremove -f $vg
# Automatically activates exclusively in cluster
-lvcreate -s -l 100%FREE -n $lv $vg --virtualsize $TSIZE
+lvcreate --type snapshot -s -l 100%FREE -n $lv $vg --virtualsize $TSIZE
aux extend_filter_LVMTEST
aux lvmconf "activation/snapshot_autoextend_percent = 20" \
9 years, 5 months
master - tests: prepare control node before clvmd
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c75548300d6345...
Commit: c75548300d63452b4fa615d71cb40cb10382aa33
Parent: d7985ebead2a69f8139bf4ade0747b2a96f784c4
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Nov 19 23:22:52 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Nov 19 23:22:52 2014 +0100
tests: prepare control node before clvmd
Make sure there is 'control' node before clvmd is started.
Somehow 'clvmd' is not allowed by selinux to create one.
TODO: Check is selinux policy is right here...
---
test/lib/aux.sh | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 58b71c6..2fef207 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -35,6 +35,7 @@ prepare_clvmd() {
# lvs is executed from clvmd - use our version
export LVM_BINARY=$(which lvm)
+ test -e "$DM_DEV_DIR/control" || dmsetup table # create control node
# skip if singlenode is not compiled in
(clvmd --help 2>&1 | grep "Available cluster managers" | grep "singlenode") || skip
9 years, 5 months
master - thin: fix error path
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d7985ebead2a69...
Commit: d7985ebead2a69f8139bf4ade0747b2a96f784c4
Parent: 4a52a9212cc5d3ae90196776f28dbfb319002c74
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Nov 19 18:57:40 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Nov 19 18:58:30 2014 +0100
thin: fix error path
Print pool name and not the origin name.
---
lib/metadata/lv_manip.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index ca2a706..879cd51 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -7085,8 +7085,8 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
if (thin_pool_was_active < 0)
thin_pool_was_active = 0;
if (!activate_lv_excl(cmd, pool_lv)) {
- log_error("Failed to activate thin pool %s/%s.",
- origin_lv->vg->name, origin_lv->name);
+ log_error("Failed to activate thin pool %s.",
+ display_lvname(pool_lv));
goto revert_new_lv;
}
if (!lv_is_active(pool_lv)) {
9 years, 5 months