master - devmapper: fix compilation without devmapper
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=675fcfe9b7f5d6...
Commit: 675fcfe9b7f5d624f8b9e45bc61869ef0ff830b5
Parent: 905d4cda7ae17aa1eb8f8d0e85b9d577e650bb60
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Apr 29 13:22:10 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Apr 30 10:26:29 2014 +0200
devmapper: fix compilation without devmapper
Fix compilation when configured with --disable-devmapper option.
---
lib/activate/activate.c | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/lib/activate/activate.c b/lib/activate/activate.c
index a7ec751..6a9dd0a 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -200,7 +200,7 @@ int lv_passes_auto_activation_filter(struct cmd_context *cmd, struct logical_vol
}
#ifndef DEVMAPPER_SUPPORT
-void set_activation(int act)
+void set_activation(int act, int silent)
{
static int warned = 0;
@@ -282,15 +282,15 @@ int lv_raid_message(const struct logical_volume *lv, const char *msg)
{
return 0;
}
-int lv_cache_block_info(const struct logical_volume *lv,
+int lv_cache_block_info(struct logical_volume *lv,
uint32_t *chunk_size, uint64_t *dirty_count,
uint64_t *used_count, uint64_t *total_count)
{
return 0;
}
-int lv_cache_policy_info(const struct logical_volume *lv,
- char **policy_name, int *policy_argc,
- const char *const **policy_argv)
+int lv_cache_policy_info(struct logical_volume *lv,
+ const char **policy_name, int *policy_argc,
+ const char ***policy_argv)
{
return 0;
}
@@ -309,6 +309,10 @@ int lv_thin_pool_transaction_id(const struct logical_volume *lv,
{
return 0;
}
+int lv_thin_device_id(const struct logical_volume *lv, uint32_t *device_id)
+{
+ return 0;
+}
int lvs_in_vg_activated(const struct volume_group *vg)
{
return 0;
9 years, 11 months
master - libdm: cleanup complation without DM_IOCTLS
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=905d4cda7ae17a...
Commit: 905d4cda7ae17aa1eb8f8d0e85b9d577e650bb60
Parent: ad77fb50bd568718b12336ca0f0c81e3730b6237
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Apr 29 23:40:43 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Apr 30 10:26:29 2014 +0200
libdm: cleanup complation without DM_IOCTLS
---
libdm/ioctl/libdm-iface.c | 21 +++++++++++++--------
1 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/libdm/ioctl/libdm-iface.c b/libdm/ioctl/libdm-iface.c
index 73cda17..345651b 100644
--- a/libdm/ioctl/libdm-iface.c
+++ b/libdm/ioctl/libdm-iface.c
@@ -68,10 +68,6 @@ static unsigned _dm_version_minor = 0;
static unsigned _dm_version_patchlevel = 0;
static int _log_suppress = 0;
-static int _kernel_major = 0;
-static int _kernel_minor = 0;
-static int _kernel_release = 0;
-
/*
* If the kernel dm driver only supports one major number
* we store it in _dm_device_major. Otherwise we indicate
@@ -133,6 +129,11 @@ static char *_align(char *ptr, unsigned int a)
return (char *) (((unsigned long) ptr + agn) & ~agn);
}
+#ifdef DM_IOCTLS
+static int _kernel_major = 0;
+static int _kernel_minor = 0;
+static int _kernel_release = 0;
+
static int _uname(void)
{
static int _uts_set = 0;
@@ -148,9 +149,7 @@ static int _uname(void)
}
parts = sscanf(_uts.release, "%d.%d.%d",
- &_kernel_major,
- &_kernel_minor,
- &_kernel_release);
+ &_kernel_major, &_kernel_minor, &_kernel_release);
/* Kernels with a major number of 2 always had 3 parts. */
if (parts < 1 || (_kernel_major < 3 && parts < 3)) {
@@ -162,7 +161,6 @@ static int _uname(void)
return 1;
}
-#ifdef DM_IOCTLS
/*
* Set number to NULL to populate _dm_bitset - otherwise first
* match is returned.
@@ -357,6 +355,7 @@ static void _close_control_fd(void)
}
}
+#ifdef DM_IOCTLS
static int _open_and_assign_control_fd(const char *control)
{
if ((_control_fd = open(control, O_RDWR)) < 0) {
@@ -366,6 +365,7 @@ static int _open_and_assign_control_fd(const char *control)
return 1;
}
+#endif
static int _open_control(void)
{
@@ -1285,6 +1285,7 @@ static int _udev_complete(struct dm_task *dmt)
return 1;
}
+#ifdef DM_IOCTLS
static int _check_uevent_generated(struct dm_ioctl *dmi)
{
if (!dm_check_version() ||
@@ -1295,6 +1296,7 @@ static int _check_uevent_generated(struct dm_ioctl *dmi)
return dmi->flags & DM_UEVENT_GENERATED_FLAG;
}
+#endif
static int _create_and_load_v4(struct dm_task *dmt)
{
@@ -1598,6 +1600,7 @@ static const char *_sanitise_message(char *message)
return sanitised_message;
}
+#ifdef DM_IOCTLS
static int _do_dm_ioctl_unmangle_string(char *str, const char *str_name,
char *buf, size_t buf_size,
dm_string_mangling_t mode)
@@ -1658,6 +1661,7 @@ static int _dm_ioctl_unmangle_uuids(int type, struct dm_ioctl *dmi)
return 1;
}
+#endif
static struct dm_ioctl *_do_dm_ioctl(struct dm_task *dmt, unsigned command,
unsigned buffer_repeat_count,
@@ -1794,6 +1798,7 @@ static struct dm_ioctl *_do_dm_ioctl(struct dm_task *dmt, unsigned command,
goto error;
#else /* Userspace alternative for testing */
+ goto error;
#endif
return dmi;
9 years, 11 months
master - configure: corrected ioctl option
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ad77fb50bd5687...
Commit: ad77fb50bd568718b12336ca0f0c81e3730b6237
Parent: 517b0026481d29d31524e472efbdc99e945c9c12
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Apr 29 12:44:32 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Apr 30 10:26:28 2014 +0200
configure: corrected ioctl option
The correct name for disable ioctl option is --disable-ioctl
(--disable-driver never worked)
Also sort scripts generated files alphabetically.
---
configure | 16 ++++++++--------
configure.in | 16 ++++++++--------
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/configure b/configure
index bc8abd9..de93e77 100755
--- a/configure
+++ b/configure
@@ -1610,7 +1610,7 @@ Optional Features:
--enable-compat enable support for old device-mapper versions
--enable-units-compat enable output compatibility with old versions that
that do not use KiB-style unit suffixes
- --disable-driver disable calls to device-mapper in the kernel
+ --disable-ioctl disable ioctl calls to device-mapper in the kernel
--disable-o_direct disable O_DIRECT
--enable-applib build application library
--enable-cmdlib build shared command library
@@ -11542,7 +11542,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 conf/Makefile conf/example.conf conf/default.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.s
h scripts/blk_availability_init_red_hat scripts/blk_availability_systemd_red_hat.service scripts/lvm2_cluster_activation_red_hat.sh scripts/lvm2_cluster_activation_systemd_red_hat.service scripts/clvmd_init_red_hat scripts/lvm2_clvmd_systemd_red_hat.service scripts/cmirrord_init_red_hat scripts/lvm2_cmirrord_systemd_red_hat.service scripts/lvm2_lvmetad_init_red_hat scripts/lvm2_lvmetad_systemd_red_hat.socket scripts/lvm2_lvmetad_systemd_red_hat.service scripts/lvm2_pvscan_systemd_red_hat@.service scripts/lvm2_monitoring_init_red_hat scripts/dm_event_systemd_red_hat.socket scripts/dm_event_systemd_red_hat.service scripts/lvm2_monitoring_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"
+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 conf/Makefile conf/example.conf conf/default.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.s
h 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_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"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -12281,20 +12281,20 @@ do
"scripts/blkdeactivate.sh") CONFIG_FILES="$CONFIG_FILES scripts/blkdeactivate.sh" ;;
"scripts/blk_availability_init_red_hat") CONFIG_FILES="$CONFIG_FILES scripts/blk_availability_init_red_hat" ;;
"scripts/blk_availability_systemd_red_hat.service") CONFIG_FILES="$CONFIG_FILES scripts/blk_availability_systemd_red_hat.service" ;;
+ "scripts/clvmd_init_red_hat") CONFIG_FILES="$CONFIG_FILES scripts/clvmd_init_red_hat" ;;
+ "scripts/cmirrord_init_red_hat") CONFIG_FILES="$CONFIG_FILES scripts/cmirrord_init_red_hat" ;;
+ "scripts/dm_event_systemd_red_hat.service") CONFIG_FILES="$CONFIG_FILES scripts/dm_event_systemd_red_hat.service" ;;
+ "scripts/dm_event_systemd_red_hat.socket") CONFIG_FILES="$CONFIG_FILES scripts/dm_event_systemd_red_hat.socket" ;;
"scripts/lvm2_cluster_activation_red_hat.sh") CONFIG_FILES="$CONFIG_FILES scripts/lvm2_cluster_activation_red_hat.sh" ;;
"scripts/lvm2_cluster_activation_systemd_red_hat.service") CONFIG_FILES="$CONFIG_FILES scripts/lvm2_cluster_activation_systemd_red_hat.service" ;;
- "scripts/clvmd_init_red_hat") CONFIG_FILES="$CONFIG_FILES scripts/clvmd_init_red_hat" ;;
"scripts/lvm2_clvmd_systemd_red_hat.service") CONFIG_FILES="$CONFIG_FILES scripts/lvm2_clvmd_systemd_red_hat.service" ;;
- "scripts/cmirrord_init_red_hat") CONFIG_FILES="$CONFIG_FILES scripts/cmirrord_init_red_hat" ;;
"scripts/lvm2_cmirrord_systemd_red_hat.service") CONFIG_FILES="$CONFIG_FILES scripts/lvm2_cmirrord_systemd_red_hat.service" ;;
"scripts/lvm2_lvmetad_init_red_hat") CONFIG_FILES="$CONFIG_FILES scripts/lvm2_lvmetad_init_red_hat" ;;
- "scripts/lvm2_lvmetad_systemd_red_hat.socket") CONFIG_FILES="$CONFIG_FILES scripts/lvm2_lvmetad_systemd_red_hat.socket" ;;
"scripts/lvm2_lvmetad_systemd_red_hat.service") CONFIG_FILES="$CONFIG_FILES scripts/lvm2_lvmetad_systemd_red_hat.service" ;;
- "scripts/lvm2_pvscan_systemd_red_hat@.service") CONFIG_FILES="$CONFIG_FILES scripts/lvm2_pvscan_systemd_red_hat@.service" ;;
+ "scripts/lvm2_lvmetad_systemd_red_hat.socket") CONFIG_FILES="$CONFIG_FILES scripts/lvm2_lvmetad_systemd_red_hat.socket" ;;
"scripts/lvm2_monitoring_init_red_hat") CONFIG_FILES="$CONFIG_FILES scripts/lvm2_monitoring_init_red_hat" ;;
- "scripts/dm_event_systemd_red_hat.socket") CONFIG_FILES="$CONFIG_FILES scripts/dm_event_systemd_red_hat.socket" ;;
- "scripts/dm_event_systemd_red_hat.service") CONFIG_FILES="$CONFIG_FILES scripts/dm_event_systemd_red_hat.service" ;;
"scripts/lvm2_monitoring_systemd_red_hat.service") CONFIG_FILES="$CONFIG_FILES scripts/lvm2_monitoring_systemd_red_hat.service" ;;
+ "scripts/lvm2_pvscan_systemd_red_hat@.service") CONFIG_FILES="$CONFIG_FILES scripts/lvm2_pvscan_systemd_red_hat@.service" ;;
"scripts/lvm2_tmpfiles_red_hat.conf") CONFIG_FILES="$CONFIG_FILES scripts/lvm2_tmpfiles_red_hat.conf" ;;
"scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;;
"test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;;
diff --git a/configure.in b/configure.in
index 3a6dc15..e3ddde1 100644
--- a/configure.in
+++ b/configure.in
@@ -1126,8 +1126,8 @@ fi
################################################################################
dnl -- Disable ioctl
AC_ARG_ENABLE(ioctl,
- AC_HELP_STRING([--disable-driver],
- [disable calls to device-mapper in the kernel]),
+ AC_HELP_STRING([--disable-ioctl],
+ [disable ioctl calls to device-mapper in the kernel]),
DM_IOCTLS=$enableval)
################################################################################
@@ -1813,20 +1813,20 @@ 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/clvmd_init_red_hat
scripts/lvm2_clvmd_systemd_red_hat.service
-scripts/cmirrord_init_red_hat
scripts/lvm2_cmirrord_systemd_red_hat.service
scripts/lvm2_lvmetad_init_red_hat
-scripts/lvm2_lvmetad_systemd_red_hat.socket
scripts/lvm2_lvmetad_systemd_red_hat.service
-scripts/lvm2_pvscan_systemd_red_hat@.service
+scripts/lvm2_lvmetad_systemd_red_hat.socket
scripts/lvm2_monitoring_init_red_hat
-scripts/dm_event_systemd_red_hat.socket
-scripts/dm_event_systemd_red_hat.service
scripts/lvm2_monitoring_systemd_red_hat.service
+scripts/lvm2_pvscan_systemd_red_hat@.service
scripts/lvm2_tmpfiles_red_hat.conf
scripts/Makefile
test/Makefile
9 years, 11 months
master - display: check for dmeventd support
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=517b0026481d29...
Commit: 517b0026481d29d31524e472efbdc99e945c9c12
Parent: b1f765d72aa56dab547a819447371b5315e78455
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Apr 30 10:13:35 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Apr 30 10:26:26 2014 +0200
display: check for dmeventd support
When quering for dmeventd monitoring status, check first
if lvm2 is configured to monitor to avoid unwanted start
of dmeventd process for answering monitoring status.
---
WHATS_NEW | 1 +
lib/metadata/lv.c | 3 ++-
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index bb5b4c3..456f132 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.107 -
==================================
+ Don't start dmeventd checking seg_monitor and monitoring is disabled.
Catch CTRL-c during pvremove prompts.
Show correct availability status for snapshot origin in lvscan.
Move segment thin pool/volume info into segment display 'lvdisplay --maps'.
diff --git a/lib/metadata/lv.c b/lib/metadata/lv.c
index 8445d16..0225704 100644
--- a/lib/metadata/lv.c
+++ b/lib/metadata/lv.c
@@ -146,7 +146,8 @@ char *lvseg_monitor_dup(struct dm_pool *mem, const struct lv_segment *seg)
segm = first_seg(seg->log_lv);
// log_debug("Query LV:%s mon:%s segm:%s tgtm:%p segmon:%d statusm:%d", seg->lv->name, segm->lv->name, segm->segtype->name, segm->segtype->ops->target_monitored, seg_monitored(segm), (int)(segm->status & PVMOVE));
- if (!segm->segtype->ops->target_monitored)
+ if ((dmeventd_monitor_mode() != 1) ||
+ !segm->segtype->ops->target_monitored)
/* Nothing to do, monitoring not supported */;
else if (lv_is_cow_covering_origin(seg->lv))
/* Nothing to do, snapshot already covers origin */;
9 years, 11 months
master - pvremove: Catch CTRL-c during prompts.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b1f765d72aa56d...
Commit: b1f765d72aa56dab547a819447371b5315e78455
Parent: 26989e0cd7fab4768f46803cd25bfc7499ab488e
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Tue Apr 29 08:16:28 2014 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Tue Apr 29 08:16:28 2014 +0100
pvremove: Catch CTRL-c during prompts.
---
WHATS_NEW | 1 +
tools/pvremove.c | 2 ++
2 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index fad66bf..bb5b4c3 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.107 -
==================================
+ Catch CTRL-c during pvremove prompts.
Show correct availability status for snapshot origin in lvscan.
Move segment thin pool/volume info into segment display 'lvdisplay --maps'.
Display thin pool usage even when just thin volume is available.
diff --git a/tools/pvremove.c b/tools/pvremove.c
index 7048b97..dfd6007 100644
--- a/tools/pvremove.c
+++ b/tools/pvremove.c
@@ -37,6 +37,8 @@ int pvremove(struct cmd_context *cmd, int argc, char **argv)
stack;
ret = ECMD_FAILED;
}
+ if (sigint_caught())
+ return_ECMD_FAILED;
}
return ret;
9 years, 11 months
master - tests: improve coverage
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=26989e0cd7fab4...
Commit: 26989e0cd7fab4768f46803cd25bfc7499ab488e
Parent: d8214cb1546f942cc7cbcfb4849b4549132d74a0
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Apr 28 11:57:42 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Apr 28 12:42:57 2014 +0200
tests: improve coverage
Test more code paths for lvscan & lvdisplay
---
test/shell/listings.sh | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/test/shell/listings.sh b/test/shell/listings.sh
index d46ee7f..7d9c37e 100644
--- a/test/shell/listings.sh
+++ b/test/shell/listings.sh
@@ -61,10 +61,19 @@ dmsetup ls | grep "$PREFIX" | grep -v "LVMTEST.*pv."
lvremove -f $vg/$lv2
#COMM lvs -a displays mirror legs and log
-lvcreate -aey -l4 --type mirror -m2 -n $lv3 $vg
+lvcreate -aey -l2 --type mirror -m2 -n $lv3 $vg
test $(lvs --noheadings $vg | wc -l) -eq 2
test $(lvs -a --noheadings $vg | wc -l) -eq 6
dmsetup ls|grep "$PREFIX"|grep -v "LVMTEST.*pv."
+lvcreate -l2 -s $vg/$lv3
+lvcreate -l1 -s -n inval $vg/$lv3
+lvcreate -l4 -I4 -i2 -n stripe $vg
+lvcreate -T $vg/pool -I4 -i2 -l5 -V1P -n thin
+# Invalidate snapshot
+not dd if=/dev/zero of="$DM_DEV_DIR/$vg/inval" bs=4K
+invalid lvscan "$dev1"
+lvdisplay --maps
+not lvscan --all
#COMM vgs with options from pvs still treats arguments as VGs (bz193543)
vgs -o pv_name,vg_name $vg
9 years, 11 months
master - cleanup: put all tests within switch
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d8214cb1546f94...
Commit: d8214cb1546f942cc7cbcfb4849b4549132d74a0
Parent: d1aba7ccf6d1bc5f3bc1fa1b5fe70eec64f8c633
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Apr 28 10:17:30 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Apr 28 12:42:56 2014 +0200
cleanup: put all tests within switch
No reason to check for VALID in extra if.
---
lib/display/display.c | 49 +++++++++++++++++++++++++------------------------
1 files changed, 25 insertions(+), 24 deletions(-)
diff --git a/lib/display/display.c b/lib/display/display.c
index 36274b6..b83bb59 100644
--- a/lib/display/display.c
+++ b/lib/display/display.c
@@ -840,30 +840,31 @@ void display_tags(const struct cmd_context *cmd)
void display_name_error(name_error_t name_error)
{
- if (name_error != NAME_VALID) {
- switch(name_error) {
- case NAME_INVALID_EMPTY:
- log_error("Name is zero length");
- break;
- case NAME_INVALID_HYPEN:
- log_error("Name cannot start with hyphen");
- break;
- case NAME_INVALID_DOTS:
- log_error("Name starts with . or .. and has no "
- "following character(s)");
- break;
- case NAME_INVALID_CHARSET:
- log_error("Name contains invalid character, valid set includes: "
- "[a-zA-Z0-9.-_+]");
- break;
- case NAME_INVALID_LENGTH:
- /* Report that name length -1 to accommodate nul*/
- log_error("Name length exceeds maximum limit of %d", (NAME_LEN -1));
- break;
- default:
- log_error("Unknown error %d on name validation", name_error);
- break;
- }
+ switch(name_error) {
+ case NAME_VALID:
+ /* Valid name */
+ break;
+ case NAME_INVALID_EMPTY:
+ log_error("Name is zero length.");
+ break;
+ case NAME_INVALID_HYPEN:
+ log_error("Name cannot start with hyphen.");
+ break;
+ case NAME_INVALID_DOTS:
+ log_error("Name starts with . or .. and has no "
+ "following character(s).");
+ break;
+ case NAME_INVALID_CHARSET:
+ log_error("Name contains invalid character, valid set includes: "
+ "[a-zA-Z0-9.-_+].");
+ break;
+ case NAME_INVALID_LENGTH:
+ /* Report that name length - 1 to accommodate nul*/
+ log_error("Name length exceeds maximum limit of %d.", (NAME_LEN - 1));
+ break;
+ default:
+ log_error(INTERNAL_ERROR "Unknown error %d on name validation.", name_error);
+ break;
}
}
9 years, 11 months
master - lvscan: drop test for snapshosts
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d1aba7ccf6d1bc...
Commit: d1aba7ccf6d1bc5f3bc1fa1b5fe70eec64f8c633
Parent: 4c405a9b490423fc2dbcc475ca4649f2c4a03f5e
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Apr 28 11:58:26 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Apr 28 12:42:53 2014 +0200
lvscan: drop test for snapshosts
When showing ACTIVE status for snapshot's origin,
avoid testing all its snapshot - it's not useful
to tell user origin is inactivate, while it's clearly
available and running - just one of its snapshot leg
is invalid...
---
WHATS_NEW | 1 +
tools/lvscan.c | 13 +------------
2 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 9d792a2..fad66bf 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.107 -
==================================
+ Show correct availability status for snapshot origin in lvscan.
Move segment thin pool/volume info into segment display 'lvdisplay --maps'.
Display thin pool usage even when just thin volume is available.
Display monitoring status for monitorable segments in 'lvdisplay --maps'.
diff --git a/tools/lvscan.c b/tools/lvscan.c
index 636ac45..47e79d6 100644
--- a/tools/lvscan.c
+++ b/tools/lvscan.c
@@ -20,7 +20,6 @@ static int lvscan_single(struct cmd_context *cmd, struct logical_volume *lv,
{
struct lvinfo info;
int inkernel, snap_active = 1;
- struct lv_segment *snap_seg = NULL;
percent_t snap_percent; /* fused, fsize; */
const char *active_str, *snapshot_str;
@@ -29,17 +28,7 @@ static int lvscan_single(struct cmd_context *cmd, struct logical_volume *lv,
return ECMD_PROCESSED;
inkernel = lv_info(cmd, lv, 0, &info, 0, 0) && info.exists;
- if (lv_is_origin(lv)) {
- dm_list_iterate_items_gen(snap_seg, &lv->snapshot_segs,
- origin_list) {
- if (inkernel &&
- (snap_active = lv_snapshot_percent(snap_seg->cow,
- &snap_percent)))
- if (snap_percent == PERCENT_INVALID)
- snap_active = 0;
- }
- snap_seg = NULL;
- } else if (lv_is_cow(lv)) {
+ if (lv_is_cow(lv)) {
if (inkernel &&
(snap_active = lv_snapshot_percent(lv, &snap_percent)))
if (snap_percent == PERCENT_INVALID)
9 years, 11 months
master - thin: move segment info display to correct code section
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=4c405a9b490423...
Commit: 4c405a9b490423fc2dbcc475ca4649f2c4a03f5e
Parent: 71314a9905eb5f515aa15af5de2a1f73d82b5ae3
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Apr 28 11:56:07 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Apr 28 12:41:25 2014 +0200
thin: move segment info display to correct code section
Relocate info from thin pool and thin volume segments
to proper code section for segments.
Add discards and thin count status info.
Info is shown with 'lvdisplay --maps' (like for other segments).
---
WHATS_NEW | 1 +
lib/display/display.c | 6 ------
lib/thin/thin.c | 24 ++++++++++++++++++++++++
3 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 4d4640f..9d792a2 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.107 -
==================================
+ Move segment thin pool/volume info into segment display 'lvdisplay --maps'.
Display thin pool usage even when just thin volume is available.
Display monitoring status for monitorable segments in 'lvdisplay --maps'.
Display virtual extents for virtual LVs in 'lvdisplay --maps'.
diff --git a/lib/display/display.c b/lib/display/display.c
index 83fb901..36274b6 100644
--- a/lib/display/display.c
+++ b/lib/display/display.c
@@ -509,7 +509,6 @@ int lvdisplay_full(struct cmd_context *cmd,
if (lv_is_thin_volume(lv)) {
seg = first_seg(lv);
log_print("LV Pool name %s", seg->pool_lv->name);
- log_print("LV Thin device ID %u", seg->device_id);
if (seg->origin)
log_print("LV Thin origin name %s",
seg->origin->name);
@@ -531,13 +530,8 @@ int lvdisplay_full(struct cmd_context *cmd,
}
/* FIXME: display thin_pool targets transid for activated LV as well */
seg = first_seg(lv);
- log_print("LV Pool transaction ID %" PRIu64, seg->transaction_id);
log_print("LV Pool metadata %s", seg->metadata_lv->name);
log_print("LV Pool data %s", seg_lv(seg, 0)->name);
- log_print("LV Pool chunk size %s",
- display_size(cmd, seg->chunk_size));
- log_print("LV Zero new blocks %s",
- seg->zero_new_blocks ? "yes" : "no");
}
if (inkernel && info.suspended)
diff --git a/lib/thin/thin.c b/lib/thin/thin.c
index b717603..a1bfaaa 100644
--- a/lib/thin/thin.c
+++ b/lib/thin/thin.c
@@ -13,6 +13,7 @@
*/
#include "lib.h"
+#include "display.h"
#include "metadata.h"
#include "segtype.h"
#include "text_export.h"
@@ -40,6 +41,20 @@ static const char *_thin_pool_name(const struct lv_segment *seg)
return seg->segtype->name;
}
+static void _thin_pool_display(const struct lv_segment *seg)
+{
+ log_print(" Chunk size\t\t%s",
+ display_size(seg->lv->vg->cmd, seg->chunk_size));
+ log_print(" Discards\t\t%s", get_pool_discards_name(seg->discards));
+ log_print(" Thin count\t\t%u",
+ dm_list_size(&seg->lv->segs_using_this_lv));
+ log_print(" Transaction ID\t%" PRIu64, seg->transaction_id);
+ log_print(" Zero new blocks\t%s",
+ seg->zero_new_blocks ? "yes" : "no");
+
+ log_print(" ");
+}
+
static int _thin_pool_add_message(struct lv_segment *seg,
const char *key,
const struct dm_config_node *sn)
@@ -439,6 +454,13 @@ static const char *_thin_name(const struct lv_segment *seg)
return seg->segtype->name;
}
+static void _thin_display(const struct lv_segment *seg)
+{
+ log_print(" Device ID\t\t%u", seg->device_id);
+
+ log_print(" ");
+}
+
static int _thin_text_import(struct lv_segment *seg,
const struct dm_config_node *sn,
struct dm_hash_table *pv_hash __attribute__((unused)))
@@ -699,6 +721,7 @@ static void _thin_destroy(struct segment_type *segtype)
static struct segtype_handler _thin_pool_ops = {
.name = _thin_pool_name,
+ .display = _thin_pool_display,
.text_import = _thin_pool_text_import,
.text_import_area_count = _thin_pool_text_import_area_count,
.text_export = _thin_pool_text_export,
@@ -720,6 +743,7 @@ static struct segtype_handler _thin_pool_ops = {
static struct segtype_handler _thin_ops = {
.name = _thin_name,
+ .display = _thin_display,
.text_import = _thin_text_import,
.text_export = _thin_text_export,
#ifdef DEVMAPPER_SUPPORT
9 years, 11 months
master - thin: display info when -tpool is running
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=71314a9905eb5f...
Commit: 71314a9905eb5f515aa15af5de2a1f73d82b5ae3
Parent: 91a8e4a3d8198990ddffcfa9916ba22dcb0c033d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Apr 28 11:50:38 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Apr 28 12:40:17 2014 +0200
thin: display info when -tpool is running
For percentage display we need -tpool - so check for layered
device presence here instead of plain pool device.
Also update 'info' - so when pool is 'available' we
display open count for -tpool device instead of mostly
irrelevant pool.
TODO: Maybe we should actually display this open info always?
(even when just -tpool is available, but pool is not)
---
WHATS_NEW | 1 +
lib/display/display.c | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index de9ef23..4d4640f 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.107 -
==================================
+ Display thin pool usage even when just thin volume is available.
Display monitoring status for monitorable segments in 'lvdisplay --maps'.
Display virtual extents for virtual LVs in 'lvdisplay --maps'.
Make vgsplit fail cleanly when not all PVs are specified for RAID 4/5/6.
diff --git a/lib/display/display.c b/lib/display/display.c
index d824150..83fb901 100644
--- a/lib/display/display.c
+++ b/lib/display/display.c
@@ -525,7 +525,7 @@ int lvdisplay_full(struct cmd_context *cmd,
log_print("LV merged with %s",
find_snapshot(lv)->lv->name);
} else if (lv_is_thin_pool(lv)) {
- if (inkernel) {
+ if (lv_info(cmd, lv, 1, &info, 1, 1) && info.exists) {
thin_data_active = lv_thin_pool_percent(lv, 0, &thin_data_percent);
thin_metadata_active = lv_thin_pool_percent(lv, 1, &thin_metadata_percent);
}
9 years, 11 months