Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package libblockdev for openSUSE:Factory 
checked in at 2021-11-20 22:47:50
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libblockdev (Old)
 and      /work/SRC/openSUSE:Factory/.libblockdev.new.1895 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libblockdev"

Sat Nov 20 22:47:50 2021 rev:14 rq:932237 version:2.26

Changes:
--------
--- /work/SRC/openSUSE:Factory/libblockdev/libblockdev.changes  2021-04-12 
12:39:00.537483967 +0200
+++ /work/SRC/openSUSE:Factory/.libblockdev.new.1895/libblockdev.changes        
2021-11-20 22:48:04.747852513 +0100
@@ -1,0 +2,12 @@
+Sun Nov 14 16:20:46 UTC 2021 - Luciano Santos <luc1...@linuxmail.org>
+
+- Update to version 2.26:
+  + Fixes:
+    - Deprecated glib function call;
+    - Build with LLVM/clang;
+    - Many memory leaks;
+    - Many tests.
+- Fix dbus.h being wrongly packaged in libbd_lvm-dbus-devl instead
+  of libbd_utils-devel (boo#1189787).
+
+-------------------------------------------------------------------

Old:
----
  libblockdev-2.25.tar.gz

New:
----
  libblockdev-2.26.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libblockdev.spec ++++++
--- /var/tmp/diff_new_pack.hgcm9N/_old  2021-11-20 22:48:05.519849954 +0100
+++ /var/tmp/diff_new_pack.hgcm9N/_new  2021-11-20 22:48:05.523849941 +0100
@@ -22,7 +22,7 @@
 %bcond_with     python2
 
 Name:           libblockdev
-Version:        2.25
+Version:        2.26
 Release:        0
 Summary:        A library for low-level manipulation with block devices
 License:        LGPL-2.1-only
@@ -629,8 +629,6 @@
 
 %files -n libbd_lvm-dbus-devel
 %{_libdir}/libbd_lvm-dbus.so
-%dir %{_includedir}/blockdev
-%{_includedir}/blockdev/dbus.h
 
 %files -n libbd_mdraid%{somajor}
 %{_libdir}/libbd_mdraid.so.%{somajor}*
@@ -673,12 +671,13 @@
 %{_libdir}/libbd_part_err.so
 %{_libdir}/pkgconfig/blockdev-utils.pc
 %dir %{_includedir}/blockdev
-%{_includedir}/blockdev/utils.h
-%{_includedir}/blockdev/sizes.h
+%{_includedir}/blockdev/dbus.h
+%{_includedir}/blockdev/dev_utils.h
 %{_includedir}/blockdev/exec.h
 %{_includedir}/blockdev/extra_arg.h
-%{_includedir}/blockdev/dev_utils.h
 %{_includedir}/blockdev/module.h
+%{_includedir}/blockdev/sizes.h
+%{_includedir}/blockdev/utils.h
 
 %files -n libbd_vdo%{somajor}
 %{_libdir}/libbd_vdo.so.%{somajor}*

++++++ libblockdev-2.25.tar.gz -> libblockdev-2.26.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libblockdev-2.25/aclocal.m4 
new/libblockdev-2.26/aclocal.m4
--- old/libblockdev-2.25/aclocal.m4     2021-01-11 11:59:55.000000000 +0100
+++ new/libblockdev-2.26/aclocal.m4     2021-07-28 08:45:14.000000000 +0200
@@ -940,12 +940,14 @@
     m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])])
   else
 
-  dnl Query Python for its version number.  Getting [:3] seems to be
-  dnl the best way to do this; it's what "site.py" does in the standard
-  dnl library.
+  dnl Query Python for its version number.  Although site.py simply uses
+  dnl sys.version[:3], printing that failed with Python 3.10, since the
+  dnl trailing zero was eliminated. So now we output just the major
+  dnl and minor version numbers, as numbers. Apparently the tertiary
+  dnl version is not of interest.
 
   AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version],
-    [am_cv_python_version=`$PYTHON -c "import sys; 
sys.stdout.write(sys.version[[:3]])"`])
+    [am_cv_python_version=`$PYTHON -c "import sys; print('%u.%u' % 
sys.version_info[[:2]])"`])
   AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
 
   dnl Use the values of $prefix and $exec_prefix for the corresponding
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libblockdev-2.25/configure 
new/libblockdev-2.26/configure
--- old/libblockdev-2.25/configure      2021-01-11 11:59:56.000000000 +0100
+++ new/libblockdev-2.26/configure      2021-07-28 08:45:16.000000000 +0200
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for libblockdev 2.25.
+# Generated by GNU Autoconf 2.69 for libblockdev 2.26.
 #
 # Report bugs to <vpodz...@redhat.com>.
 #
@@ -590,8 +590,8 @@
 # Identity of this package.
 PACKAGE_NAME='libblockdev'
 PACKAGE_TARNAME='libblockdev'
-PACKAGE_VERSION='2.25'
-PACKAGE_STRING='libblockdev 2.25'
+PACKAGE_VERSION='2.26'
+PACKAGE_STRING='libblockdev 2.26'
 PACKAGE_BUGREPORT='vpodz...@redhat.com'
 PACKAGE_URL=''
 
@@ -1505,7 +1505,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures libblockdev 2.25 to adapt to many kinds of systems.
+\`configure' configures libblockdev 2.26 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1575,7 +1575,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of libblockdev 2.25:";;
+     short | recursive ) echo "Configuration of libblockdev 2.26:";;
    esac
   cat <<\_ACEOF
 
@@ -1764,7 +1764,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-libblockdev configure 2.25
+libblockdev configure 2.26
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2133,7 +2133,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by libblockdev $as_me 2.25, which was
+It was created by libblockdev $as_me 2.26, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -3031,7 +3031,7 @@
 
 # Define the identity of the package.
  PACKAGE='libblockdev'
- VERSION='2.25'
+ VERSION='2.26'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -3194,7 +3194,7 @@
 if ${am_cv_python_version+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  am_cv_python_version=`$PYTHON -c "import sys; 
sys.stdout.write(sys.version[:3])"`
+  am_cv_python_version=`$PYTHON -c "import sys; print('%u.%u' % 
sys.version_info[:2])"`
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5
 $as_echo "$am_cv_python_version" >&6; }
@@ -15024,6 +15024,10 @@
   $as_echo "#define LIBCRYPTSETUP_BITLK 1" >>confdefs.h
 
 fi
+      if $PKG_CONFIG --atleast-version=2.4.0 libcryptsetup; then :
+  $as_echo "#define LIBCRYPTSETUP_24 1" >>confdefs.h
+
+fi
       if test "x$with_escrow" != "xno"; then :
 
 pkg_failed=no
@@ -16654,7 +16658,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by libblockdev $as_me 2.25, which was
+This file was extended by libblockdev $as_me 2.26, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -16711,7 +16715,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-libblockdev config.status 2.25
+libblockdev config.status 2.26
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libblockdev-2.25/configure.ac 
new/libblockdev-2.26/configure.ac
--- old/libblockdev-2.25/configure.ac   2021-01-11 11:59:41.000000000 +0100
+++ new/libblockdev-2.26/configure.ac   2021-07-28 08:44:11.000000000 +0200
@@ -1,6 +1,6 @@
 # configure.ac for libblockdev
 
