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
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 */
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);
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);
}
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);
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;
/*
* 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);
lvmetad \- LVM metadata cache daemon
.SH SYNOPSIS
.B lvmetad
-.RB [ \-d
+.RB [ \-l
.RI {all|wire|debug}
.RB ]
.RB [ \-s
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
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