master - tests: capture and print thrown errors
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=243a135fe9091a...
Commit: 243a135fe9091a3d306ee09b397779e503bb6adf
Parent: bdf4e3e2f20dd186f3640e808930c152fc8d77e9
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Mar 11 15:42:20 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 11 21:17:23 2015 +0100
tests: capture and print thrown errors
---
test/lib/runner.cpp | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/test/lib/runner.cpp b/test/lib/runner.cpp
index a5e4615..d00aa45 100644
--- a/test/lib/runner.cpp
+++ b/test/lib/runner.cpp
@@ -29,6 +29,12 @@
int main(int argc, const char **argv)
{
- return brick::shelltest::run( argc, argv, "LVM_TEST_FLAVOUR" );
+ try {
+ return brick::shelltest::run( argc, argv, "LVM_TEST_FLAVOUR" );
+ } catch (std::exception const& e) {
+ std::cout << "Exception: " << e.what() << "\n";
+ }
+
+ return 1;
}
8 years
master - tests: do not leak in mem in destructor
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=bdf4e3e2f20dd1...
Commit: bdf4e3e2f20dd186f3640e808930c152fc8d77e9
Parent: e7e499e80fa31c7c465d43e11e14c2342477ee53
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Mar 11 15:41:53 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 11 21:17:23 2015 +0100
tests: do not leak in mem in destructor
---
test/lib/brick-shelltest.h | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/test/lib/brick-shelltest.h b/test/lib/brick-shelltest.h
index 820aa81..7c49fa3 100644
--- a/test/lib/brick-shelltest.h
+++ b/test/lib/brick-shelltest.h
@@ -625,14 +625,15 @@ struct IO : Sink {
return *new (this) IO( io );
}
- void clear() {
+ void clear(int push = 1) {
for ( Sinks::iterator i = sinks.begin(); i != sinks.end(); ++i )
delete *i;
sinks.clear();
- sinks.push_back( _observer = new Observer );
+ if (push)
+ sinks.push_back( _observer = new Observer );
}
- ~IO() { close(); clear(); }
+ ~IO() { close(); clear(0); }
};
@@ -659,7 +660,7 @@ struct TestProcess
bool interactive;
int fd;
- void exec() {
+ void exec() __attribute__ ((noreturn)) {
assert( fd >= 0 );
if ( !interactive ) {
int devnull = ::open( "/dev/null", O_RDONLY );
@@ -858,7 +859,8 @@ struct TestCase {
if ( options.verbose || options.interactive )
progress() << std::endl;
- while ( monitor() );
+ while ( monitor() )
+ /* empty */ ;
Journal::R r = Journal::UNKNOWN;
8 years
master - makefiles: split gcc -W options
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e7e499e80fa31c...
Commit: e7e499e80fa31c7c465d43e11e14c2342477ee53
Parent: 8a2b9f045fffd4e9d9450477b946af31dde5848f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Mar 11 15:41:03 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 11 21:17:23 2015 +0100
makefiles: split gcc -W options
Avoid using gcc only Warnings for compilation of g++ object files.
---
make.tmpl.in | 52 ++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 38 insertions(+), 14 deletions(-)
diff --git a/make.tmpl.in b/make.tmpl.in
index 11721f1..3a8597a 100644
--- a/make.tmpl.in
+++ b/make.tmpl.in
@@ -142,21 +142,45 @@ INSTALL_SCRIPT = $(INSTALL) -p $(M_INSTALL_PROGRAM)
.SUFFIXES: .c .cpp .d .o .so .a .po .pot .mo .dylib
-WFLAGS += -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings \
- -Wmissing-prototypes -Wmissing-declarations -Wnested-externs \
- -Winline -Wmissing-noreturn -Wformat-security -Wredundant-decls \
- -Wpointer-arith -Wuninitialized -Wmissing-include-dirs \
- -Wfloat-equal -Wstrict-prototypes \
- -Wold-style-definition -Wmissing-format-attribute
+WFLAGS +=\
+ -Wall\
+ -Wcast-align\
+ -Wfloat-equal\
+ -Wformat-security\
+ -Winline\
+ -Wmissing-declarations\
+ -Wmissing-format-attribute\
+ -Wmissing-include-dirs\
+ -Wmissing-noreturn\
+ -Wpointer-arith\
+ -Wredundant-decls\
+ -Wshadow\
+ -Wundef\
+ -Wuninitialized\
+ -Wwrite-strings
+
+WCFLAGS +=\
+ -Wmissing-prototypes\
+ -Wnested-externs\
+ -Wold-style-definition\
+ -Wstrict-prototypes
ifeq ("@HAVE_WJUMP@", "yes")
-WFLAGS += -Wjump-misses-init
+WCFLAGS += -Wjump-misses-init
endif
ifeq ("@HAVE_WCLOBBERED@", "yes")
-WFLAGS += -Wclobbered -Wempty-body -Wignored-qualifiers \
- -Wmissing-parameter-type -Wold-style-declaration -Woverride-init \
- -Wtype-limits -Wlogical-op
+WFLAGS +=\
+ -Wclobbered\
+ -Wempty-body\
+ -Wignored-qualifiers\
+ -Wlogical-op\
+ -Wtype-limits
+
+WCFLAGS +=\
+ -Wmissing-parameter-type\
+ -Wold-style-declaration\
+ -Woverride-init
endif
ifeq ("@HAVE_WSYNCNAND@", "yes")
@@ -174,7 +198,7 @@ endif
endif
#WFLAGS += -W -Wno-sign-compare -Wno-unused-parameter -Wno-missing-field-initializers
-#WFLAGS += -Wsign-compare -Wunused-parameter -Wmissing-field-initializers
+#WFLAGS += -Wsign-compare -Wunused-parameter -Wmissing-field-initializers
#WFLAGS += -Wconversion -Wbad-function-cast -Wcast-qual -Waggregate-return -Wpacked
#WFLAGS += -pedantic -std=gnu99
#DEFS += -DDEBUG_CRC32
@@ -372,7 +396,7 @@ endif
$(TARGETS): $(OBJECTS)
%.o: %.c
- $(CC) -c $(INCLUDES) $(DEFS) $(WFLAGS) $(CFLAGS) $(CFLAGS_$@) $< -o $@
+ $(CC) -c $(INCLUDES) $(DEFS) $(WFLAGS) $(WCFLAGS) $(CFLAGS) $(CFLAGS_$@) $< -o $@
%.o: %.cpp
$(CXX) -c $(INCLUDES) $(DEFS) $(WFLAGS) $(CXXFLAGS) $(CXXFLAGS_$@) $< -o $@
@@ -405,7 +429,7 @@ install_lib_shared: $(LIB_SHARED)
$(INSTALL_DIR) $(usrlibdir)
$(LN_S) -f $(USRLIB_RELPATH)$(<F).$(LIB_VERSION) $(usrlibdir)/$(<F)
-# FIXME: plugins are installed to subdirs
+# FIXME: plugins are installed to subdirs
# and for compatibility links in libdir are created
# when the code is fixed links could be removed.
install_dm_plugin: $(LIB_SHARED)
@@ -446,7 +470,7 @@ clean: $(SUBDIRS.clean) cleandir
distclean: cleandir $(SUBDIRS.distclean)
test -z "$(DISTCLEAN_DIRS)" || $(RM) -r $(DISTCLEAN_DIRS)
- $(RM) $(DISTCLEAN_TARGETS) Makefile
+ $(RM) $(DISTCLEAN_TARGETS) Makefile
.exported_symbols_generated: $(EXPORTED_HEADER) .exported_symbols
set -e; \
8 years
master - tests: extend race
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8a2b9f045fffd4...
Commit: 8a2b9f045fffd4e9d9450477b946af31dde5848f
Parent: ed2dcb796ffc0cac6cee38b5198816e77a3a3bfd
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Feb 19 17:08:33 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 11 11:02:35 2015 +0100
tests: extend race
Mark test as skipped, if the test could not be made.
---
test/shell/lvextend-snapshot-dmeventd.sh | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvextend-snapshot-dmeventd.sh b/test/shell/lvextend-snapshot-dmeventd.sh
index 448df96..c944322 100644
--- a/test/shell/lvextend-snapshot-dmeventd.sh
+++ b/test/shell/lvextend-snapshot-dmeventd.sh
@@ -47,6 +47,10 @@ lvchange --monitor y $vg/snap
write_ 1000 1700
pre=$(percent_)
+# Normally the usage should be ~66% here, however on slower systems
+# dmeventd could be actually 'fast' enough to have COW already resized now
+# so mark test skipped if we are bellow 50% by now
+test $pre -gt 50 || skip
wait_for_change_ $pre
test $pre -gt $(percent_)
@@ -56,6 +60,8 @@ test $pre -gt $(percent_)
write_ 2700 2000
pre=$(percent_)
+# Mark test as skipped if already resized...
+test $pre -gt 70 || skip
wait_for_change_ $pre
test $pre -gt $(percent_)
8 years
master - tests: drop old workaround
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ed2dcb796ffc0c...
Commit: ed2dcb796ffc0cac6cee38b5198816e77a3a3bfd
Parent: a042678a83fd996bec20cb7e42c7b1df206b7671
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Mar 11 09:54:08 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 11 11:02:35 2015 +0100
tests: drop old workaround
Should be usable now without this 'should'.
---
test/shell/lvconvert-mirror-updown.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/shell/lvconvert-mirror-updown.sh b/test/shell/lvconvert-mirror-updown.sh
index 18618fd..67862ac 100644
--- a/test/shell/lvconvert-mirror-updown.sh
+++ b/test/shell/lvconvert-mirror-updown.sh
@@ -31,6 +31,6 @@ lvs -a $vg
#
# It fails so use 'should' and -vvvv for now
#
-should lvconvert -vvvv -m-1 $vg/$lv1 "$dev2"
+lvconvert -m-1 $vg/$lv1 "$dev2"
vgremove -f $vg
8 years
master - tests: specify old mirror type
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a042678a83fd99...
Commit: a042678a83fd996bec20cb7e42c7b1df206b7671
Parent: 6cecf61cc3aa9983f82ed571021149ee4ed83e5b
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Mar 11 09:53:35 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 11 11:02:35 2015 +0100
tests: specify old mirror type
Use old mirror (otherwise it would need aux have_raid)
---
test/shell/lvmetad-lvscan-cache.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/shell/lvmetad-lvscan-cache.sh b/test/shell/lvmetad-lvscan-cache.sh
index e63fd20..1d9d8a4 100644
--- a/test/shell/lvmetad-lvscan-cache.sh
+++ b/test/shell/lvmetad-lvscan-cache.sh
@@ -16,7 +16,7 @@ test -e LOCAL_LVMETAD || skip
aux prepare_pvs 2
vgcreate $vg1 "$dev1" "$dev2"
-lvcreate -n testlv -m 1 -l 1 $vg1
+lvcreate -n testlv --type mirror -m 1 -l 1 $vg1
vgs | grep $vg1
lvscan --cache $vg1/testlv
8 years
master - tests: cleanup some cxx warnings
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6cecf61cc3aa99...
Commit: 6cecf61cc3aa9983f82ed571021149ee4ed83e5b
Parent: 3f7e62b340045888b974fd0082d034db6c5af902
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Mar 11 11:00:55 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 11 11:02:35 2015 +0100
tests: cleanup some cxx warnings
---
test/lib/brick-shelltest.h | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/test/lib/brick-shelltest.h b/test/lib/brick-shelltest.h
index 3c88a85..820aa81 100644
--- a/test/lib/brick-shelltest.h
+++ b/test/lib/brick-shelltest.h
@@ -353,7 +353,7 @@ struct Substitute {
else if ( std::string( line, 0, 8 ) == "@PREFIX=" )
_map[ "@PREFIX@" ] = std::string( line, 8, std::string::npos );
else {
- int off;
+ size_t off;
for ( Map::iterator s = _map.begin(); s != _map.end(); ++s )
while ( (off = line.find( s->first )) != std::string::npos )
line.replace( off, s->first.length(), s->second );
@@ -370,7 +370,7 @@ struct Format {
std::string format( TimedBuffer::Line l ) {
std::stringstream result;
if ( stamp ) {
- int rel = l.first - start;
+ time_t rel = l.first - start;
result << "[" << std::setw( 2 ) << std::setfill( ' ' ) << rel / 60
<< ":" << std::setw( 2 ) << std::setfill( '0' ) << rel % 60 << "] ";
}
@@ -477,7 +477,7 @@ struct Source {
return -1;
}
- Source( int fd = -1 ) : fd( fd ) {}
+ Source( int _fd = -1 ) : fd( _fd ) {}
virtual ~Source() {
if ( fd >= 0 )
::close( fd );
@@ -531,7 +531,7 @@ struct KMsg : Source {
void sync( Sink *s ) {
#ifdef __unix
- int sz;
+ ssize_t sz;
char buf[ 128 * 1024 ];
if ( dev_kmsg() ) {
@@ -813,7 +813,8 @@ struct TestCase {
std::string tag( std::string n ) {
if ( options.batch )
return "## ";
- int pad = (12 - n.length());
+ size_t pad = n.length();
+ pad = (pad < 12) ? 12 - pad : 0;
return "### " + std::string( pad, ' ' ) + n + ": ";
}
@@ -932,8 +933,8 @@ struct TestCase {
io.sources.push_back( new KMsg );
}
- TestCase( Journal &j, Options opt, std::string path, std::string name, std::string flavour )
- : child( path ), name( name ), flavour( flavour ), timeout( false ),
+ TestCase( Journal &j, Options opt, std::string path, std::string _name, std::string _flavour )
+ : child( path ), name( _name ), flavour( _flavour ), timeout( false ),
last_update( 0 ), last_heartbeat( 0 ), options( opt ), journal( &j )
{
}
@@ -1087,7 +1088,7 @@ void split( std::string s, C &c ) {
}
-int run( int argc, const char **argv, std::string fl_envvar = "TEST_FLAVOUR" )
+static int run( int argc, const char **argv, std::string fl_envvar = "TEST_FLAVOUR" )
{
Args args( argc, argv );
Options opt;
8 years
master - tests: enable kmsg by default
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3f7e62b3400458...
Commit: 3f7e62b340045888b974fd0082d034db6c5af902
Parent: db5166fbfab2c7455fd97fd73afc6c1139b0ddc4
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Mar 11 10:43:28 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 11 11:02:35 2015 +0100
tests: enable kmsg by default
By default we want to capture kernel log into test trace
(since when test crashes it could be problem to reproduce).
---
test/lib/brick-shelltest.h | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/test/lib/brick-shelltest.h b/test/lib/brick-shelltest.h
index 4f0e1bf..3c88a85 100644
--- a/test/lib/brick-shelltest.h
+++ b/test/lib/brick-shelltest.h
@@ -649,7 +649,7 @@ struct Options {
std::string flavour_envvar;
int timeout;
Options() : verbose( false ), batch( false ), interactive( false ),
- cont( false ), fatal_timeouts( false ), kmsg( false ),
+ cont( false ), fatal_timeouts( false ), kmsg( true ),
timeout( 180 ) {}
};
@@ -1135,8 +1135,8 @@ int run( int argc, const char **argv, std::string fl_envvar = "TEST_FLAVOUR" )
if ( args.has( "--timeout" ) )
opt.timeout = atoi( args.opt( "--timeout" ).c_str() );
- if ( args.has( "--kmsg" ) )
- opt.kmsg = true;
+ if ( args.has( "--nokmsg" ) )
+ opt.kmsg = false;
opt.outdir = args.opt( "--outdir" );
opt.testdir = args.opt( "--testdir" );
8 years
master - tests: extend test timeout to 180sec
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=db5166fbfab2c7...
Commit: db5166fbfab2c7455fd97fd73afc6c1139b0ddc4
Parent: 760cebf47dde020b42e44b35a0ad81204b6047e5
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Mar 11 10:46:51 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 11 11:02:35 2015 +0100
tests: extend test timeout to 180sec
Some test could take more then minute (with slow udev and slow
emulation) - extend timeout to 180sec.
---
test/lib/brick-shelltest.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/lib/brick-shelltest.h b/test/lib/brick-shelltest.h
index d67b164..4f0e1bf 100644
--- a/test/lib/brick-shelltest.h
+++ b/test/lib/brick-shelltest.h
@@ -650,7 +650,7 @@ struct Options {
int timeout;
Options() : verbose( false ), batch( false ), interactive( false ),
cont( false ), fatal_timeouts( false ), kmsg( false ),
- timeout( 60 ) {}
+ timeout( 180 ) {}
};
struct TestProcess
8 years
master - reporting: should not fail with foreign option if lvm1 pvs exist
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=760cebf47dde02...
Commit: 760cebf47dde020b42e44b35a0ad81204b6047e5
Parent: c7290759b059c65e2dbd56e498186b4b8acc8315
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Mar 10 13:56:25 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Mar 10 13:56:25 2015 -0500
reporting: should not fail with foreign option if lvm1 pvs exist
When lvm1 PVs are visible, and lvmetad is used, and the foreign
option was included in the reporting command, the reporting
command would fail after the 'pvscan all devs' function saw
the lvm1 PVs. There is no reason the command should fail
because of the lvm1 PVs; they should just be ignored.
---
lib/cache/lvmetad.c | 30 +++++++++++++++++++++++-------
lib/cache/lvmetad.h | 4 ++--
tools/lvscan.c | 2 +-
tools/pvscan.c | 4 ++--
4 files changed, 28 insertions(+), 12 deletions(-)
diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c
index aad4423..08c58d2 100644
--- a/lib/cache/lvmetad.c
+++ b/lib/cache/lvmetad.c
@@ -136,6 +136,9 @@ void lvmetad_set_socket(const char *sock)
_lvmetad_socket = sock;
}
+static int _lvmetad_pvscan_all_devs(struct cmd_context *cmd, activation_handler handler,
+ int ignore_obsolete);
+
static daemon_reply _lvmetad_send(const char *id, ...)
{
va_list ap;
@@ -183,7 +186,7 @@ retry:
max_remaining_sleep_times--; /* Sleep once before rescanning the first time, then 5 times each time after that. */
} else {
/* If the re-scan fails here, we try again later. */
- (void) lvmetad_pvscan_all_devs(_lvmetad_cmd, NULL);
+ (void) _lvmetad_pvscan_all_devs(_lvmetad_cmd, NULL, 0);
num_rescans++;
max_remaining_sleep_times = 5;
}
@@ -904,7 +907,7 @@ static int _lvmetad_pvscan_single(struct metadata_area *mda, void *baton)
}
int lvmetad_pvscan_single(struct cmd_context *cmd, struct device *dev,
- activation_handler handler)
+ activation_handler handler, int ignore_obsolete)
{
struct label *label;
struct lvmcache_info *info;
@@ -933,9 +936,16 @@ int lvmetad_pvscan_single(struct cmd_context *cmd, struct device *dev,
goto_bad;
if (baton.fid->fmt->features & FMT_OBSOLETE) {
- log_error("WARNING: Ignoring obsolete format of metadata (%s) on device %s when using lvmetad",
- baton.fid->fmt->name, dev_name(dev));
+ if (ignore_obsolete)
+ log_warn("WARNING: Ignoring obsolete format of metadata (%s) on device %s when using lvmetad",
+ baton.fid->fmt->name, dev_name(dev));
+ else
+ log_error("WARNING: Ignoring obsolete format of metadata (%s) on device %s when using lvmetad",
+ baton.fid->fmt->name, dev_name(dev));
lvmcache_fmt(info)->ops->destroy_instance(baton.fid);
+
+ if (ignore_obsolete)
+ return 1;
return 0;
}
@@ -974,7 +984,8 @@ bad:
return 0;
}
-int lvmetad_pvscan_all_devs(struct cmd_context *cmd, activation_handler handler)
+static int _lvmetad_pvscan_all_devs(struct cmd_context *cmd, activation_handler handler,
+ int ignore_obsolete)
{
struct dev_iter *iter;
struct device *dev;
@@ -1016,7 +1027,7 @@ int lvmetad_pvscan_all_devs(struct cmd_context *cmd, activation_handler handler)
stack;
break;
}
- if (!lvmetad_pvscan_single(cmd, dev, handler))
+ if (!lvmetad_pvscan_single(cmd, dev, handler, ignore_obsolete))
r = 0;
}
@@ -1031,11 +1042,16 @@ int lvmetad_pvscan_all_devs(struct cmd_context *cmd, activation_handler handler)
return r;
}
+int lvmetad_pvscan_all_devs(struct cmd_context *cmd, activation_handler handler)
+{
+ return _lvmetad_pvscan_all_devs(cmd, handler, 0);
+}
+
/*
* FIXME Implement this function, skipping PVs known to belong to local or clustered,
* non-exported VGs.
*/
int lvmetad_pvscan_foreign_vgs(struct cmd_context *cmd, activation_handler handler)
{
- return lvmetad_pvscan_all_devs(cmd, handler);
+ return _lvmetad_pvscan_all_devs(cmd, handler, 1);
}
diff --git a/lib/cache/lvmetad.h b/lib/cache/lvmetad.h
index 4d6f107..b5bac69 100644
--- a/lib/cache/lvmetad.h
+++ b/lib/cache/lvmetad.h
@@ -153,7 +153,7 @@ struct volume_group *lvmetad_vg_lookup(struct cmd_context *cmd,
* Scan a single device and update lvmetad with the result(s).
*/
int lvmetad_pvscan_single(struct cmd_context *cmd, struct device *dev,
- activation_handler handler);
+ activation_handler handler, int ignore_obsolete);
int lvmetad_pvscan_all_devs(struct cmd_context *cmd, activation_handler handler);
int lvmetad_pvscan_foreign_vgs(struct cmd_context *cmd, activation_handler handler);
@@ -180,7 +180,7 @@ int lvmetad_pvscan_foreign_vgs(struct cmd_context *cmd, activation_handler handl
# define lvmetad_pv_lookup_by_dev(cmd, dev, found) (0)
# define lvmetad_vg_list_to_lvmcache(cmd) (1)
# define lvmetad_vg_lookup(cmd, vgname, vgid) (NULL)
-# define lvmetad_pvscan_single(cmd, dev, handler) (0)
+# define lvmetad_pvscan_single(cmd, dev, handler, ignore_obsolete) (0)
# define lvmetad_pvscan_all_devs(cmd, handler) (0)
# define lvmetad_pvscan_foreign_vgs(cmd, handler) (0)
diff --git a/tools/lvscan.c b/tools/lvscan.c
index fa9d976..e98c73d 100644
--- a/tools/lvscan.c
+++ b/tools/lvscan.c
@@ -40,7 +40,7 @@ static int _lvscan_single_lvmetad(struct cmd_context *cmd, struct logical_volume
pvid_s);
continue;
}
- if (!lvmetad_pvscan_single(cmd, pvl->pv->dev, NULL))
+ if (!lvmetad_pvscan_single(cmd, pvl->pv->dev, NULL, 0))
return ECMD_FAILED;
}
diff --git a/tools/pvscan.c b/tools/pvscan.c
index 5709172..307187d 100644
--- a/tools/pvscan.c
+++ b/tools/pvscan.c
@@ -277,7 +277,7 @@ static int _pvscan_lvmetad(struct cmd_context *cmd, int argc, char **argv)
stack;
break;
}
- if (!lvmetad_pvscan_single(cmd, dev, handler)) {
+ if (!lvmetad_pvscan_single(cmd, dev, handler, 0)) {
ret = ECMD_FAILED;
stack;
break;
@@ -310,7 +310,7 @@ static int _pvscan_lvmetad(struct cmd_context *cmd, int argc, char **argv)
stack;
break;
}
- if (!lvmetad_pvscan_single(cmd, dev, handler)) {
+ if (!lvmetad_pvscan_single(cmd, dev, handler, 0)) {
ret = ECMD_FAILED;
stack;
break;
8 years