-AC_INIT([libblockdev], [2.25], [vpodz...@redhat.com])
+AC_INIT([libblockdev], [2.26], [vpodz...@redhat.com])
 
 # Disable building static libraries.
 # This needs to be set before initializing automake
@@ -211,6 +211,8 @@
             [AC_DEFINE([LIBCRYPTSETUP_2])], [])
       AS_IF([$PKG_CONFIG --atleast-version=2.3.0 libcryptsetup],
             [AC_DEFINE([LIBCRYPTSETUP_BITLK])], [])
+      AS_IF([$PKG_CONFIG --atleast-version=2.4.0 libcryptsetup],
+            [AC_DEFINE([LIBCRYPTSETUP_24])], [])
       AS_IF([test "x$with_escrow" != "xno"],
             [LIBBLOCKDEV_PKG_CHECK_MODULES([NSS], [nss >= 3.18.0])
              LIBBLOCKDEV_CHECK_HEADER([volume_key/libvolume_key.h], 
[$GLIB_CFLAGS $NSS_CFLAGS], [libvolume_key.h not available])],
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libblockdev-2.25/data/conf.d/00-default.cfg 
new/libblockdev-2.26/data/conf.d/00-default.cfg
--- old/libblockdev-2.25/data/conf.d/00-default.cfg     2020-05-22 
14:34:58.000000000 +0200
+++ new/libblockdev-2.26/data/conf.d/00-default.cfg     2021-07-28 
08:43:28.000000000 +0200
@@ -21,6 +21,9 @@
 [dm]
 sonames=libbd_dm.so.2
 
+[fs]
+sonames=libbd_fs.so.2
+
 [kbd]
 sonames=libbd_kbd.so.2
 
@@ -36,6 +39,9 @@
 [mpath]
 sonames=libbd_mpath.so.2
 
+[nvdimm]
+sonames=libbd_nvdimm.so.2
+
 [swap]
 sonames=libbd_swap.so.2
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libblockdev-2.25/dist/libblockdev.spec 
new/libblockdev-2.26/dist/libblockdev.spec
--- old/libblockdev-2.25/dist/libblockdev.spec  2021-01-11 11:59:58.000000000 
+0100
+++ new/libblockdev-2.26/dist/libblockdev.spec  2021-07-28 08:45:20.000000000 
+0200
@@ -124,7 +124,7 @@
 %define configure_opts %{?python2_copts} %{?python3_copts} %{?bcache_copts} 
%{?lvm_dbus_copts} %{?btrfs_copts} %{?crypto_copts} %{?dm_copts} %{?loop_copts} 
%{?lvm_copts} %{?lvm_dbus_copts} %{?mdraid_copts} %{?mpath_copts} 
%{?swap_copts} %{?kbd_copts} %{?part_copts} %{?fs_copts} %{?nvdimm_copts} 
%{?vdo_copts} %{?tools_copts} %{?gi_copts}
 
 Name:        libblockdev
-Version:     2.25
+Version:     2.26
 Release:     1%{?dist}
 Summary:     A library for low-level manipulation with block devices
 License:     LGPLv2+
@@ -979,6 +979,32 @@
 %files plugins-all
 
 %changelog
+* Wed Jul 28 2021 Vojtech Trefny <vtre...@redhat.com> - 2.26-1
+- Add missing plugins to the default config (vtrefny)
+- remove unused variable and fix build with LLVM/clang (tpgxyz)
+- exec: Fix deprecated glib function call Glib will rename 
"g_spawn_check_exit_status()" to "g_spawn_check_wait_status()" in version 2.69. 
(manuel.wassermann97)
+- tests: Tag LvmPVVGLVcachePoolCreateRemoveTestCase as unstable (vtrefny)
+- tests: Force remove LVM VG /dev/ entry not removed by vgremove (vtrefny)
+- tests: Do not try to remove VG before removing the VDO pool (vtrefny)
+- crypto: Let cryptsetup autodect encryption sector size when not specified 
(vtrefny)
+- Fix skipping tests on Debian testing (vtrefny)
+- tests: Temporarily skip test_snapshotcreate_lvorigin_snapshotmerge (vtrefny)
+- tests: Do not check that XFS shrink fails with xfsprogs >= 5.12 (vtrefny)
+- tests: Make sure the test temp mount is always unmounted (vtrefny)
+- swap: Fix memory leak (vtrefny)
+- mdraid: Fix memory leak (vtrefny)
+- lvm-dbus: Fix memory leak (vtrefny)
+- kbd: Fix memory leak (vtrefny)
+- fs: Fix memory leak (vtrefny)
+- dm: Fix memory leak in the DM plugin and DM logging redirect function 
(vtrefny)
+- crypto: Fix memory leak (vtrefny)
+- kbd: Fix memory leak (vtrefny)
+- tests: Call fs_vfat_mkfs with "--mbr=n" extra option in tests (vtrefny)
+- fs: Allow using empty label for vfat with newest dosfstools (vtrefny)
+- vdo: Do not use g_memdup in bd_vdo_stats_copy (vtrefny)
+- crypto: Fix default key size for non XTS ciphers (vtrefny)
+- NEWS.rts: Fix markup (vtrefny)
+
 * Mon Jan 11 2021 Vojtech Trefny <vtre...@redhat.com> - 2.25-1
 - loop: Retry LOOP_SET_STATUS64 on EAGAIN (vtrefny)
 - Fix max size limit for LVM thinpool metadata (vtrefny)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libblockdev-2.25/dist/libblockdev.spec.in 
new/libblockdev-2.26/dist/libblockdev.spec.in
--- old/libblockdev-2.25/dist/libblockdev.spec.in       2021-01-11 
11:59:41.000000000 +0100
+++ new/libblockdev-2.26/dist/libblockdev.spec.in       2021-07-28 
08:44:11.000000000 +0200
@@ -124,7 +124,7 @@
 %define configure_opts %{?python2_copts} %{?python3_copts} %{?bcache_copts} 
%{?lvm_dbus_copts} %{?btrfs_copts} %{?crypto_copts} %{?dm_copts} %{?loop_copts} 
%{?lvm_copts} %{?lvm_dbus_copts} %{?mdraid_copts} %{?mpath_copts} 
%{?swap_copts} %{?kbd_copts} %{?part_copts} %{?fs_copts} %{?nvdimm_copts} 
%{?vdo_copts} %{?tools_copts} %{?gi_copts}
 
 Name:        libblockdev
-Version:     2.25
+Version:     2.26
 Release:     1%{?dist}
 Summary:     A library for low-level manipulation with block devices
 License:     LGPLv2+
@@ -979,6 +979,32 @@
 %files plugins-all
 
 %changelog
+* Wed Jul 28 2021 Vojtech Trefny <vtre...@redhat.com> - 2.26-1
+- Add missing plugins to the default config (vtrefny)
+- remove unused variable and fix build with LLVM/clang (tpgxyz)
+- exec: Fix deprecated glib function call Glib will rename 
"g_spawn_check_exit_status()" to "g_spawn_check_wait_status()" in version 2.69. 
(manuel.wassermann97)
+- tests: Tag LvmPVVGLVcachePoolCreateRemoveTestCase as unstable (vtrefny)
+- tests: Force remove LVM VG /dev/ entry not removed by vgremove (vtrefny)
+- tests: Do not try to remove VG before removing the VDO pool (vtrefny)
+- crypto: Let cryptsetup autodect encryption sector size when not specified 
(vtrefny)
+- Fix skipping tests on Debian testing (vtrefny)
+- tests: Temporarily skip test_snapshotcreate_lvorigin_snapshotmerge (vtrefny)
+- tests: Do not check that XFS shrink fails with xfsprogs >= 5.12 (vtrefny)
+- tests: Make sure the test temp mount is always unmounted (vtrefny)
+- swap: Fix memory leak (vtrefny)
+- mdraid: Fix memory leak (vtrefny)
+- lvm-dbus: Fix memory leak (vtrefny)
+- kbd: Fix memory leak (vtrefny)
+- fs: Fix memory leak (vtrefny)
+- dm: Fix memory leak in the DM plugin and DM logging redirect function 
(vtrefny)
+- crypto: Fix memory leak (vtrefny)
+- kbd: Fix memory leak (vtrefny)
+- tests: Call fs_vfat_mkfs with "--mbr=n" extra option in tests (vtrefny)
+- fs: Allow using empty label for vfat with newest dosfstools (vtrefny)
+- vdo: Do not use g_memdup in bd_vdo_stats_copy (vtrefny)
+- crypto: Fix default key size for non XTS ciphers (vtrefny)
+- NEWS.rts: Fix markup (vtrefny)
+
 * Mon Jan 11 2021 Vojtech Trefny <vtre...@redhat.com> - 2.25-1
 - loop: Retry LOOP_SET_STATUS64 on EAGAIN (vtrefny)
 - Fix max size limit for LVM thinpool metadata (vtrefny)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libblockdev-2.25/docs/libblockdev-docs.xml 
new/libblockdev-2.26/docs/libblockdev-docs.xml
--- old/libblockdev-2.25/docs/libblockdev-docs.xml      2021-01-11 
11:59:58.000000000 +0100
+++ new/libblockdev-2.26/docs/libblockdev-docs.xml      2021-07-28 
08:45:20.000000000 +0200
@@ -8,7 +8,7 @@
   <bookinfo>
     <title>libblockdev Reference Manual</title>
     <releaseinfo>
-      for libblockdev 2.25.
+      for libblockdev 2.26.
       The latest version of this documentation can be found on-line at
       <ulink role="online-location"
              
url="http://storaged.org/libblockdev/";>http://storaged.org/libblockdev/</ulink>.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libblockdev-2.25/src/lib/plugin_apis/vdo.api 
new/libblockdev-2.26/src/lib/plugin_apis/vdo.api
--- old/libblockdev-2.25/src/lib/plugin_apis/vdo.api    2021-01-11 
11:48:35.000000000 +0100
+++ new/libblockdev-2.26/src/lib/plugin_apis/vdo.api    2021-07-28 
08:43:23.000000000 +0200
@@ -170,7 +170,22 @@
  * Deprecated: 2.24: Use LVM-VDO integration instead.
  */
 BDVDOStats* bd_vdo_stats_copy (BDVDOStats *stats) {
-    return g_memdup (stats, sizeof (BDVDOStats));
+    if (stats == NULL)
+        return NULL;
+
+    BDVDOStats *new_stats = g_new0 (BDVDOStats, 1);
+
+    new_stats->block_size = stats->block_size;
+    new_stats->logical_block_size = stats->logical_block_size;
+    new_stats->physical_blocks = stats->physical_blocks;
+    new_stats->data_blocks_used = stats->data_blocks_used;
+    new_stats->overhead_blocks_used = stats->overhead_blocks_used;
+    new_stats->logical_blocks_used = stats->logical_blocks_used;
+    new_stats->used_percent = stats->used_percent;
+    new_stats->saving_percent = stats->saving_percent;
+    new_stats->write_amplification_ratio = stats->write_amplification_ratio;
+
+    return new_stats;
 }
 
 GType bd_vdo_stats_get_type () {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libblockdev-2.25/src/lib/plugin_apis/vdo.c 
new/libblockdev-2.26/src/lib/plugin_apis/vdo.c
--- old/libblockdev-2.25/src/lib/plugin_apis/vdo.c      2021-01-11 
12:30:06.000000000 +0100
+++ new/libblockdev-2.26/src/lib/plugin_apis/vdo.c      2021-07-28 
08:46:44.000000000 +0200
@@ -106,7 +106,22 @@
  * Deprecated: 2.24: Use LVM-VDO integration instead.
  */
 BDVDOStats* bd_vdo_stats_copy (BDVDOStats *stats) {
-        return g_memdup (stats, sizeof (BDVDOStats));
+        if (stats == NULL)
+        return NULL;
+
+    BDVDOStats *new_stats = g_new0 (BDVDOStats, 1);
+
+    new_stats->block_size = stats->block_size;
+    new_stats->logical_block_size = stats->logical_block_size;
+    new_stats->physical_blocks = stats->physical_blocks;
+    new_stats->data_blocks_used = stats->data_blocks_used;
+    new_stats->overhead_blocks_used = stats->overhead_blocks_used;
+    new_stats->logical_blocks_used = stats->logical_blocks_used;
+    new_stats->used_percent = stats->used_percent;
+    new_stats->saving_percent = stats->saving_percent;
+    new_stats->write_amplification_ratio = stats->write_amplification_ratio;
+
+    return new_stats;
 }
 
 GType  bd_vdo_stats_get_type () {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libblockdev-2.25/src/plugins/crypto.c 
new/libblockdev-2.26/src/plugins/crypto.c
--- old/libblockdev-2.25/src/plugins/crypto.c   2021-01-11 11:48:35.000000000 
+0100
+++ new/libblockdev-2.26/src/plugins/crypto.c   2021-07-28 08:43:23.000000000 
+0200
@@ -774,8 +774,15 @@
         return FALSE;
     }
 
-    /* resolve requested/default key_size (should be in bytes) */
-    key_size = (key_size != 0) ? (key_size / 8) : (DEFAULT_LUKS_KEYSIZE_BITS / 
8);
+    if (key_size == 0) {
+        if (g_str_has_prefix (cipher_specs[1], "xts-"))
+            key_size = DEFAULT_LUKS_KEYSIZE_BITS * 2;
+        else
+            key_size = DEFAULT_LUKS_KEYSIZE_BITS;
+    }
+
+    /* key_size should be in bytes */
+    key_size = key_size / 8;
 
     /* wait for enough random data entropy (if requested) */
     if (min_entropy > 0) {
@@ -1268,6 +1275,7 @@
         success = g_file_get_contents (nkey_file, &nkey_buf, &nbuf_len, error);
         if (!success) {
             g_prefix_error (error, "Failed to load key from file '%s': ", 
nkey_file);
+            g_free (key_buf);
             return FALSE;
         }
     } else
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libblockdev-2.25/src/plugins/crypto.h 
new/libblockdev-2.26/src/plugins/crypto.h
--- old/libblockdev-2.25/src/plugins/crypto.h   2021-01-11 11:48:35.000000000 
+0100
+++ new/libblockdev-2.26/src/plugins/crypto.h   2021-07-28 08:43:28.000000000 
+0200
@@ -36,9 +36,15 @@
 /* 20 chars * 6 bits per char (64-item charset) = 120 "bits of security" */
 #define BD_CRYPTO_BACKUP_PASSPHRASE_LENGTH 20
 
-#define DEFAULT_LUKS_KEYSIZE_BITS 512
+#define DEFAULT_LUKS_KEYSIZE_BITS 256
 #define DEFAULT_LUKS_CIPHER "aes-xts-plain64"
+
+#ifdef LIBCRYPTSETUP_24
+/* 0 for autodetect since 2.4.0 */
+#define DEFAULT_LUKS2_SECTOR_SIZE 0
+#else
 #define DEFAULT_LUKS2_SECTOR_SIZE 512
+#endif
 
 typedef enum {
     BD_CRYPTO_TECH_LUKS = 0,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libblockdev-2.25/src/plugins/dm.c 
new/libblockdev-2.26/src/plugins/dm.c
--- old/libblockdev-2.25/src/plugins/dm.c       2021-01-11 11:48:35.000000000 
+0100
+++ new/libblockdev-2.26/src/plugins/dm.c       2021-07-28 08:43:23.000000000 
+0200
@@ -245,7 +245,8 @@
     g_free (sys_path);
 
     if (!success) {
-        /* errror is already populated */
+        /* error is already populated */
+        g_free (ret);
         return NULL;
     }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libblockdev-2.25/src/plugins/fs/mount.c 
new/libblockdev-2.26/src/plugins/fs/mount.c
--- old/libblockdev-2.25/src/plugins/fs/mount.c 2021-01-11 11:48:35.000000000 
+0100
+++ new/libblockdev-2.26/src/plugins/fs/mount.c 2021-07-28 08:43:23.000000000 
+0200
@@ -541,6 +541,7 @@
                                        "Unknoen error while reading error.");
                       g_io_channel_unref (channel);
                       close (pipefd[0]);
+                      g_free (error_msg);
                       return FALSE;
                   }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libblockdev-2.25/src/plugins/fs/vfat.c 
new/libblockdev-2.26/src/plugins/fs/vfat.c
--- old/libblockdev-2.25/src/plugins/fs/vfat.c  2021-01-11 11:48:35.000000000 
+0100
+++ new/libblockdev-2.26/src/plugins/fs/vfat.c  2021-07-28 08:43:23.000000000 
+0200
@@ -232,10 +232,24 @@
  */
 gboolean bd_fs_vfat_set_label (const gchar *device, const gchar *label, GError 
**error) {
     const gchar *args[4] = {"fatlabel", device, label, NULL};
+    UtilDep dep = {"fatlabel", "4.2", "--version", 
"fatlabel\\s+([\\d\\.]+).+"};
+    gboolean new_vfat = FALSE;
+    GError *loc_error = NULL;
 
     if (!check_deps (&avail_deps, DEPS_FATLABEL_MASK, deps, DEPS_LAST, 
&deps_check_lock, error))
         return FALSE;
 
+    if (!label || g_strcmp0 (label, "") == 0) {
+        /* fatlabel >= 4.2 refuses to set empty label */
+        new_vfat = bd_utils_check_util_version (dep.name, dep.version,
+                                                dep.ver_arg, dep.ver_regexp,
+                                                &loc_error);
+        if (new_vfat)
+            args[2] = "--reset";
+        else
+            g_clear_error (&loc_error);
+    }
+
     return bd_utils_exec_and_report_error (args, NULL, error);
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libblockdev-2.25/src/plugins/kbd.c 
new/libblockdev-2.26/src/plugins/kbd.c
--- old/libblockdev-2.25/src/plugins/kbd.c      2021-01-11 11:48:35.000000000 
+0100
+++ new/libblockdev-2.26/src/plugins/kbd.c      2021-07-28 08:43:23.000000000 
+0200
@@ -1035,6 +1035,7 @@
 
     if (c_set_uuid) {
         path = g_strdup_printf ("/sys/fs/bcache/%s/stop", c_set_uuid);
+        g_free (c_set_uuid);
         success = bd_utils_echo_str_to_file ("1", path, error);
         g_free (path);
         if (!success) {
@@ -1254,6 +1255,7 @@
     g_io_channel_unref (file);
 
     if (!found) {
+        g_free (line);
         g_set_error (error, BD_KBD_ERROR, BD_KBD_ERROR_BCACHE_INVAL,
                      "Failed to get cache usage data");
         return FALSE;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libblockdev-2.25/src/plugins/lvm-dbus.c 
new/libblockdev-2.26/src/plugins/lvm-dbus.c
--- old/libblockdev-2.25/src/plugins/lvm-dbus.c 2021-01-11 11:48:39.000000000 
+0100
+++ new/libblockdev-2.26/src/plugins/lvm-dbus.c 2021-07-28 08:43:28.000000000 
+0200
@@ -241,7 +241,6 @@
     return TRUE;
 }
 
-static volatile guint avail_deps = 0;
 static volatile guint avail_dbus_deps = 0;
 static volatile guint avail_features = 0;
 static volatile guint avail_module_deps = 0;
@@ -2927,6 +2926,7 @@
     lv_id = g_strdup_printf ("%s/%s", vg_name, cached_lv);
     call_lvm_obj_method_sync (lv_id, CACHED_LV_INTF, "DetachCachePool", 
params, NULL, extra, TRUE, error);
     g_free (lv_id);
+    g_free (cache_pool_name);
     return ((*error) == NULL);
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libblockdev-2.25/src/plugins/mdraid.c 
new/libblockdev-2.26/src/plugins/mdraid.c
--- old/libblockdev-2.25/src/plugins/mdraid.c   2021-01-11 11:48:35.000000000 
+0100
+++ new/libblockdev-2.26/src/plugins/mdraid.c   2021-07-28 08:43:23.000000000 
+0200
@@ -1332,6 +1332,7 @@
             continue;
         }
         node_name = g_path_get_basename (dev_path);
+        g_free (dev_path);
         if (g_strcmp0 (node_name, node) == 0) {
             found = TRUE;
             name = g_path_get_basename (*path_p);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libblockdev-2.25/src/plugins/swap.c 
new/libblockdev-2.26/src/plugins/swap.c
--- old/libblockdev-2.25/src/plugins/swap.c     2021-01-11 11:48:35.000000000 
+0100
+++ new/libblockdev-2.26/src/plugins/swap.c     2021-07-28 08:43:23.000000000 
+0200
@@ -417,6 +417,7 @@
         if (!real_device) {
             /* the device doesn't exist and thus is not an active swap */
             g_clear_error (error);
+            g_free (file_content);
             return FALSE;
         }
     }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libblockdev-2.25/src/plugins/vdo.c 
new/libblockdev-2.26/src/plugins/vdo.c
--- old/libblockdev-2.25/src/plugins/vdo.c      2021-01-11 11:48:35.000000000 
+0100
+++ new/libblockdev-2.26/src/plugins/vdo.c      2021-07-28 08:43:23.000000000 
+0200
@@ -81,7 +81,22 @@
 }
 
 BDVDOStats* bd_vdo_stats_copy (BDVDOStats *stats) {
-    return g_memdup (stats, sizeof (BDVDOStats));
+    if (stats == NULL)
+        return NULL;
+
+    BDVDOStats *new_stats = g_new0 (BDVDOStats, 1);
+
+    new_stats->block_size = stats->block_size;
+    new_stats->logical_block_size = stats->logical_block_size;
+    new_stats->physical_blocks = stats->physical_blocks;
+    new_stats->data_blocks_used = stats->data_blocks_used;
+    new_stats->overhead_blocks_used = stats->overhead_blocks_used;
+    new_stats->logical_blocks_used = stats->logical_blocks_used;
+    new_stats->used_percent = stats->used_percent;
+    new_stats->saving_percent = stats->saving_percent;
+    new_stats->write_amplification_ratio = stats->write_amplification_ratio;
+
+    return new_stats;
 }
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libblockdev-2.25/src/utils/exec.c 
new/libblockdev-2.26/src/utils/exec.c
--- old/libblockdev-2.25/src/utils/exec.c       2021-01-11 11:48:35.000000000 
+0100
+++ new/libblockdev-2.26/src/utils/exec.c       2021-07-28 08:43:28.000000000 
+0200
@@ -236,7 +236,12 @@
     /* g_spawn_sync set the status in the same way waitpid() does, we need
        to get the process exit code manually (this is similar to calling
        WEXITSTATUS but also sets the error for terminated processes */
-    if (!g_spawn_check_exit_status (exit_status, error)) {
+
+    #if !GLIB_CHECK_VERSION(2, 69, 0)
+    #define g_spawn_check_wait_status(x,y) (g_spawn_check_exit_status (x,y))
+    #endif
+
+    if (!g_spawn_check_wait_status (exit_status, error)) {
         if (g_error_matches (*error, G_SPAWN_ERROR, G_SPAWN_ERROR_FAILED)) {
             /* process was terminated abnormally (e.g. using a signal) */
             g_free (stdout_data);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libblockdev-2.25/tests/crypto_test.py 
new/libblockdev-2.26/tests/crypto_test.py
--- old/libblockdev-2.25/tests/crypto_test.py   2021-01-08 21:51:28.000000000 
+0100
+++ new/libblockdev-2.26/tests/crypto_test.py   2021-07-28 08:43:28.000000000 
+0200
@@ -16,26 +16,18 @@
 PASSWD2 = "myshinylittlepassword2"
 PASSWD3 = "myshinylittlepassword3"
 
-def have_luks2():
-    try:
-        succ = BlockDev.utils_check_util_version("cryptsetup", "2.0.3", 
"--version", r"cryptsetup ([0-9+\.]+)")
-    except GLib.GError:
-        return False
-    else:
-        return succ
 
-
-def have_bitlk():
+def check_cryptsetup_version(version):
     try:
-        succ = BlockDev.utils_check_util_version("cryptsetup", "2.3.0", 
"--version", r"cryptsetup ([0-9+\.]+)")
+        succ = BlockDev.utils_check_util_version("cryptsetup", version, 
"--version", r"cryptsetup ([0-9+\.]+)")
     except GLib.GError:
         return False
     else:
         return succ
 
 
-HAVE_LUKS2 = have_luks2()
-HAVE_BITLK = have_bitlk()
+HAVE_LUKS2 = check_cryptsetup_version("2.0.3")
+HAVE_BITLK = check_cryptsetup_version("2.3.0")
 
 
 class CryptoTestCase(unittest.TestCase):
@@ -236,6 +228,42 @@
             self.fail("Failed to get pbkdf information from:\n%s %s" % (out, 
err))
         self.assertEqual(int(m.group(1)), 5)
 
+    def _get_luks1_key_size(self, device):
+        _ret, out, err = run_command("cryptsetup luksDump %s" % device)
+        m = re.search(r"MK bits:\s*(\S+)\s*", out)
+        if not m or len(m.groups()) != 1:
+            self.fail("Failed to get key size information from:\n%s %s" % 
(out, err))
+        key_size = m.group(1)
+        if not key_size.isnumeric():
+            self.fail("Failed to get key size information from: %s" % key_size)
+        return int(key_size)
+
+    @tag_test(TestTags.SLOW, TestTags.CORE)
+    def test_luks_format_key_size(self):
+        """Verify that formating device as LUKS works"""
+
+        # aes-xts: key size should default to 512
+        succ = BlockDev.crypto_luks_format(self.loop_dev, "aes-xts-plain64", 
0, PASSWD, None, 0)
+        self.assertTrue(succ)
+
+        key_size = self._get_luks1_key_size(self.loop_dev)
+        self.assertEqual(key_size, 512)
+
+        # aes-cbc: key size should default to 256
+        succ = BlockDev.crypto_luks_format(self.loop_dev, 
"aes-cbc-essiv:sha256", 0, PASSWD, None, 0)
+        self.assertTrue(succ)
+
+        key_size = self._get_luks1_key_size(self.loop_dev)
+        self.assertEqual(key_size, 256)
+
+        # try specifying key size for aes-xts
+        succ = BlockDev.crypto_luks_format(self.loop_dev, "aes-xts-plain64", 
256, PASSWD, None, 0)
+        self.assertTrue(succ)
+
+        key_size = self._get_luks1_key_size(self.loop_dev)
+        self.assertEqual(key_size, 256)
+
+
 class CryptoTestResize(CryptoTestCase):
 
     def _get_key_location(self, device):
@@ -928,6 +956,83 @@
         succ = BlockDev.crypto_luks_close("libblockdevTestLUKS")
         self.assertTrue(succ)
 
+
+class CryptoTestLuksSectorSize(CryptoTestCase):
+    def setUp(self):
+        if not check_cryptsetup_version("2.4.0"):
+            self.skipTest("cryptsetup encryption sector size not available, 
skipping.")
+
+        # we need a loop devices for this test case
+        self.addCleanup(self._clean_up)
+        self.dev_file = create_sparse_tempfile("crypto_test", 1024**3)
+        self.dev_file2 = create_sparse_tempfile("crypto_test", 1024**3)
+
+        succ, loop = BlockDev.loop_setup(self.dev_file)
+        if not succ:
+            raise RuntimeError("Failed to setup loop device for testing")
+        self.loop_dev = "/dev/%s" % loop
+
+        succ, loop = BlockDev.loop_setup(self.dev_file)
+        if not succ:
+            raise RuntimeError("Failed to setup loop device for testing")
+        self.loop_dev2 = "/dev/%s" % loop
+
+        # set sector size of the loop device to 4k
+        ret, _out, _err = run_command("losetup --sector-size 4096 %s" % 
self.loop_dev)
+        self.assertEqual(ret, 0)
+
+    def _clean_up(self):
+        try:
+            BlockDev.crypto_luks_close("libblockdevTestLUKS")
+        except:
+            pass
+
+        BlockDev.loop_teardown(self.loop_dev)
+        os.unlink(self.dev_file)
+
+        BlockDev.loop_teardown(self.loop_dev2)
+        os.unlink(self.dev_file2)
+
+    @tag_test(TestTags.SLOW)
+    @unittest.skipUnless(HAVE_LUKS2, "LUKS 2 not supported")
+    def test_luks2_sector_size_autodetect(self):
+        """Verify that we can autodetect 4k drives and set 4k sector size for 
them"""
+
+        # format the 4k loop device, encryption sector size should default to 
4096
+        succ = BlockDev.crypto_luks_format(self.loop_dev, 
"aes-cbc-essiv:sha256", 256, PASSWD, None, 0,
+                                           BlockDev.CryptoLUKSVersion.LUKS2)
+        self.assertTrue(succ)
+
+        succ = BlockDev.crypto_luks_open(self.loop_dev, "libblockdevTestLUKS", 
PASSWD, None, False)
+        self.assertTrue(succ)
+
+        info = BlockDev.crypto_luks_info("libblockdevTestLUKS")
+        self.assertIsNotNone(info)
+
+        self.assertEqual(info.version, BlockDev.CryptoLUKSVersion.LUKS2)
+        self.assertEqual(info.sector_size, 4096)
+
+        succ = BlockDev.crypto_luks_close("libblockdevTestLUKS")
+        self.assertTrue(succ)
+
+        # with the 512 loop device, we should still get 512
+        succ = BlockDev.crypto_luks_format(self.loop_dev2, 
"aes-cbc-essiv:sha256", 256, PASSWD, None, 0,
+                                           BlockDev.CryptoLUKSVersion.LUKS2)
+        self.assertTrue(succ)
+
+        succ = BlockDev.crypto_luks_open(self.loop_dev2, 
"libblockdevTestLUKS", PASSWD, None, False)
+        self.assertTrue(succ)
+
+        info = BlockDev.crypto_luks_info("libblockdevTestLUKS")
+        self.assertIsNotNone(info)
+
+        self.assertEqual(info.version, BlockDev.CryptoLUKSVersion.LUKS2)
+        self.assertEqual(info.sector_size, 512)
+
+        succ = BlockDev.crypto_luks_close("libblockdevTestLUKS")
+        self.assertTrue(succ)
+
+
 class CryptoTestIntegrity(CryptoTestCase):
     @tag_test(TestTags.SLOW)
     @unittest.skipUnless(HAVE_LUKS2, "LUKS 2 not supported")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libblockdev-2.25/tests/default_config/00-default.cfg 
new/libblockdev-2.26/tests/default_config/00-default.cfg
--- old/libblockdev-2.25/tests/default_config/00-default.cfg    2020-05-22 
14:34:58.000000000 +0200
+++ new/libblockdev-2.26/tests/default_config/00-default.cfg    2021-07-28 
08:43:28.000000000 +0200
@@ -21,6 +21,9 @@
 [dm]
 sonames=libbd_dm.so.2
 
+[fs]
+sonames=libbd_fs.so.2
+
 [kbd]
 sonames=libbd_kbd.so.2
 
@@ -36,6 +39,9 @@
 [mpath]
 sonames=libbd_mpath.so.2
 
+[nvdimm]
+sonames=libbd_nvdimm.so.2
+
 [swap]
 sonames=libbd_swap.so.2
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libblockdev-2.25/tests/fs_test.py 
new/libblockdev-2.26/tests/fs_test.py
--- old/libblockdev-2.25/tests/fs_test.py       2021-01-11 11:48:35.000000000 
+0100
+++ new/libblockdev-2.26/tests/fs_test.py       2021-07-28 08:43:23.000000000 
+0200
@@ -5,10 +5,13 @@
 import tempfile
 from contextlib import contextmanager
 import utils
-from utils import run, create_sparse_tempfile, mount, umount, TestTags, 
tag_test
+from utils import run, create_sparse_tempfile, mount, umount, TestTags, 
tag_test, run_command
+import re
 import six
 import overrides_hack
 
+from distutils.version import LooseVersion
+
 from gi.repository import BlockDev, GLib
 
 
@@ -26,12 +29,33 @@
 @contextmanager
 def mounted(device, where, ro=False):
     mount(device, where, ro)
-    yield
-    umount(where)
+    try:
+        yield
+    finally:
+        utils.umount(where)
+
+
+def _get_dosfstools_version():
+    _ret, out, _err = run_command("mkfs.vfat --help")
+    # mkfs.fat 4.1 (2017-01-24)
+    m = re.search(r"mkfs\.fat ([\d\.]+)", out)
+    if not m or len(m.groups()) != 1:
+        raise RuntimeError("Failed to determine dosfstools version from: %s" % 
out)
+    return LooseVersion(m.groups()[0])
+
+
+def _get_xfs_version():
+    _ret, out, _err = utils.run_command("mkfs.xfs -V")
+    m = re.search(r"mkfs\.xfs version ([\d\.]+)", out)
+    if not m or len(m.groups()) != 1:
+        raise RuntimeError("Failed to determine xfsprogs version from: %s" % 
out)
+    return LooseVersion(m.groups()[0])
+
 
 class FSTestCase(unittest.TestCase):
 
     requested_plugins = BlockDev.plugin_specs_from_names(("fs", "loop"))
+    _vfat_version = _get_dosfstools_version()
 
     @classmethod
     def setUpClass(cls):
@@ -66,6 +90,11 @@
 
         self.mount_dir = tempfile.mkdtemp(prefix="libblockdev.", 
suffix="ext4_test")
 
+        if self._vfat_version <= LooseVersion("4.1"):
+            self._mkfs_options = None
+        else:
+            self._mkfs_options = [BlockDev.ExtraArg.new("--mbr=n", "")]
+
     def _clean_up(self):
         try:
             utils.delete_lio_device(self.loop_dev)
@@ -120,7 +149,10 @@
 
         # vfat has multiple signatures on the device so it allows us to test 
the
         # 'all' argument of fs_wipe()
-        ret = run("mkfs.vfat -I %s >/dev/null 2>&1" % self.loop_dev)
+        if self._vfat_version >= LooseVersion("4.2"):
+            ret = utils.run("mkfs.vfat -I %s >/dev/null 2>&1 --mbr=n" % 
self.loop_dev)
+        else:
+            ret = utils.run("mkfs.vfat -I %s >/dev/null 2>&1" % self.loop_dev)
         self.assertEqual(ret, 0)
 
         time.sleep(0.5)
@@ -142,7 +174,10 @@
         self.assertEqual(fs_type, b"")
 
         # now do the wipe all in a one step
-        ret = run("mkfs.vfat -I %s >/dev/null 2>&1" % self.loop_dev)
+        if self._vfat_version >= LooseVersion("4.2"):
+            ret = utils.run("mkfs.vfat -I %s >/dev/null 2>&1 --mbr=n" % 
self.loop_dev)
+        else:
+            ret = utils.run("mkfs.vfat -I %s >/dev/null 2>&1" % self.loop_dev)
         self.assertEqual(ret, 0)
 
         succ = BlockDev.fs_wipe(self.loop_dev, True)
@@ -197,7 +232,10 @@
 
         # vfat has multiple signatures on the device so it allows us to test
         # that clean removes all signatures
-        ret = run("mkfs.vfat -I %s >/dev/null 2>&1" % self.loop_dev)
+        if self._vfat_version >= LooseVersion("4.2"):
+            ret = utils.run("mkfs.vfat -I %s >/dev/null 2>&1 --mbr=n" % 
self.loop_dev)
+        else:
+            ret = utils.run("mkfs.vfat -I %s >/dev/null 2>&1" % self.loop_dev)
         self.assertEqual(ret, 0)
 
         time.sleep(0.5)
@@ -706,9 +744,11 @@
         self.assertEqual(fi.block_size * fi.block_count, 50 * 1024**2)
 
         # (still) impossible to shrink an XFS file system
-        with mounted(lv, self.mount_dir):
-            with self.assertRaises(GLib.GError):
-                succ = BlockDev.fs_xfs_resize(self.mount_dir, 40 * 1024**2 / 
fi.block_size, None)
+        xfs_version = _get_xfs_version()
+        if xfs_version < LooseVersion("5.1.12"):
+            with mounted(lv, self.mount_dir):
+                with self.assertRaises(GLib.GError):
+                    succ = BlockDev.fs_resize(lv, 40 * 1024**2)
 
         run("lvresize -L70M libbd_fs_tests/xfs_test >/dev/null 2>&1")
         # should grow
@@ -744,9 +784,9 @@
         """Verify that it is possible to create a new vfat file system"""
 
         with self.assertRaises(GLib.GError):
-            BlockDev.fs_vfat_mkfs("/non/existing/device", None)
+            BlockDev.fs_vfat_mkfs("/non/existing/device", self._mkfs_options)
 
-        succ = BlockDev.fs_vfat_mkfs(self.loop_dev, None)
+        succ = BlockDev.fs_vfat_mkfs(self.loop_dev, self._mkfs_options)
         self.assertTrue(succ)
 
         # just try if we can mount the file system
@@ -764,7 +804,10 @@
         """Verify that it is possible to create an vfat file system with 
label"""
 
         ea = BlockDev.ExtraArg.new("-n", "TEST_LABEL")
-        succ = BlockDev.fs_vfat_mkfs(self.loop_dev, [ea])
+        if self._mkfs_options:
+            succ = BlockDev.fs_vfat_mkfs(self.loop_dev, [ea] + 
self._mkfs_options)
+        else:
+            succ = BlockDev.fs_vfat_mkfs(self.loop_dev, [ea])
         self.assertTrue(succ)
 
         fi = BlockDev.fs_vfat_get_info(self.loop_dev)
@@ -775,7 +818,7 @@
     def test_vfat_wipe(self):
         """Verify that it is possible to wipe an vfat file system"""
 
-        succ = BlockDev.fs_vfat_mkfs(self.loop_dev, None)
+        succ = BlockDev.fs_vfat_mkfs(self.loop_dev, self._mkfs_options)
         self.assertTrue(succ)
 
         succ = BlockDev.fs_vfat_wipe(self.loop_dev)
@@ -805,7 +848,7 @@
     def test_vfat_check(self):
         """Verify that it is possible to check an vfat file system"""
 
-        succ = BlockDev.fs_vfat_mkfs(self.loop_dev, None)
+        succ = BlockDev.fs_vfat_mkfs(self.loop_dev, self._mkfs_options)
         self.assertTrue(succ)
 
         succ = BlockDev.fs_vfat_check(self.loop_dev, None)
@@ -818,7 +861,7 @@
     def test_vfat_repair(self):
         """Verify that it is possible to repair an vfat file system"""
 
-        succ = BlockDev.fs_vfat_mkfs(self.loop_dev, None)
+        succ = BlockDev.fs_vfat_mkfs(self.loop_dev, self._mkfs_options)
         self.assertTrue(succ)
 
         succ = BlockDev.fs_vfat_repair(self.loop_dev, None)
@@ -828,7 +871,7 @@
     def test_vfat_get_info(self):
         """Verify that it is possible to get info about an vfat file system"""
 
-        succ = BlockDev.fs_vfat_mkfs(self.loop_dev, None)
+        succ = BlockDev.fs_vfat_mkfs(self.loop_dev, self._mkfs_options)
         self.assertTrue(succ)
 
         fi = BlockDev.fs_vfat_get_info(self.loop_dev)
@@ -841,7 +884,7 @@
     def test_vfat_set_label(self):
         """Verify that it is possible to set label of an vfat file system"""
 
-        succ = BlockDev.fs_vfat_mkfs(self.loop_dev, None)
+        succ = BlockDev.fs_vfat_mkfs(self.loop_dev, self._mkfs_options)
         self.assertTrue(succ)
 
         fi = BlockDev.fs_vfat_get_info(self.loop_dev)
@@ -870,7 +913,7 @@
     def test_vfat_resize(self):
         """Verify that it is possible to resize an vfat file system"""
 
-        succ = BlockDev.fs_vfat_mkfs(self.loop_dev, None)
+        succ = BlockDev.fs_vfat_mkfs(self.loop_dev, self._mkfs_options)
         self.assertTrue(succ)
 
         # shrink
@@ -999,7 +1042,7 @@
     def test_mount(self):
         """ Test basic mounting and unmounting """
 
-        succ = BlockDev.fs_vfat_mkfs(self.loop_dev, None)
+        succ = BlockDev.fs_vfat_mkfs(self.loop_dev, self._mkfs_options)
         self.assertTrue(succ)
 
         tmp = tempfile.mkdtemp(prefix="libblockdev.", suffix="mount_test")
@@ -1104,7 +1147,7 @@
         fstab = utils.read_file("/etc/fstab")
         self.addCleanup(utils.write_file, "/etc/fstab", fstab)
 
-        succ = BlockDev.fs_vfat_mkfs(self.loop_dev, None)
+        succ = BlockDev.fs_vfat_mkfs(self.loop_dev, self._mkfs_options)
         self.assertTrue(succ)
 
         tmp = tempfile.mkdtemp(prefix="libblockdev.", 
suffix="mount_fstab_test")
@@ -1139,7 +1182,7 @@
         fstab = utils.read_file("/etc/fstab")
         self.addCleanup(utils.write_file, "/etc/fstab", fstab)
 
-        succ = BlockDev.fs_vfat_mkfs(self.loop_dev, None)
+        succ = BlockDev.fs_vfat_mkfs(self.loop_dev, self._mkfs_options)
         self.assertTrue(succ)
 
         tmp = tempfile.mkdtemp(prefix="libblockdev.", 
suffix="mount_fstab_user_test")
@@ -1423,7 +1466,16 @@
     @tag_test(TestTags.UNSTABLE)
     def test_vfat_generic_resize(self):
         """Test generic resize function with a vfat file system"""
-        self._test_generic_resize(mkfs_function=BlockDev.fs_vfat_mkfs)
+        def mkfs_vfat(device, options=None):
+            if self._vfat_version >= LooseVersion("4.2"):
+                if options:
+                    return BlockDev.fs_vfat_mkfs(device, options + 
[BlockDev.ExtraArg.new("--mbr=n", "")])
+                else:
+                    return BlockDev.fs_vfat_mkfs(device, 
[BlockDev.ExtraArg.new("--mbr=n", "")])
+            else:
+                return BlockDev.fs_vfat_mkfs(device, options)
+
+        self._test_generic_resize(mkfs_function=mkfs_vfat)
 
     def _destroy_lvm(self):
         run("vgremove --yes libbd_fs_tests >/dev/null 2>&1")
@@ -1461,9 +1513,11 @@
         self.assertEqual(fi.block_size * fi.block_count, 50 * 1024**2)
 
         # (still) impossible to shrink an XFS file system
-        with mounted(lv, self.mount_dir):
-            with self.assertRaises(GLib.GError):
-                succ = BlockDev.fs_resize(lv, 40 * 1024**2)
+        xfs_version = _get_xfs_version()
+        if xfs_version < LooseVersion("5.1.12"):
+            with mounted(lv, self.mount_dir):
+                with self.assertRaises(GLib.GError):
+                    succ = BlockDev.fs_resize(lv, 40 * 1024**2)
 
         run("lvresize -L70M libbd_fs_tests/xfs_test >/dev/null 2>&1")
         # should grow
@@ -1539,7 +1593,7 @@
     def test_freeze_vfat(self):
         """ Test basic freezing and un-freezing with FAT """
 
-        succ = BlockDev.fs_vfat_mkfs(self.loop_dev, None)
+        succ = BlockDev.fs_vfat_mkfs(self.loop_dev, self._mkfs_options)
         self.assertTrue(succ)
 
         tmp = tempfile.mkdtemp(prefix="libblockdev.", suffix="freeze_test")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libblockdev-2.25/tests/lvm_dbus_config/00-default.cfg 
new/libblockdev-2.26/tests/lvm_dbus_config/00-default.cfg
--- old/libblockdev-2.25/tests/lvm_dbus_config/00-default.cfg   2020-05-22 
14:34:58.000000000 +0200
+++ new/libblockdev-2.26/tests/lvm_dbus_config/00-default.cfg   2021-07-28 
08:43:28.000000000 +0200
@@ -21,6 +21,9 @@
 [dm]
 sonames=libbd_dm.so.2
 
+[fs]
+sonames=libbd_fs.so.2
+
 [kbd]
 sonames=libbd_kbd.so.2
 
@@ -36,6 +39,9 @@
 [mpath]
 sonames=libbd_mpath.so.2
 
+[nvdimm]
+sonames=libbd_nvdimm.so.2
+
 [swap]
 sonames=libbd_swap.so.2
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libblockdev-2.25/tests/lvm_dbus_tests.py 
new/libblockdev-2.26/tests/lvm_dbus_tests.py
--- old/libblockdev-2.25/tests/lvm_dbus_tests.py        2021-01-11 
11:48:39.000000000 +0100
+++ new/libblockdev-2.26/tests/lvm_dbus_tests.py        2021-07-28 
08:43:28.000000000 +0200
@@ -399,6 +399,9 @@
         except:
             pass
 
+        # XXX remove lingering /dev entries
+        shutil.rmtree("/dev/testVG", ignore_errors=True)
+
         LvmPVonlyTestCase._clean_up(self)
 
 @unittest.skipUnless(lvm_dbus_running, "LVM DBus not running")
@@ -1210,7 +1213,7 @@
 
 @unittest.skipUnless(lvm_dbus_running, "LVM DBus not running")
 class LvmPVVGLVcachePoolCreateRemoveTestCase(LvmPVVGLVcachePoolTestCase):
-    @tag_test(TestTags.SLOW)
+    @tag_test(TestTags.SLOW, TestTags.UNSTABLE)
     def test_cache_pool_create_remove(self):
         """Verify that is it possible to create and remove a cache pool"""
 
@@ -1517,14 +1520,17 @@
         self.assertTrue(succ)
 
     def _clean_up(self):
-        BlockDev.lvm_vgremove("testVDOVG")
-        BlockDev.lvm_pvremove(self.loop_dev)
-
         try:
             BlockDev.lvm_lvremove("testVDOVG", "vdoPool", True, None)
         except:
             pass
 
+        BlockDev.lvm_vgremove("testVDOVG")
+        BlockDev.lvm_pvremove(self.loop_dev)
+
+        # XXX remove lingering /dev entries
+        shutil.rmtree("/dev/testVDOVG", ignore_errors=True)
+
         try:
             delete_lio_device(self.loop_dev)
         except RuntimeError:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libblockdev-2.25/tests/lvm_test.py 
new/libblockdev-2.26/tests/lvm_test.py
--- old/libblockdev-2.25/tests/lvm_test.py      2021-01-11 11:48:39.000000000 
+0100
+++ new/libblockdev-2.26/tests/lvm_test.py      2021-07-28 08:43:28.000000000 
+0200
@@ -378,6 +378,9 @@
         except:
             pass
 
+        # XXX remove lingering /dev entries
+        shutil.rmtree("/dev/testVG", ignore_errors=True)
+
         LvmPVonlyTestCase._clean_up(self)
 
 class LvmTestVGcreateRemove(LvmPVVGTestCase):
@@ -1126,7 +1129,7 @@
         LvmPVVGLVTestCase._clean_up(self)
 
 class LvmPVVGLVcachePoolCreateRemoveTestCase(LvmPVVGLVcachePoolTestCase):
-    @tag_test(TestTags.SLOW)
+    @tag_test(TestTags.SLOW, TestTags.UNSTABLE)
     def test_cache_pool_create_remove(self):
         """Verify that is it possible to create and remove a cache pool"""
 
@@ -1437,14 +1440,17 @@
         self.assertTrue(succ)
 
     def _clean_up(self):
-        BlockDev.lvm_vgremove("testVDOVG")
-        BlockDev.lvm_pvremove(self.loop_dev)
-
         try:
             BlockDev.lvm_lvremove("testVDOVG", "vdoPool", True, None)
         except:
             pass
 
+        BlockDev.lvm_vgremove("testVDOVG")
+        BlockDev.lvm_pvremove(self.loop_dev)
+
+        # XXX remove lingering /dev entries
+        shutil.rmtree("/dev/testVDOVG", ignore_errors=True)
+
         try:
             delete_lio_device(self.loop_dev)
         except RuntimeError:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libblockdev-2.25/tests/skip.yml 
new/libblockdev-2.26/tests/skip.yml
--- old/libblockdev-2.25/tests/skip.yml 2021-01-11 11:48:35.000000000 +0100
+++ new/libblockdev-2.26/tests/skip.yml 2021-07-28 08:43:23.000000000 +0200
@@ -37,7 +37,7 @@
 - test: fs_test.MountTest.test_mount_ntfs_ro
   skip_on:
     - distro: "debian"
-      version: ["9", "10", "testing"]
+      version: ["9", "10", "11", "testing"]
       reason: "NTFS mounting of read-only devices doesn't work as expected on 
Debian"
 
 - test: kbd_test.KbdZRAM*
@@ -137,3 +137,9 @@
     - distro: "fedora"
       version: ["31", "32"]
       reason: "working with old-style LVM snapshots leads to deadlock in LVM 
tools"
+
+- test: 
lvm_dbus_tests.LvmTestLVsnapshots.test_snapshotcreate_lvorigin_snapshotmerge
+  skip_on:
+    - distro: "centos"
+      version: "9"
+      reason: "snapshot merge doesn't work on CentOS 9 Stream with LVM DBus 
API"

Reply via email to