master - thin: disable conversion of thin-pool to read-only
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b3899056d94d14...
Commit: b3899056d94d14eaa80c49e4a5a52c8e7865f08a
Parent: faa9a520857ecae31ab6e8f880a040e1e1b5363a
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Oct 15 13:41:38 2012 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Oct 15 14:09:11 2012 +0200
thin: disable conversion of thin-pool to read-only
This change is not yet supported.
---
WHATS_NEW | 1 +
tools/lvchange.c | 6 ++++++
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 53f3fe9..b2b7c35 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.98 -
=================================
+ Prohibit not yet supported change of thin-pool to read-only.
Support creation of read-only thin volumes (lvcreate -p r).
Using autoextend percent 0 for thin pool fails 'lvextend --use-policies'.
Introduce blkdeactivate script.
diff --git a/tools/lvchange.c b/tools/lvchange.c
index b787672..85253ef 100644
--- a/tools/lvchange.c
+++ b/tools/lvchange.c
@@ -51,6 +51,12 @@ static int lvchange_permission(struct cmd_context *cmd,
return 0;
}
+ if (!(lv_access & LVM_WRITE) && lv_is_thin_pool(lv)) {
+ log_error("Change permissions of thin pool \"%s\" not "
+ "yes supported.", lv->name);
+ return 0;
+ }
+
if (lv_access & LVM_WRITE) {
lv->status |= LVM_WRITE;
log_verbose("Setting logical volume \"%s\" read/write",
11 years, 6 months
master - test: detect compilation with readline
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=faa9a520857eca...
Commit: faa9a520857ecae31ab6e8f880a040e1e1b5363a
Parent: 2fc1fc3a93783fa715a0c833e12962194674b8b1
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Oct 15 13:18:32 2012 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Oct 15 14:07:06 2012 +0200
test: detect compilation with readline
check lvm shell functionality only if compiled with readline.
---
test/lib/aux.sh | 14 ++++++++++----
test/shell/covercmd.sh | 23 +++++++++++++++++++++--
2 files changed, 31 insertions(+), 6 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 9094562..7c0c189 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -532,11 +532,17 @@ target_at_least()
have_thin()
{
- target_at_least dm-thin-pool "$@" || exit 1
- test "$THIN" = shared || test "$THIN" = internal || exit 1
+ target_at_least dm-thin-pool "$@" || exit 1
+ test "$THIN" = shared || test "$THIN" = internal || exit 1
-# disable thin_check if not present in system
- which thin_check || lvmconf 'global/thin_check_executable = ""'
+ # disable thin_check if not present in system
+ which thin_check || lvmconf 'global/thin_check_executable = ""'
+}
+
+# check if lvm shell is build-in (needs readline)
+have_readline()
+{
+ echo version | lvm &>/dev/null
}
test -f DEVICES && devs=$(cat DEVICES)
diff --git a/test/shell/covercmd.sh b/test/shell/covercmd.sh
index 0514468..12d9be1 100644
--- a/test/shell/covercmd.sh
+++ b/test/shell/covercmd.sh
@@ -27,6 +27,7 @@ pvcreate --norestorefile -u $TEST_UUID --metadatacopies 0 "$dev5"
vgcreate -c n $vg $(cat DEVICES)
lvcreate -l 5 -i5 -I256 -n $lv $vg
+if aux have_readline; then
# test *scan and *display tools
cat <<EOF | lvm
pvscan
@@ -45,6 +46,24 @@ EOF
for i in h b s k m g t p e H B S K M G T P E; do
echo pvdisplay --units $i "$dev1"
done | lvm
+else
+pvscan
+vgscan
+lvscan
+lvmdiskscan
+vgdisplay --units k $vg
+lvdisplay --units g $vg
+pvdisplay -c "$dev1"
+pvdisplay -s "$dev1"
+vgdisplay -c $vg
+vgdisplay -s $vg
+lvdisplay -c $vg
+
+for i in h b s k m g t p e H B S K M G T P E; do
+ pvdisplay --units $i "$dev1"
+done
+fi
+
# test vgexport vgimport tools
vgchange -an $vg
@@ -61,8 +80,8 @@ done
for i in pr "p rw" an ay "-monitor y" "-monitor n" \
-resync -refresh "-addtag MYTAG" "-deltag MYETAG"; do
- echo lvchange -$i $vg/$lv
-done | lvm
+ lvchange -$i $vg/$lv
+done
pvck "$dev1"
vgck $vg
11 years, 6 months
master - thin: allow to create read-only thin-volumes
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2fc1fc3a93783f...
Commit: 2fc1fc3a93783fa715a0c833e12962194674b8b1
Parent: c93659e0e0fac317f4fe35dc19ba86e5977721d7
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Oct 8 11:23:52 2012 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Oct 15 14:07:03 2012 +0200
thin: allow to create read-only thin-volumes
Useful for i.e. read-only thin snapshots.
---
WHATS_NEW | 1 +
tools/lvcreate.c | 5 -----
2 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 2780834..53f3fe9 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.98 -
=================================
+ Support creation of read-only thin volumes (lvcreate -p r).
Using autoextend percent 0 for thin pool fails 'lvextend --use-policies'.
Introduce blkdeactivate script.
Implement devices/global_filter (affects lvmetad).
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index 53c4940..55b6a2c 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -619,11 +619,6 @@ static int _read_activation_params(struct lvcreate_params *lp, struct cmd_contex
lp->permission = arg_uint_value(cmd, permission_ARG,
LVM_READ | LVM_WRITE);
- if (lp->thin && !(lp->permission & LVM_WRITE)) {
- log_error("Read-only thin volumes are not currently supported.");
- return 0;
- }
-
/* Must not zero read only volume */
if (!(lp->permission & LVM_WRITE))
lp->zero = 0;
11 years, 6 months
master - scripts: blk-availability - use the same name for lock file
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c93659e0e0fac3...
Commit: c93659e0e0fac317f4fe35dc19ba86e5977721d7
Parent: 4dace48f51dce7a7473934f7f7ff8d74e478cd8f
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Mon Oct 15 13:22:36 2012 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Mon Oct 15 13:22:36 2012 +0200
scripts: blk-availability - use the same name for lock file
---
scripts/blk_availability_init_red_hat.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/scripts/blk_availability_init_red_hat.in b/scripts/blk_availability_init_red_hat.in
index b6c4a67..618f3d3 100644
--- a/scripts/blk_availability_init_red_hat.in
+++ b/scripts/blk_availability_init_red_hat.in
@@ -35,7 +35,7 @@ sbindir=@sbindir@
script=blkdeactivate
options="-u -l wholevg"
-LOCK_FILE="/var/lock/subsys/$script"
+LOCK_FILE="/var/lock/subsys/blk-availability"
rtrn=1
11 years, 6 months
master - Remove pvscan --cache from lvm2-lvmetad init script.
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=4dace48f51dce7...
Commit: 4dace48f51dce7a7473934f7f7ff8d74e478cd8f
Parent: 08ba1b447205913a1979143d9bf3b6afbdc5c742
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Mon Oct 15 12:58:23 2012 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Mon Oct 15 12:58:23 2012 +0200
Remove pvscan --cache from lvm2-lvmetad init script.
This is not needed anymore as the scan is called transparently
within the first LVM command that queries lvmetad.
---
WHATS_NEW | 1 +
scripts/lvm2_lvmetad_init_red_hat.in | 5 +----
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 179e52c..2780834 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -26,6 +26,7 @@ Version 2.02.98 -
Allow non power of 2 thin chunk sizes if thin pool driver supports that.
Allow limited metadata changes when PVs are missing via [vg|lv]change.
Do not start dmeventd for lvchange --resync when monitoring is off.
+ Remove pvscan --cache from lvm2-lvmetad init script.
Remove ExecStartPost with pvscan --cache from lvm2-lvmetad.service.
Report invalid percentage for property snap_percent of non-snaphot LVs.
Disallow convertion of thins to mirrors.
diff --git a/scripts/lvm2_lvmetad_init_red_hat.in b/scripts/lvm2_lvmetad_init_red_hat.in
index 888c730..08e920e 100644
--- a/scripts/lvm2_lvmetad_init_red_hat.in
+++ b/scripts/lvm2_lvmetad_init_red_hat.in
@@ -38,12 +38,9 @@ DAEMON=lvmetad
exec_prefix=@exec_prefix@
sbindir=@sbindir@
-lvm_pvscan="${sbindir}/lvm pvscan --cache"
-
LOCK_FILE="/var/lock/subsys/$DAEMON"
PID_FILE="@LVMETAD_PIDFILE@"
-
rh_status() {
status -p $PID_FILE $DAEMON
}
@@ -55,7 +52,7 @@ rh_status_q() {
start()
{
ret=0
- action "Starting LVM metadata daemon:" $DAEMON && ${lvm_pvscan} > /dev/null || ret=$?
+ action "Starting LVM metadata daemon:" $DAEMON || ret=$?
return $ret
}
11 years, 6 months
master - lvmetad: Only print scanning messages when scanning 1 device.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=08ba1b44720591...
Commit: 08ba1b447205913a1979143d9bf3b6afbdc5c742
Parent: 78dafcba994be668c540ecacd828f61d4a26ed85
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Mon Oct 15 12:44:19 2012 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Mon Oct 15 12:45:50 2012 +0200
lvmetad: Only print scanning messages when scanning 1 device.
---
lib/cache/lvmetad.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c
index f7d250e..6a374ac 100644
--- a/lib/cache/lvmetad.c
+++ b/lib/cache/lvmetad.c
@@ -871,6 +871,7 @@ int lvmetad_pvscan_all_devs(struct cmd_context *cmd, activation_handler handler)
daemon_reply reply;
int r = 1;
char *future_token;
+ int was_silent;
if (!(iter = dev_iter_create(cmd->lvmetad_filter, 1))) {
log_error("dev_iter creation failed");
@@ -890,6 +891,9 @@ int lvmetad_pvscan_all_devs(struct cmd_context *cmd, activation_handler handler)
r = 0;
daemon_reply_destroy(reply);
+ was_silent = silent_mode();
+ init_silent(1);
+
while ((dev = dev_iter_get(iter))) {
if (!lvmetad_pvscan_single(cmd, dev, handler))
r = 0;
@@ -898,6 +902,8 @@ int lvmetad_pvscan_all_devs(struct cmd_context *cmd, activation_handler handler)
break;
}
+ init_silent(was_silent);
+
dev_iter_destroy(iter);
_lvmetad_token = future_token;
11 years, 6 months
master - lvmetad: use -l for logging level not -d
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=78dafcba994be6...
Commit: 78dafcba994be668c540ecacd828f61d4a26ed85
Parent: 3ed2c32e0a8f36c6d5da347b5367aa16d52245aa
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Mon Oct 15 10:44:43 2012 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Mon Oct 15 10:44:43 2012 +0100
lvmetad: use -l for logging level not -d
---
WHATS_NEW | 2 +-
daemons/lvmetad/lvmetad-core.c | 18 +++++++++---------
libdaemon/server/daemon-server.h | 2 +-
man/lvmetad.8.in | 8 ++++----
test/lib/aux.sh | 2 +-
5 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 5d27c8c..179e52c 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -65,7 +65,7 @@ Version 2.02.98 -
Use proper condition to check for unsupported discards settings.
Update lvs manpage with discards (2.02.97).
Add support for lvcreate --discards.
- Change lvmetad logging syntax from -ddd to -d {all|wire|debug}.
+ Change lvmetad logging syntax from -ddd to -l {all|wire|debug}.
Add new libdaemon logging infrastructure.
Version 2.02.97 - 7th August 2012
diff --git a/daemons/lvmetad/lvmetad-core.c b/daemons/lvmetad/lvmetad-core.c
index ad59847..ebb8bc3 100644
--- a/daemons/lvmetad/lvmetad-core.c
+++ b/daemons/lvmetad/lvmetad-core.c
@@ -28,7 +28,7 @@
typedef struct {
log_state *log; /* convenience */
- const char *debug_config;
+ const char *log_config;
struct dm_hash_table *pvid_to_pvmeta;
struct dm_hash_table *device_to_pvid; /* shares locks with above */
@@ -1097,8 +1097,8 @@ static int init(daemon_state *s)
ls->lock.vg = dm_hash_create(32);
ls->token[0] = 0;
- /* Set up stderr logging depending on the -d option. */
- if (!daemon_log_parse(ls->log, DAEMON_LOG_OUTLET_STDERR, ls->debug_config, 1))
+ /* Set up stderr logging depending on the -l option. */
+ if (!daemon_log_parse(ls->log, DAEMON_LOG_OUTLET_STDERR, ls->log_config, 1))
return 0;
DEBUG(s, "initialised state: vgid_to_metadata = %p", ls->vgid_to_metadata);
@@ -1135,11 +1135,11 @@ static int fini(daemon_state *s)
static void usage(char *prog, FILE *file)
{
fprintf(file, "Usage:\n"
- "%s [-V] [-h] [-d {all|wire|debug}] [-f] [-s path]\n\n"
+ "%s [-V] [-h] [-f] [-l {all|wire|debug}] [-s path]\n\n"
" -V Show version of lvmetad\n"
" -h Show this help information\n"
- " -d Log messages to stderr (-d {all|wire|debug})\n"
" -f Don't fork, run in the foreground\n"
+ " -l Logging message level (-l {all|wire|debug})\n"
" -s Set path to the socket to listen on\n\n", prog);
}
@@ -1163,10 +1163,10 @@ int main(int argc, char *argv[])
s.pidfile = LVMETAD_PIDFILE;
s.protocol = "lvmetad";
s.protocol_version = 1;
- ls.debug_config = "";
+ ls.log_config = "";
// use getopt_long
- while ((opt = getopt(argc, argv, "?fhVd:s:")) != EOF) {
+ while ((opt = getopt(argc, argv, "?fhVl:s:")) != EOF) {
switch (opt) {
case 'h':
usage(argv[0], stdout);
@@ -1177,8 +1177,8 @@ int main(int argc, char *argv[])
case 'f':
s.foreground = 1;
break;
- case 'd':
- ls.debug_config = optarg;
+ case 'l':
+ ls.log_config = optarg;
break;
case 's': // --socket
s.socket_path = optarg;
diff --git a/libdaemon/server/daemon-server.h b/libdaemon/server/daemon-server.h
index 2109602..f184853 100644
--- a/libdaemon/server/daemon-server.h
+++ b/libdaemon/server/daemon-server.h
@@ -151,7 +151,7 @@ void daemon_log_enable(log_state *s, int outlet, int type, int enable);
/*
* Set up logging on a given outlet using a list of message types (comma
* separated) to log using that outlet. The list is expected to look like this,
- * "info,wire,debug". Returns 0 upon encountering an unknown message type.
+ * "all,wire,debug". Returns 0 upon encountering an unknown message type.
*/
int daemon_log_parse(log_state *s, int outlet, const char *types, int enable);
diff --git a/man/lvmetad.8.in b/man/lvmetad.8.in
index 07cedd9..ef1096d 100644
--- a/man/lvmetad.8.in
+++ b/man/lvmetad.8.in
@@ -3,7 +3,7 @@
lvmetad \- LVM metadata cache daemon
.SH SYNOPSIS
.B lvmetad
-.RB [ \-d
+.RB [ \-l
.RI {all|wire|debug}
.RB ]
.RB [ \-s
@@ -22,14 +22,14 @@ consistent image of the volume groups available in the system.
By default, lvmetad, even if running, is not used by LVM. See \fBlvm.conf\fP(5).
.SH OPTIONS
.TP
-.BR \-d " {" \fIall | \fIwire | \fIdebug }
+.BR \-l " {" \fIall | \fIwire | \fIdebug }
Select the type of log messages to generate.
Messages are logged by syslog.
Additionally, when -f is given they are also sent to standard error.
Since release 2.02.98, there are two classes of messages: wire and debug.
Selecting 'all' supplies both and is equivalent to a comma-separated list
--d wire,debug.
-Prior to release 2.02.98, repeating from 1 to 3 times, viz. -d, -dd, -ddd,
+-l wire,debug.
+Prior to release 2.02.98, repeating -d from 1 to 3 times, viz. -d, -dd, -ddd,
increased the detail of messages.
.TP
.B \-f
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 103318a..9094562 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -77,7 +77,7 @@ prepare_lvmetad() {
test -z "$LVM_VALGRIND_LVMETAD" || run_valgrind="run_valgrind"
echo "preparing lvmetad..."
- $run_valgrind lvmetad -f "$@" -s "$TESTDIR/lvmetad.socket" -d wire,debug &
+ $run_valgrind lvmetad -f "$@" -s "$TESTDIR/lvmetad.socket" -l wire,debug &
echo $! > LOCAL_LVMETAD
while ! test -e "$TESTDIR/lvmetad.socket"; do echo -n .; sleep .1; done # wait for the socket
echo ok
11 years, 6 months
master - lvmetad: empty types string is ok
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3ed2c32e0a8f36...
Commit: 3ed2c32e0a8f36c6d5da347b5367aa16d52245aa
Parent: a0e60d27ff91c46a1febf58a955c6b88539ba982
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Oct 15 11:02:15 2012 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Oct 15 11:02:15 2012 +0200
lvmetad: empty types string is ok
Since now return code is test - return OK for this case.
---
libdaemon/server/daemon-log.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/libdaemon/server/daemon-log.c b/libdaemon/server/daemon-log.c
index 1e1c9e0..6f5f4dc 100644
--- a/libdaemon/server/daemon-log.c
+++ b/libdaemon/server/daemon-log.c
@@ -153,12 +153,16 @@ static int _parse_one(log_state *s, int outlet, const char *type, int enable)
int daemon_log_parse(log_state *s, int outlet, const char *types, int enable)
{
- char *buf = dm_strdup(types);
- char *pos = buf;
+ char *buf;
+ char *pos;
- if (!buf)
+ if (!types || !types[0])
+ return 1;
+
+ if (!(buf = dm_strdup(types)))
return 0;
+ pos = buf;
while (pos) {
char *next = strchr(pos, ',');
if (next)
11 years, 6 months
master - lvmetad: document and tidy cmdline args
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a0e60d27ff91c4...
Commit: a0e60d27ff91c46a1febf58a955c6b88539ba982
Parent: 2393b468a4703be81f1d38ea7968931d30046087
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Mon Oct 15 02:06:27 2012 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Mon Oct 15 02:06:27 2012 +0100
lvmetad: document and tidy cmdline args
Try to bring the lvmetad usage text and man page closer to the code.
There seem to be 3 useful ways to use -d with lvmetad at the moment:
-d all
-d wire
-d debug
(They can also be comma-separated like -d wire,debug.)
Prior to the last release, -d, -dd and -ddd were supported.
Fail if an unrecognised debug arg is supplied on the command line.
Change -V to report the same version as the lvm binary: previously it
just reported version 0.
---
WHATS_NEW | 2 ++
daemons/lvmetad/lvmetad-core.c | 17 +++++++++--------
libdaemon/server/daemon-server.c | 6 ++++--
man/lvmetad.8.in | 23 ++++++++++++++++-------
4 files changed, 31 insertions(+), 17 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index d60cad5..5d27c8c 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -65,6 +65,8 @@ Version 2.02.98 -
Use proper condition to check for unsupported discards settings.
Update lvs manpage with discards (2.02.97).
Add support for lvcreate --discards.
+ Change lvmetad logging syntax from -ddd to -d {all|wire|debug}.
+ Add new libdaemon logging infrastructure.
Version 2.02.97 - 7th August 2012
=================================
diff --git a/daemons/lvmetad/lvmetad-core.c b/daemons/lvmetad/lvmetad-core.c
index 1992467..ad59847 100644
--- a/daemons/lvmetad/lvmetad-core.c
+++ b/daemons/lvmetad/lvmetad-core.c
@@ -19,6 +19,7 @@
#include "config-util.h"
#include "daemon-server.h"
#include "daemon-log.h"
+#include "lvm-version.h"
#include <assert.h>
#include <pthread.h>
@@ -1066,9 +1067,8 @@ static response handler(daemon_state s, client_handle h, request r)
if (!strcmp(rq, "vg_lookup"))
return vg_lookup(state, r);
- if (!strcmp(rq, "pv_list")) {
+ if (!strcmp(rq, "pv_list"))
return pv_list(state, r);
- }
if (!strcmp(rq, "vg_list"))
return vg_list(state, r);
@@ -1098,7 +1098,8 @@ static int init(daemon_state *s)
ls->token[0] = 0;
/* Set up stderr logging depending on the -d option. */
- daemon_log_parse(ls->log, DAEMON_LOG_OUTLET_STDERR, ls->debug_config, 1);
+ if (!daemon_log_parse(ls->log, DAEMON_LOG_OUTLET_STDERR, ls->debug_config, 1))
+ return 0;
DEBUG(s, "initialised state: vgid_to_metadata = %p", ls->vgid_to_metadata);
if (!ls->pvid_to_vgid || !ls->vgid_to_metadata)
@@ -1134,12 +1135,12 @@ static int fini(daemon_state *s)
static void usage(char *prog, FILE *file)
{
fprintf(file, "Usage:\n"
- "%s [-V] [-h] [-d [info[,debug[,wire]]]] [-f] [-s path]\n\n"
+ "%s [-V] [-h] [-d {all|wire|debug}] [-f] [-s path]\n\n"
" -V Show version of lvmetad\n"
" -h Show this help information\n"
- " -s Set path to the socket to listen on\n"
- " -d Log messages to stderr (-d info,wire,debug)\n"
- " -f Don't fork, run in the foreground\n\n", prog);
+ " -d Log messages to stderr (-d {all|wire|debug})\n"
+ " -f Don't fork, run in the foreground\n"
+ " -s Set path to the socket to listen on\n\n", prog);
}
int main(int argc, char *argv[])
@@ -1184,7 +1185,7 @@ int main(int argc, char *argv[])
_socket_override = 1;
break;
case 'V':
- printf("lvmetad version 0\n");
+ printf("lvmetad version: " LVM_VERSION "\n");
exit(1);
}
}
diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c
index b02621f..3711419 100644
--- a/libdaemon/server/daemon-server.c
+++ b/libdaemon/server/daemon-server.c
@@ -506,7 +506,8 @@ void daemon_start(daemon_state s)
kill(getppid(), SIGTERM);
if (s.daemon_init)
- s.daemon_init(&s);
+ if (!s.daemon_init(&s))
+ failed = 1;
while (!_shutdown_requested && !failed) {
fd_set in;
@@ -525,7 +526,8 @@ void daemon_start(daemon_state s)
perror("unlink error");
if (s.daemon_fini)
- s.daemon_fini(&s);
+ if (!s.daemon_fini(&s))
+ failed = 1;
INFO(&s, "%s shutting down", s.name);
diff --git a/man/lvmetad.8.in b/man/lvmetad.8.in
index d43a8f1..07cedd9 100644
--- a/man/lvmetad.8.in
+++ b/man/lvmetad.8.in
@@ -3,8 +3,12 @@
lvmetad \- LVM metadata cache daemon
.SH SYNOPSIS
.B lvmetad
-.RB [ \-d ]
-.RB [ \-s ]
+.RB [ \-d
+.RI {all|wire|debug}
+.RB ]
+.RB [ \-s
+.RI path
+.RB ]
.RB [ \-f ]
.RB [ \-h ]
.RB [ \-V ]
@@ -18,10 +22,15 @@ consistent image of the volume groups available in the system.
By default, lvmetad, even if running, is not used by LVM. See \fBlvm.conf\fP(5).
.SH OPTIONS
.TP
-.B \-d
-Repeat from 1 to 3 times (-d, -dd, -ddd) to increase the detail of
-debug messages sent to syslog.
-Each extra d adds more debugging information.
+.BR \-d " {" \fIall | \fIwire | \fIdebug }
+Select the type of log messages to generate.
+Messages are logged by syslog.
+Additionally, when -f is given they are also sent to standard error.
+Since release 2.02.98, there are two classes of messages: wire and debug.
+Selecting 'all' supplies both and is equivalent to a comma-separated list
+-d wire,debug.
+Prior to release 2.02.98, repeating from 1 to 3 times, viz. -d, -dd, -ddd,
+increased the detail of messages.
.TP
.B \-f
Don't fork, run in the foreground.
@@ -29,7 +38,7 @@ Don't fork, run in the foreground.
.BR \-h ", " \-?
Show help information.
.TP
-.B \-s
+.B \-s \fIpath
Path to the socket file to use. The option overrides both the built-in default
(#DEFAULT_RUN_DIR#/lvmetad.socket) and the environment variable
LVM_LVMETAD_SOCKET.
11 years, 6 months
master - lvmetad: fix previous commit
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2393b468a4703b...
Commit: 2393b468a4703be81f1d38ea7968931d30046087
Parent: 9bb210192dd5b60582633079d4769a582ac11074
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Oct 15 00:44:31 2012 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Oct 15 00:44:31 2012 +0200
lvmetad: fix previous commit
Ooops patch conversion for gcc cleanup missed this line.
---
lib/cache/lvmetad.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c
index a3b45d5..f7d250e 100644
--- a/lib/cache/lvmetad.c
+++ b/lib/cache/lvmetad.c
@@ -677,7 +677,7 @@ int lvmetad_pv_found(const struct id *pvid, struct device *device, const struct
if (!pvmeta)
return_0;
- info = lvmcache_info_from_pvid((const char *)&pvid, 0);
+ info = lvmcache_info_from_pvid((const char *)pvid, 0);
if (!(pvmeta->root = make_config_node(pvmeta, "pv", NULL, NULL))) {
dm_config_destroy(pvmeta);
11 years, 6 months