Add configure --enable-units-compat to set si_unit_consistency off by default.
Use standard output units for 'PE Size' and 'Stripe size' in pv/lvdisplay.
Version 2.02.54 -
=====================================
+ Use standard output units for 'PE Size' and 'Stripe size' in pv/lvdisplay.
+ Add configure --enable-units-compat to set si_unit_consistency off by default.
+ Add global/si_unit_consistency to enable cleaned-up use of units in output.
Version 2.02.53 - 25th September 2009
=====================================
enable_udev_sync
enable_udev_rules
enable_compat
+enable_units_compat
enable_ioctl
enable_o_direct
enable_applib
--enable-udev_sync Enable synchronisation with udev processing
--enable-udev_rules Install rule files needed for udev synchronisation
--enable-compat Enable support for old device-mapper versions
+ --enable-units-compat Enable output compatibility with old versions that
+ that don't use KiB-style unit suffixes
--disable-driver Disable calls to device-mapper in the kernel
--disable-o_direct Disable O_DIRECT
--enable-applib Build application library
fi
+################################################################################
+# Check whether --enable-units-compat was given.
+if test "${enable_units_compat+set}" = set; then
+ enableval=$enable_units_compat; UNITS_COMPAT=$enableval
+else
+ UNITS_COMPAT=no
+fi
+
+
+if test x$UNITS_COMPAT = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define DEFAULT_SI_UNIT_CONSISTENCY 0
+_ACEOF
+
+fi
+
################################################################################
# Check whether --enable-ioctl was given.
if test "${enable_ioctl+set}" = set; then
AC_ARG_ENABLE(compat, [ --enable-compat Enable support for old device-mapper versions],
DM_COMPAT=$enableval, DM_COMPAT=no)
+################################################################################
+dnl -- Compatible units suffix mode
+AC_ARG_ENABLE(units-compat,
+ [ --enable-units-compat Enable output compatibility with old versions that
+ that don't use KiB-style unit suffixes],
+ UNITS_COMPAT=$enableval, UNITS_COMPAT=no)
+
+if test x$UNITS_COMPAT = xyes; then
+ AC_DEFINE([DEFAULT_SI_UNIT_CONSISTENCY], 0, [Define to 0 to reinstate the pre-2.02.54 handling of unit suffixes.])
+fi
+
################################################################################
dnl -- Disable ioctl
AC_ARG_ENABLE(ioctl, [ --disable-driver Disable calls to device-mapper in the kernel],
# Default value for --units argument
units = "h"
+ # Since version 2.02.54, the tools distinguish between powers of
+ # 1024 bytes (e.g. KiB, MiB, GiB) and powers of 1000 bytes (e.g.
+ # KB, MB, GB).
+ # If you have scripts that depend on the old behaviour, set this to 0
+ # temporarily until you update them.
+ si_unit_consistency = 1
+
# Whether or not to communicate with the kernel device-mapper.
# Set to 0 if you want to use the tools to manipulate LVM metadata
# without activating any logical volumes.
}
}
+ cmd->si_unit_consistency = find_config_tree_int(cmd,
+ "global/si_unit_consistency",
+ DEFAULT_SI_UNIT_CONSISTENCY);
+
return 1;
}
unsigned is_long_lived:1; /* Optimises persistent_filter handling */
unsigned handles_missing_pvs:1;
unsigned partial_activation:1;
+ unsigned si_unit_consistency:1;
struct dev_filter *filter;
int dump_filter; /* Dump filter when exiting? */
#define DEFAULT_SUFFIX 1
#define DEFAULT_HOSTTAGS 0
+#ifndef DEFAULT_SI_UNIT_CONSISTENCY
+# define DEFAULT_SI_UNIT_CONSISTENCY 1
+#endif
+
#ifdef DEVMAPPER_SUPPORT
# define DEFAULT_ACTIVATION 1
# define DEFAULT_RESERVED_MEMORY 8192
/* LV count is no longer available when displaying PV
log_print("Cur LV %u", vg->lv_count);
*/
- log_print("PE Size (KByte) %" PRIu32, pv->pe_size / 2);
+
+ if (cmd->si_unit_consistency)
+ log_print("PE Size %s", display_size(cmd, (uint64_t) pv->pe_size));
+ else
+ log_print("PE Size (KByte) %" PRIu32, pv->pe_size / 2);
+
log_print("Total PE %u", pv->pe_count);
log_print("Free PE %" PRIu32, pe_free);
log_print("Allocated PE %u", pv->pe_alloc_count);
log_print("Segments %u", dm_list_size(&lv->segments));
/********* FIXME Stripes & stripesize for each segment
- log_print("Stripe size (KByte) %u", lv->stripesize / 2);
+ log_print("Stripe size %s", display_size(cmd, (uint64_t) lv->stripesize));
***********/
log_print("Allocation %s", get_alloc_string(lv->alloc));
/* Define to 1 if using `alloca.c'. */
#undef C_ALLOCA
+/* Define to 0 to reinstate the pre-2.02.54 handling of unit suffixes. */
+#undef DEFAULT_SI_UNIT_CONSISTENCY
+
/* Define to 1 to enable LVM2 device-mapper interaction. */
#undef DEVMAPPER_SUPPORT
display_stripe(seg, 0, " ");
else {
log_print(" Stripes\t\t%u", seg->area_count);
- log_print(" Stripe size\t\t%u KB", seg->stripe_size / 2);
+
+ if (seg->lv->vg->cmd->si_unit_consistency)
+ log_print(" Stripe size\t\t%s",
+ display_size(seg->lv->vg->cmd,
+ (uint64_t) seg->stripe_size));
+ else
+ log_print(" Stripe size\t\t%u KB",
+ seg->stripe_size / 2);
for (s = 0; s < seg->area_count; s++) {
log_print(" Stripe %d:", s);