master - pvmove.c: call vg_read directly
by okozina
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=131c657735d3a3...
Commit: 131c657735d3a315ceb9f072cb9a9591d363fa78
Parent: e5e0e220223edf0789d38a0a98341d745cf95b15
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue May 19 12:05:38 2015 +0200
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Tue May 19 20:55:31 2015 +0200
pvmove.c: call vg_read directly
---
tools/pvmove.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/pvmove.c b/tools/pvmove.c
index 94a5ffc..dc36955 100644
--- a/tools/pvmove.c
+++ b/tools/pvmove.c
@@ -629,7 +629,7 @@ static int _set_up_pvmove(struct cmd_context *cmd, const char *pv_name,
/* Read VG */
log_verbose("Finding volume group \"%s\"", pv_vg_name(pv));
- vg = poll_get_copy_vg(cmd, pv_vg_name(pv), NULL, READ_FOR_UPDATE);
+ vg = vg_read(cmd, pv_vg_name(pv), NULL, READ_FOR_UPDATE);
if (vg_read_error(vg)) {
release_vg(vg);
return_ECMD_FAILED;
@@ -719,7 +719,7 @@ static int _read_poll_id_from_pvname(struct cmd_context *cmd, const char *pv_nam
return_0;
/* need read-only access */
- vg = poll_get_copy_vg(cmd, pv_vg_name(pv), NULL, 0);
+ vg = vg_read(cmd, pv_vg_name(pv), NULL, 0);
if (vg_read_error(vg)) {
log_error("ABORTING: Can't read VG for %s.", pv_name);
release_vg(vg);
8 years, 11 months
master - polldaemon: move dev_close_all out of poll_get_copy_vg
by okozina
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e5e0e220223edf...
Commit: e5e0e220223edf0789d38a0a98341d745cf95b15
Parent: e27182249a2cef2518fbbab1037810ed5c9a6d37
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Tue May 19 11:37:39 2015 +0200
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Tue May 19 20:55:22 2015 +0200
polldaemon: move dev_close_all out of poll_get_copy_vg
let's call dev_close_all() only before we're about to 'sleep'
for at least one second during the polling.
(it's questionable whether to call dev_close_all() at all in
polldaemon code. Natural extension would be to drop it completely)
---
tools/polldaemon.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/tools/polldaemon.c b/tools/polldaemon.c
index 83497b0..7f25887 100644
--- a/tools/polldaemon.c
+++ b/tools/polldaemon.c
@@ -59,8 +59,6 @@ struct volume_group *poll_get_copy_vg(struct cmd_context *cmd,
const char *uuid __attribute__((unused)),
uint32_t flags)
{
- dev_close_all();
-
if (name && !strchr(name, '/'))
return vg_read(cmd, name, NULL, flags);
@@ -153,6 +151,7 @@ static void _nanosleep(unsigned secs, unsigned allow_zero_time)
static void _sleep_and_rescan_devices(struct daemon_parms *parms)
{
if (parms->interval && !parms->aborting) {
+ dev_close_all();
_nanosleep(parms->interval, 1);
/* Devices might have changed while we slept */
init_full_scan_done(0);
@@ -362,6 +361,8 @@ static void _poll_for_all_vgs(struct cmd_context *cmd,
process_each_vg(cmd, 0, NULL, READ_FOR_UPDATE, handle, _poll_vg);
if (!parms->outstanding_count)
break;
+ if (parms->interval)
+ dev_close_all();
_nanosleep(parms->interval, 1);
}
}
@@ -487,6 +488,9 @@ static void _lvmpolld_poll_for_all_vgs(struct cmd_context *cmd,
report_progress(cmd, idl->id, lpdp.parms);
}
+ if (lpdp.parms->interval)
+ dev_close_all();
+
_nanosleep(lpdp.parms->interval, 0);
}
@@ -513,6 +517,9 @@ static int _lvmpoll_daemon(struct cmd_context *cmd, struct poll_operation_id *id
(!parms->aborting && !(r = report_progress(cmd, id, parms))))
break;
+ if (parms->interval)
+ dev_close_all();
+
_nanosleep(parms->interval, 0);
}
}
8 years, 11 months
master - tests: add test for duplicate pvs
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e27182249a2cef...
Commit: e27182249a2cef2518fbbab1037810ed5c9a6d37
Parent: dc49e1cde0a0736c581b10062797807c65ae0ce3
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Apr 23 14:52:21 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue May 19 11:02:53 2015 -0500
tests: add test for duplicate pvs
---
test/shell/process-each-duplicate-pvs.sh | 135 ++++++++++++++++++++++++++++++
1 files changed, 135 insertions(+), 0 deletions(-)
diff --git a/test/shell/process-each-duplicate-pvs.sh b/test/shell/process-each-duplicate-pvs.sh
new file mode 100644
index 0000000..353b296
--- /dev/null
+++ b/test/shell/process-each-duplicate-pvs.sh
@@ -0,0 +1,135 @@
+#!/bin/sh
+# Copyright (C) 2008-2013 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+
+test_description='Test duplicate PVs'
+
+. lib/inittest
+
+aux prepare_devs 2
+
+pvcreate "$dev1"
+vgcreate $vg1 "$dev1"
+
+# Clone the PV
+dd if="$dev1" of="$dev2" bs=256K count=1 iflag=direct oflag=direct
+aux notify_lvmetad "$dev2"
+
+# When there are cloned devices (same pvid), one will be referenced in
+# lvmcache as pv->dev, and the other will not be referenced from lvmcache,
+# it'll only be in device cache. The one referenced by lvmcache is
+# referred to as the "preferred" one, and is the one that is printed by a
+# standard 'pvs' command.
+#
+# We don't know if dev1 or dev2 will be preferred, so we first check that
+# and save it as PV1, the other as PV2.
+#
+# The rules that 'pvs' follows to choose which PVs to display are
+# somewhat strange and seem arbitrary from a user perspective;
+# the choice is driven largely by what's most practical in the code,
+# but also by what vgimportclone needs.
+#
+# Some of the rules that process_each_pv is using:
+# - When no pv arg is specified, print the one preferred dev.
+# - When pv args are specified, print one line per specified arg,
+# i.e. don't print all duplicate pvs when one is specified.
+# - Always print the preferred duplicate, even if it was not the
+# one specified, e.g. If there are two duplicates on A and B,
+# and A is the preferred device, then 'pvs A' will show A and
+# 'pvs B' will show A.
+# - If multiple duplicates are specified, then print each, e.g.
+# 'pvs A B' will show both A and B.
+# - If three duplicates exist on A, B, C, and the preferred is A,
+# and the command 'pvs B C' is run, then the A will be printed
+# first since we always print the preferred device, and then
+# either B or C will be printed. 'pvs A B C' will print all.
+# - 'pvs -a' should print all the duplicates and should show
+# the same VG for each.
+# - 'pvs -o+size ...' should show the correct size of the
+# devices being printed if they differ among the duplicates.
+# - By using 'pvs --config' with a filter, you can filter out
+# the duplicate devs you don't want so that pvs will
+# print the devs you do want to see.
+#
+# The tests below check these behaviors on up to two duplicates,
+# so if the process_each_pv logic changes regarding which
+# duplicates are chosen, then this test will need adjusting.
+
+# Verify that there is only one PV printed, i.e. the preferred
+pvs --noheading | tee out
+test $(wc -l < out) -eq 1
+
+# Set PV1 to the perferred/cached PV, and PV2 to the other.
+# Cannot use pvs -o pv_name because that command goes to
+# disk and does not represent what lvmetad thinks.
+PV1=$(pvs --noheading | awk '{ print $1 }')
+echo PV1 is $PV1
+if [ $PV1 == $dev1 ]; then
+ PV2=$dev2
+else
+ PV2=$dev1
+fi
+echo PV2 is $PV2
+
+# check listed pvs
+pvs --noheading | tee out
+grep $PV1 out
+not grep $PV2 out
+
+# check error messages
+pvs --noheading 2>&1 | tee out
+grep "Found duplicate" out >err
+grep "using $PV1 not $PV2" err
+
+# check listed pvs
+pvs --noheading "$dev1" | tee out
+grep $PV1 out
+not grep $PV2 out
+
+# check error messages
+pvs --noheading "$dev1" 2>&1 | tee out
+grep "Found duplicate" out >err
+grep "using $PV1 not $PV2" err
+
+# check listed pvs
+pvs --noheading "$dev2" | tee out
+grep $PV1 out
+not grep $PV2 out
+
+# check error messages
+pvs --noheading "$dev2" 2>&1 | tee out
+grep "Found duplicate" out >err
+grep "using $PV1 not $PV2" err
+
+# check listed pvs
+pvs --noheading "$dev1" "$dev2" | tee out
+grep $PV1 out
+grep $PV2 out
+
+# check error messages
+pvs --noheading "$dev1" "$dev2" 2>&1 | tee out
+grep "Found duplicate" out >err
+grep "using $PV1 not $PV2" err
+
+# check listed pvs
+pvs --noheading -a | tee out
+grep $PV1 out
+grep $PV2 out
+grep $PV1 out | grep $vg1
+grep $PV2 out | grep $vg1
+
+# check error messages
+pvs --noheading -a 2>&1 | tee out
+grep "Found duplicate" out >err
+grep "using $PV1 not $PV2" err
+
+
+# TODO: I'd like to test that a subsystem device is preferred
+# over a non-subsystem device, but all the devices used here
+# are DM devices, i.e. they are already subsystem devices,
+# so I can't just wrap a standard block device with a DM
+# identity mapping.
+
8 years, 11 months
master - configure: update localedir
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=dc49e1cde0a073...
Commit: dc49e1cde0a0736c581b10062797807c65ae0ce3
Parent: aa2d39c2ca720d9443c2682311945d56ab9a0559
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon May 18 18:13:07 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon May 18 18:48:18 2015 +0200
configure: update localedir
Previous patch incorrectly skipped replace of @LOCALEDIR@.
The standard option is --localedir so use --with-localedir
as backward compatible option and set localedir if it's not
yet been set (if the could ever happen).
Use double-eval to translate $datarootdir to $prefix to real dir.
---
configure | 10 ++++++----
configure.in | 8 +++++---
lib/misc/configure.h.in | 2 +-
make.tmpl.in | 2 +-
4 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/configure b/configure
index 9cd225a..6d5abc4 100755
--- a/configure
+++ b/configure
@@ -1724,7 +1724,7 @@ Optional Packages:
lvmetad pidfile [PID_DIR/lvmetad.pid]
--with-lvmpolld-pidfile=PATH
lvmpolld pidfile [PID_DIR/lvmpolld.pid]
- --with-localedir=DIR translation files in DIR [PREFIX/share/locale]
+ --with-localedir=DIR locale-dependent data [DATAROOTDIR/locale]
--with-confdir=DIR configuration files in DIR [/etc]
--with-staticdir=DIR static binaries in DIR [EPREFIX/sbin]
--with-usrlibdir=DIR usrlib in DIR [PREFIX/lib]
@@ -12432,9 +12432,9 @@ fi
# Check whether --with-localedir was given.
if test "${with_localedir+set}" = set; then :
- withval=$with_localedir; LOCALEDIR=$withval
+ withval=$with_localedir; localedir=$withval
else
- LOCALEDIR="${prefix}/share/locale"
+ localedir=${localedir-'${datarootdir}/locale'}
fi
@@ -12442,9 +12442,10 @@ cat >>confdefs.h <<_ACEOF
#define INTL_PACKAGE "$INTL_PACKAGE"
_ACEOF
+ # double eval needed ${datarootdir} -> ${prefix}/share -> real path
cat >>confdefs.h <<_ACEOF
-#define LOCALEDIR "$LOCALEDIR"
+#define LOCALEDIR "$(eval echo $(eval echo $localedir))"
_ACEOF
fi
@@ -13264,6 +13265,7 @@ LVM_LIBAPI=`echo "$VER" | $AWK -F '[()]' '{print $2}'`
+
################################################################################
ac_config_files="$ac_config_files Makefile make.tmpl daemons/Makefile daemons/clvmd/Makefile daemons/cmirrord/Makefile daemons/dmeventd/Makefile daemons/dmeventd/libdevmapper-event.pc daemons/dmeventd/plugins/Makefile daemons/dmeventd/plugins/lvm2/Makefile daemons/dmeventd/plugins/raid/Makefile daemons/dmeventd/plugins/mirror/Makefile daemons/dmeventd/plugins/snapshot/Makefile daemons/dmeventd/plugins/thin/Makefile daemons/lvmetad/Makefile daemons/lvmpolld/Makefile conf/Makefile conf/example.conf conf/lvmlocal.conf conf/command_profile_template.profile conf/metadata_profile_template.profile include/.symlinks include/Makefile lib/Makefile lib/format1/Makefile lib/format_pool/Makefile lib/locking/Makefile lib/mirror/Makefile lib/replicator/Makefile lib/misc/lvm-version.h lib/raid/Makefile lib/snapshot/Makefile lib/thin/Makefile lib/cache_segtype/Makefile libdaemon/Makefile libdaemon/client/Makefile libdaemon/server/Makefile libdm/Makefile libdm/libdevmapper.pc liblvm/Makefile
liblvm/liblvm2app.pc man/Makefile po/Makefile python/Makefile python/setup.py scripts/blkdeactivate.sh scripts/blk_availability_init_red_hat scripts/blk_availability_systemd_red_hat.service scripts/clvmd_init_red_hat scripts/cmirrord_init_red_hat scripts/dm_event_systemd_red_hat.service scripts/dm_event_systemd_red_hat.socket scripts/lvm2_cluster_activation_red_hat.sh scripts/lvm2_cluster_activation_systemd_red_hat.service scripts/lvm2_clvmd_systemd_red_hat.service scripts/lvm2_cmirrord_systemd_red_hat.service scripts/lvm2_lvmetad_init_red_hat scripts/lvm2_lvmetad_systemd_red_hat.service scripts/lvm2_lvmetad_systemd_red_hat.socket scripts/lvm2_lvmpolld_init_red_hat scripts/lvm2_lvmpolld_systemd_red_hat.service scripts/lvm2_lvmpolld_systemd_red_hat.socket scripts/lvm2_monitoring_init_red_hat scripts/lvm2_monitoring_systemd_red_hat.service scripts/lvm2_pvscan_systemd_red_hat@.service scripts/lvm2_tmpfiles_red_hat.conf scripts/Makefile test/Makefile test/api/Makefile test/unit/
Makefile tools/Makefile udev/Makefile unit-tests/datastruct/Makefile unit-tests/regex/Makefile unit-tests/mm/Makefile"
diff --git a/configure.in b/configure.in
index d31c431..75af936 100644
--- a/configure.in
+++ b/configure.in
@@ -1516,10 +1516,11 @@ 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")
+ [locale-dependent data [DATAROOTDIR/locale]]),
+ localedir=$withval, localedir=${localedir-'${datarootdir}/locale'})
AC_DEFINE_UNQUOTED([INTL_PACKAGE], ["$INTL_PACKAGE"], [Internalization package])
- AC_DEFINE_UNQUOTED([LOCALEDIR], ["$LOCALEDIR"], [Location of translation files])
+ # double eval needed ${datarootdir} -> ${prefix}/share -> real path
+ AC_DEFINE_UNQUOTED([LOCALEDIR], ["$(eval echo $(eval echo $localedir))"], [Locale-dependent data])
fi
################################################################################
@@ -1813,6 +1814,7 @@ AC_SUBST(LVM_PATCHLEVEL)
AC_SUBST(LVM_PATH)
AC_SUBST(LVM_RELEASE)
AC_SUBST(LVM_RELEASE_DATE)
+AC_SUBST(localedir)
AC_SUBST(MANGLING)
AC_SUBST(MIRRORS)
AC_SUBST(MSGFMT)
diff --git a/lib/misc/configure.h.in b/lib/misc/configure.h.in
index 986b2bc..3af8ec0 100644
--- a/lib/misc/configure.h.in
+++ b/lib/misc/configure.h.in
@@ -507,7 +507,7 @@
/* Internalization package */
#undef INTL_PACKAGE
-/* Location of translation files */
+/* Locale-dependent data */
#undef LOCALEDIR
/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
diff --git a/make.tmpl.in b/make.tmpl.in
index 95ca299..806bde4 100644
--- a/make.tmpl.in
+++ b/make.tmpl.in
@@ -82,7 +82,7 @@ datarootdir = @datarootdir@
datadir = $(DESTDIR)@datadir@
infodir = $(DESTDIR)@infodir@
mandir = $(DESTDIR)@mandir@
-localedir = $(DESTDIR)@LOCALEDIR@
+localedir = $(DESTDIR)@localedir@
staticdir = $(DESTDIR)@STATICDIR@
udevdir = $(DESTDIR)@udevdir@
pkgconfigdir = $(usrlibdir)/pkgconfig
8 years, 11 months
master - configure: LOCALEDIR needs evaluated value
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=aa2d39c2ca720d...
Commit: aa2d39c2ca720d9443c2682311945d56ab9a0559
Parent: 0cb9df3cec424c7c4e7ea5b198f419f3ef8a8c5d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon May 18 13:04:07 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon May 18 13:06:34 2015 +0200
configure: LOCALEDIR needs evaluated value
Also fix typo.
---
aclocal.m4 | 4 ++--
configure | 2 +-
configure.in | 4 ++--
lib/misc/configure.h.in | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/aclocal.m4 b/aclocal.m4
index 2325191..05e0ad5 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.15 -*- Autoconf -*-
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
diff --git a/configure b/configure
index 3b2b7ba..9cd225a 100755
--- a/configure
+++ b/configure
@@ -12434,7 +12434,7 @@ fi
if test "${with_localedir+set}" = set; then :
withval=$with_localedir; LOCALEDIR=$withval
else
- LOCALEDIR='${prefix}/share/locale'
+ LOCALEDIR="${prefix}/share/locale"
fi
diff --git a/configure.in b/configure.in
index ba0b236..d31c431 100644
--- a/configure.in
+++ b/configure.in
@@ -1517,9 +1517,9 @@ 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")
AC_DEFINE_UNQUOTED([INTL_PACKAGE], ["$INTL_PACKAGE"], [Internalization package])
- AC_DEFINE_UNQUOTED([LOCALEDIR], ["$LOCALEDIR"], [Location of transaltion files])
+ AC_DEFINE_UNQUOTED([LOCALEDIR], ["$LOCALEDIR"], [Location of translation files])
fi
################################################################################
diff --git a/lib/misc/configure.h.in b/lib/misc/configure.h.in
index 2f17190..986b2bc 100644
--- a/lib/misc/configure.h.in
+++ b/lib/misc/configure.h.in
@@ -507,7 +507,7 @@
/* Internalization package */
#undef INTL_PACKAGE
-/* Location of transaltion files */
+/* Location of translation files */
#undef LOCALEDIR
/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
8 years, 11 months
master - tests: fix calcucaltion
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0cb9df3cec424c...
Commit: 0cb9df3cec424c7c4e7ea5b198f419f3ef8a8c5d
Parent: caaca15854440c1781ecde06f3f8e3ecc6c728ca
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon May 18 10:16:09 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon May 18 12:45:43 2015 +0200
tests: fix calcucaltion
Code works properly.
---
test/shell/lvcreate-raid.sh | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/test/shell/lvcreate-raid.sh b/test/shell/lvcreate-raid.sh
index 2ddc7e3..f5e25c6 100644
--- a/test/shell/lvcreate-raid.sh
+++ b/test/shell/lvcreate-raid.sh
@@ -86,11 +86,11 @@ check lv_field $vg/raid1 size "56.50m"
lvremove -ff $vg
# 1 metadata LV = 1 extent
-# 1 image = 37 extents
-# 5 images = 190 extents = 95.00m = lv_size
+# 1 image = 37 extents = 18.5m
+# 5 images = 185 extents = 92.5m = lv_size
+lvs -a $vg
lvcreate --type raid5 -i 5 -l 100%FREE -an -Zn -n raid5 $vg
-should check lv_field $vg/raid5 size "95.00m"
-#FIXME: Currently allocates incorrectly at 87.50m
+check lv_field $vg/raid5 size "92.50m"
lvremove -ff $vg
# 1 image = 37+38 extents
@@ -102,8 +102,7 @@ lvremove -ff $vg
# 1 image = 37 extents
# 4 images = 148 extents = 74.00m = lv_size
lvcreate --type raid6 -i 4 -l 100%FREE -an -Zn -n raid6 $vg
-should check lv_field $vg/raid6 size "74.00m"
-#FIXME: Currnently allocates incorrectly at 70.00m
+check lv_field $vg/raid6 size "74.00m"
lvremove -ff $vg
###
8 years, 11 months
master - tests: thin_restore not needed
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=caaca15854440c...
Commit: caaca15854440c1781ecde06f3f8e3ecc6c728ca
Parent: 62ac80c8fad09fb14f27d56663a5377948e20fce
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon May 18 10:14:12 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon May 18 12:45:42 2015 +0200
tests: thin_restore not needed
Few more test which could live without thin_restore.
---
test/api/thin_percent.sh | 2 ++
test/shell/lvconvert-thin-external.sh | 2 ++
test/shell/lvconvert-thin-raid.sh | 2 ++
test/shell/lvconvert-thin.sh | 2 ++
4 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/test/api/thin_percent.sh b/test/api/thin_percent.sh
index f93bd15..fd64e3b 100644
--- a/test/api/thin_percent.sh
+++ b/test/api/thin_percent.sh
@@ -11,6 +11,8 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
+
. lib/inittest
aux have_thin 1 0 0 || skip
diff --git a/test/shell/lvconvert-thin-external.sh b/test/shell/lvconvert-thin-external.sh
index b688d3a..eba9e36 100644
--- a/test/shell/lvconvert-thin-external.sh
+++ b/test/shell/lvconvert-thin-external.sh
@@ -12,6 +12,8 @@
# Test conversion to thin external origin
+export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
+
. lib/inittest
test -e LOCAL_LVMPOLLD && skip
diff --git a/test/shell/lvconvert-thin-raid.sh b/test/shell/lvconvert-thin-raid.sh
index 8b4052c..bd554b2 100644
--- a/test/shell/lvconvert-thin-raid.sh
+++ b/test/shell/lvconvert-thin-raid.sh
@@ -10,6 +10,8 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
+
. lib/inittest
test -e LOCAL_LVMPOLLD && skip
diff --git a/test/shell/lvconvert-thin.sh b/test/shell/lvconvert-thin.sh
index b833362..8270c0e 100644
--- a/test/shell/lvconvert-thin.sh
+++ b/test/shell/lvconvert-thin.sh
@@ -10,6 +10,8 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
+
. lib/inittest
test -e LOCAL_LVMPOLLD && skip
8 years, 11 months
master - makefiles: drop LVM_SHARED_PATH
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=62ac80c8fad09f...
Commit: 62ac80c8fad09fb14f27d56663a5377948e20fce
Parent: 30c3bbcd9e852d7f79846ecc57148a47e52e818d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon May 18 12:16:24 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon May 18 12:45:42 2015 +0200
makefiles: drop LVM_SHARED_PATH
We already have LVM_PATH define used everywhere else
to access LVM binary so stay with one name.
---
tools/Makefile.in | 2 --
tools/lvmcmdline.c | 6 +++---
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/tools/Makefile.in b/tools/Makefile.in
index 9bbf87b..cec74a9 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -114,8 +114,6 @@ LVMLIBS += -ldevmapper
EXPORTED_HEADER = $(srcdir)/lvm2cmd.h
EXPORTED_FN_PREFIX = lvm2
-DEFS += -DLVM_SHARED_PATH=\"$(exec_prefix)/sbin/lvm\"
-
CFLOW_LIST = lvmcmdlib.c lvm2cmd.c
CFLOW_LIST_TARGET = liblvm2cmd.cflow
CFLOW_TARGET = lvm
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index 78974df..29fffb3 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -1925,12 +1925,12 @@ int lvm2_main(int argc, char **argv)
return -1;
if (is_static() && strcmp(base, "lvm.static") &&
- path_exists(LVM_SHARED_PATH) &&
+ path_exists(LVM_PATH) &&
!getenv("LVM_DID_EXEC")) {
if (setenv("LVM_DID_EXEC", base, 1))
log_sys_error("setenv", "LVM_DID_EXEC");
- if (execvp(LVM_SHARED_PATH, argv) == -1)
- log_sys_error("execvp", "LVM_SHARED_PATH");
+ if (execvp(LVM_PATH, argv) == -1)
+ log_sys_error("execvp", LVM_PATH);
if (unsetenv("LVM_DID_EXEC"))
log_sys_error("unsetenv", "LVM_DID_EXEC");
}
8 years, 11 months
master - makefiles: better clean
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=30c3bbcd9e852d...
Commit: 30c3bbcd9e852d7f79846ecc57148a47e52e818d
Parent: 1bed578535f9f2442916ce7da060132233502bcb
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon May 18 10:27:48 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon May 18 12:45:42 2015 +0200
makefiles: better clean
More exact clean of library exported symbols files.
Also use $(firstword) test to check for empty string
so 'make clean' has now cleaner condensed look.
Clean also created include links.
---
include/Makefile.in | 12 ++++++++----
libdm/Makefile.in | 2 +-
liblvm/Makefile.in | 2 +-
make.tmpl.in | 20 ++++++++++++++------
test/Makefile.in | 10 ++++------
tools/Makefile.in | 3 ++-
6 files changed, 30 insertions(+), 19 deletions(-)
diff --git a/include/Makefile.in b/include/Makefile.in
index 3daaab1..2049b67 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -20,8 +20,12 @@ include $(top_builddir)/make.tmpl
all: .symlinks_created
-.symlinks_created: .symlinks
- find . -maxdepth 1 -type l -exec $(RM) \{\} \;
+LINKS := $(shell find . -maxdepth 1 -type l)
+
+.symlinks_created: .symlinks
+ifneq (,$(firstword $(LINKS)))
+ $(RM) $(LINKS)
+endif
for i in `cat $<`; do $(LN_S) $$i ; done
touch $@
@@ -31,5 +35,5 @@ device-mapper: all
cflow: all
-DISTCLEAN_TARGETS += $(shell find . -maxdepth 1 -type l)
-DISTCLEAN_TARGETS += .include_symlinks .symlinks_created .symlinks
+DISTCLEAN_TARGETS += .symlinks
+CLEAN_TARGETS += $(LINKS) .include_symlinks .symlinks_created
diff --git a/libdm/Makefile.in b/libdm/Makefile.in
index c1d7871..ba65c6a 100644
--- a/libdm/Makefile.in
+++ b/libdm/Makefile.in
@@ -94,4 +94,4 @@ install_ioctl_static: $(LIB_STATIC)
$(INSTALL_DATA) -D $< $(usrlibdir)/$(<F)
CLEAN_TARGETS += ioctl/libdevmapper.a
-DISTCLEAN_TARGETS += libdevmapper.pc .exported_symbols_generated
+DISTCLEAN_TARGETS += libdevmapper.pc
diff --git a/liblvm/Makefile.in b/liblvm/Makefile.in
index d0f8d1b..69c12bb 100644
--- a/liblvm/Makefile.in
+++ b/liblvm/Makefile.in
@@ -81,4 +81,4 @@ liblvm.cflow: $(SOURCES)
cflow: liblvm.cflow
-DISTCLEAN_TARGETS += $(LIB_NAME).pc .exported_symbols_generated
+DISTCLEAN_TARGETS += $(LIB_NAME).pc
diff --git a/make.tmpl.in b/make.tmpl.in
index 4ad7f58..95ca299 100644
--- a/make.tmpl.in
+++ b/make.tmpl.in
@@ -423,6 +423,8 @@ endif
$(LIB_SHARED): $(LIB_SHARED).$(LIB_VERSION)
$(LN_S) -f $(<F) $@
+CLEAN_TARGETS += $(LDDEPS) .exported_symbols_generated
+
install_lib_shared: $(LIB_SHARED)
$(INSTALL_PROGRAM) -D $< $(libdir)/$(<F).$(LIB_VERSION)
$(INSTALL_DIR) $(usrlibdir)
@@ -459,17 +461,23 @@ $(LIB_STATIC): $(OBJECTS)
%.mo: %.po
$(MSGFMT) -o $@ $<
+CLEAN_TARGETS += \
+ $(SOURCES:%.c=%.d) $(SOURCES:%.c=%.gcno) $(SOURCES:%.c=%.gcda) \
+ $(SOURCES2:%.c=%.o) $(SOURCES2:%.c=%.d) $(SOURCES2:%.c=%.gcno) $(SOURCES2:%.c=%.gcda) \
+ $(POTFILES) $(CLEAN_CFLOW)
+
cleandir:
- test -z "$(CLEAN_DIRS)" || $(RM) -r $(CLEAN_DIRS)
- $(RM) $(OBJECTS) $(TARGETS) $(CLEAN_TARGETS) $(CLEAN_CFLOW) $(LDDEPS) \
- $(POTFILES) $(SOURCES:%.c=%.d) $(SOURCES:%.c=%.gcno) $(SOURCES:%.c=%.gcda) \
- $(SOURCES2:%.c=%.o) $(SOURCES2:%.c=%.d) $(SOURCES2:%.c=%.gcno) $(SOURCES2:%.c=%.gcda) \
- .exported_symbols_generated core
+ifneq (,$(firstword $(CLEAN_DIRS)))
+ $(RM) -r $(CLEAN_DIRS)
+endif
+ $(RM) $(OBJECTS) $(TARGETS) $(CLEAN_TARGETS) core
clean: $(SUBDIRS.clean) cleandir
distclean: cleandir $(SUBDIRS.distclean)
- test -z "$(DISTCLEAN_DIRS)" || $(RM) -r $(DISTCLEAN_DIRS)
+ifneq (,$(firstword $(DISTCLEAN_DIRS)))
+ $(RM) -r $(DISTCLEAN_DIRS)
+endif
$(RM) $(DISTCLEAN_TARGETS) Makefile
.exported_symbols_generated: $(EXPORTED_HEADER) .exported_symbols $(DEPS)
diff --git a/test/Makefile.in b/test/Makefile.in
index 5b9d5ad..cd2c425 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -263,12 +263,10 @@ LIB = $(LIB_SHARED) $(LIB_LOCAL) $(LIB_EXEC) $(LIB_FLAVOURS)
$(LN_S) -f $(abs_top_srcdir)/conf/thin-performance.profile lib/thin-performance.profile
touch $@
-cleantest:
- test "$(srcdir)" = . || $(RM) $(RUN_BASE)
- $(RM) -r $(LVM_TEST_RESULTS)
-
-clean: cleantest
-distclean: cleantest
+CLEAN_DIRS += $(LVM_TEST_RESULTS)
+ifneq (.,$(firstword $(srcdir)))
+CLEAN_TARGETS += $(RUN_BASE)
+endif
CLEAN_TARGETS += .lib-dir-stamp .tests-stamp $(LIB) $(addprefix lib/,$(CMDS)) \
lib/clvmd lib/dmeventd lib/dmsetup lib/lvmetad lib/fsadm lib/vgimportclone \
diff --git a/tools/Makefile.in b/tools/Makefile.in
index 20c988d..9bbf87b 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -97,7 +97,8 @@ LIB_VERSION = $(LIB_VERSION_LVM)
CLEAN_TARGETS = liblvm2cmd.$(LIB_SUFFIX) $(TARGETS_DM) \
liblvm2cmd.$(LIB_SUFFIX).$(LIB_VERSION) lvm-static.o \
- liblvm2cmd-static.a dmsetup.static lvm.static
+ liblvm2cmd-static.a dmsetup.static lvm.static \
+ $(LDDEPS) .exported_symbols_generated
ifeq ("@CMDLIB@", "yes")
TARGETS += liblvm2cmd.$(LIB_SUFFIX).$(LIB_VERSION)
8 years, 11 months
master - makefiles: use := for shell calls
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1bed578535f9f2...
Commit: 1bed578535f9f2442916ce7da060132233502bcb
Parent: bf2b1986c20ca8fccaac0d328d3530dacf5e40f0
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon May 18 10:27:15 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon May 18 12:45:42 2015 +0200
makefiles: use := for shell calls
---
test/Makefile.in | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/test/Makefile.in b/test/Makefile.in
index ecd510a..5b9d5ad 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -36,9 +36,9 @@ include $(top_builddir)/make.tmpl
T ?= .
S ?= @ # never match anything by default
VERBOSE ?= 0
-ALL = $(shell find $(srcdir) \( -path \*/shell/\*.sh -or -path \*/api/\*.sh \) | sort)
+ALL := $(shell find $(srcdir) \( -path \*/shell/\*.sh -or -path \*/api/\*.sh \) | sort)
comma = ,
-RUN = $(shell find $(srcdir) -regextype posix-egrep \( -path \*/shell/\*.sh -or -path \*/api/\*.sh \) -and -regex "$(srcdir)/.*($(subst $(comma),|,$(T))).*" -and -not -regex "$(srcdir)/.*($(subst $(comma),|,$(S))).*" | sort)
+RUN := $(shell find $(srcdir) -regextype posix-egrep \( -path \*/shell/\*.sh -or -path \*/api/\*.sh \) -and -regex "$(srcdir)/.*($(subst $(comma),|,$(T))).*" -and -not -regex "$(srcdir)/.*($(subst $(comma),|,$(S))).*" | sort)
RUN_BASE = $(subst $(srcdir)/,,$(RUN))
ifeq ("@BUILD_LVMETAD@", "yes")
@@ -54,7 +54,7 @@ LVMPOLLD_UDEV_FLAVOUR = ,udev-lvmpolld,udev-cluster-lvmpolld,udev-lvmetad-lvmpol
endif
# Shell quote;
-SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
+SHELL_PATH_SQ := $(subst ','\'',$(SHELL_PATH))
ifeq ("@UDEV_SYNC@", "yes")
dm_udev_synchronisation = 1
8 years, 11 months