Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libblockdev for openSUSE:Factory checked in at 2022-08-04 13:22:35 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libblockdev (Old) and /work/SRC/openSUSE:Factory/.libblockdev.new.1521 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libblockdev" Thu Aug 4 13:22:35 2022 rev:18 rq:991754 version:2.27 Changes: -------- --- /work/SRC/openSUSE:Factory/libblockdev/libblockdev.changes 2022-02-26 17:01:55.763534442 +0100 +++ /work/SRC/openSUSE:Factory/.libblockdev.new.1521/libblockdev.changes 2022-08-04 13:22:36.316352576 +0200 @@ -1,0 +2,19 @@ +Wed Jul 27 18:01:59 UTC 2022 - Sarah Kriesch <sarah.krie...@opensuse.org> + +- Update to version 2.27: + + Fix for s390x: Remove double fclose in bd_s390_dasd_online + + fs: Return BD_FS_ERROR_UNKNOWN_FS on mounting unknown + filesystem + + overrides: Fix translating exceptions in ErrorProxy + + vdo_stats: Default to 100 % savings for invalid savings values + + lvm-dbus: Add support for changing compression and + deduplication + + lvm: + - Fix reading statistics for VDO pools with VDO 8 + - Do not set global config to and empty string + - Do not include duplicate entries in bd_lvm_lvs output + - Use correct integer type in for comparison + + crypto: Remove useless comparison in progress report in + luks_format + +------------------------------------------------------------------- Old: ---- libblockdev-2.26.tar.gz New: ---- libblockdev-2.27.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libblockdev.spec ++++++ --- /var/tmp/diff_new_pack.pLAH4X/_old 2022-08-04 13:22:37.024354585 +0200 +++ /var/tmp/diff_new_pack.pLAH4X/_new 2022-08-04 13:22:37.028354596 +0200 @@ -22,7 +22,7 @@ %bcond_with python2 Name: libblockdev -Version: 2.26 +Version: 2.27 Release: 0 Summary: A library for low-level manipulation with block devices License: LGPL-2.1-only ++++++ libblockdev-2.26.tar.gz -> libblockdev-2.27.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/Makefile.in new/libblockdev-2.27/Makefile.in --- old/libblockdev-2.26/Makefile.in 2021-07-28 08:45:15.000000000 +0200 +++ new/libblockdev-2.27/Makefile.in 2022-06-01 12:56:48.000000000 +0200 @@ -410,6 +410,7 @@ python2 = @python2@ python3 = @python3@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ skip_patterns = @skip_patterns@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/configure new/libblockdev-2.27/configure --- old/libblockdev-2.26/configure 2021-07-28 08:45:16.000000000 +0200 +++ new/libblockdev-2.27/configure 2022-06-01 12:56:48.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.26. +# Generated by GNU Autoconf 2.69 for libblockdev 2.27. # # Report bugs to <vpodz...@redhat.com>. # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='libblockdev' PACKAGE_TARNAME='libblockdev' -PACKAGE_VERSION='2.26' -PACKAGE_STRING='libblockdev 2.26' +PACKAGE_VERSION='2.27' +PACKAGE_STRING='libblockdev 2.27' PACKAGE_BUGREPORT='vpodz...@redhat.com' PACKAGE_URL='' @@ -860,6 +860,7 @@ docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -1003,6 +1004,7 @@ sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1255,6 +1257,15 @@ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1392,7 +1403,7 @@ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1505,7 +1516,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.26 to adapt to many kinds of systems. +\`configure' configures libblockdev 2.27 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1545,6 +1556,7 @@ --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1575,7 +1587,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libblockdev 2.26:";; + short | recursive ) echo "Configuration of libblockdev 2.27:";; esac cat <<\_ACEOF @@ -1764,7 +1776,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libblockdev configure 2.26 +libblockdev configure 2.27 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2133,7 +2145,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.26, which was +It was created by libblockdev $as_me 2.27, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3031,7 +3043,7 @@ # Define the identity of the package. PACKAGE='libblockdev' - VERSION='2.26' + VERSION='2.27' cat >>confdefs.h <<_ACEOF @@ -16658,7 +16670,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.26, which was +This file was extended by libblockdev $as_me 2.27, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -16715,7 +16727,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.26 +libblockdev config.status 2.27 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.26/configure.ac new/libblockdev-2.27/configure.ac --- old/libblockdev-2.26/configure.ac 2021-07-28 08:44:11.000000000 +0200 +++ new/libblockdev-2.27/configure.ac 2022-06-01 12:56:04.000000000 +0200 @@ -1,6 +1,6 @@ # configure.ac for libblockdev -AC_INIT([libblockdev], [2.26], [vpodz...@redhat.com]) +AC_INIT([libblockdev], [2.27], [vpodz...@redhat.com]) # Disable building static libraries. # This needs to be set before initializing automake diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/data/Makefile.in new/libblockdev-2.27/data/Makefile.in --- old/libblockdev-2.26/data/Makefile.in 2021-07-28 08:45:15.000000000 +0200 +++ new/libblockdev-2.27/data/Makefile.in 2022-06-01 12:56:48.000000000 +0200 @@ -371,6 +371,7 @@ python2 = @python2@ python3 = @python3@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ skip_patterns = @skip_patterns@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/data/conf.d/Makefile.in new/libblockdev-2.27/data/conf.d/Makefile.in --- old/libblockdev-2.26/data/conf.d/Makefile.in 2021-07-28 08:45:15.000000000 +0200 +++ new/libblockdev-2.27/data/conf.d/Makefile.in 2022-06-01 12:56:48.000000000 +0200 @@ -345,6 +345,7 @@ python2 = @python2@ python3 = @python3@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ skip_patterns = @skip_patterns@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/dist/Makefile.in new/libblockdev-2.27/dist/Makefile.in --- old/libblockdev-2.26/dist/Makefile.in 2021-07-28 08:45:15.000000000 +0200 +++ new/libblockdev-2.27/dist/Makefile.in 2022-06-01 12:56:48.000000000 +0200 @@ -314,6 +314,7 @@ python2 = @python2@ python3 = @python3@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ skip_patterns = @skip_patterns@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/dist/libblockdev.spec new/libblockdev-2.27/dist/libblockdev.spec --- old/libblockdev-2.26/dist/libblockdev.spec 2021-07-28 08:45:20.000000000 +0200 +++ new/libblockdev-2.27/dist/libblockdev.spec 2022-06-01 12:56:50.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.26 +Version: 2.27 Release: 1%{?dist} Summary: A library for low-level manipulation with block devices License: LGPLv2+ @@ -979,6 +979,30 @@ %files plugins-all %changelog +* Wed Jun 01 2022 Vojtech Trefny <vtre...@redhat.com> - 2.27-1 +- crypto: Remove unused and leaking error in write_escrow_data_file (vtrefny) +- kbd: Fix potential NULL pointer dereference in bd_kbd_bcache_create (vtrefny) +- kbd: Fix leaking error in bd_kbd_bcache_detach (vtrefny) +- kbd: Add missing progress reporting to bd_kbd_bcache_create (vtrefny) +- boilerplate_generator: Remove unused variable assignment (vtrefny) +- crypto: Remove useless comparison in progress report in luks_format (vtrefny) +- lvm: Use correct integer type in for comparison (vtrefny) +- lvm: Do not include duplicate entries in bd_lvm_lvs output (vtrefny) +- lvm: Do not set global config to and empty string (vtrefny) +- tests: Fix expected extended partition flags with new parted (vtrefny) +- tests: Skip test_lvcreate_type on CentOS/RHEL 9 (vtrefny) +- lvm-dbus: Add support for changing compression and deduplication (vtrefny) +- s390: Remove double fclose in bd_s390_dasd_online (#2045784) (vtrefny) +- fs: Return BD_FS_ERROR_UNKNOWN_FS on mounting unknown filesystem (tbzatek) +- tests: Use losetup to create 4k sector size loop device for testing (vtrefny) +- tests: Fix creating loop device for CryptoTestLuksSectorSize (vtrefny) +- lvm: Fix reading statistics for VDO pools with VDO 8 (vtrefny) +- vdo_stats: Default to 100 % savings for invalid savings values (vtrefny) +- tests: Remove test for NTFS read-only mounting (vtrefny) +- tests: Lower expected free space on newly created Ext filesystems (vtrefny) +- tests: Do not check that swap flag is not supported on DOS table (vtrefny) +- overrides: Fix translating exceptions in ErrorProxy (vtrefny) + * 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) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/dist/libblockdev.spec.in new/libblockdev-2.27/dist/libblockdev.spec.in --- old/libblockdev-2.26/dist/libblockdev.spec.in 2021-07-28 08:44:11.000000000 +0200 +++ new/libblockdev-2.27/dist/libblockdev.spec.in 2022-06-01 12:56:04.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.26 +Version: 2.27 Release: 1%{?dist} Summary: A library for low-level manipulation with block devices License: LGPLv2+ @@ -979,6 +979,30 @@ %files plugins-all %changelog +* Wed Jun 01 2022 Vojtech Trefny <vtre...@redhat.com> - 2.27-1 +- crypto: Remove unused and leaking error in write_escrow_data_file (vtrefny) +- kbd: Fix potential NULL pointer dereference in bd_kbd_bcache_create (vtrefny) +- kbd: Fix leaking error in bd_kbd_bcache_detach (vtrefny) +- kbd: Add missing progress reporting to bd_kbd_bcache_create (vtrefny) +- boilerplate_generator: Remove unused variable assignment (vtrefny) +- crypto: Remove useless comparison in progress report in luks_format (vtrefny) +- lvm: Use correct integer type in for comparison (vtrefny) +- lvm: Do not include duplicate entries in bd_lvm_lvs output (vtrefny) +- lvm: Do not set global config to and empty string (vtrefny) +- tests: Fix expected extended partition flags with new parted (vtrefny) +- tests: Skip test_lvcreate_type on CentOS/RHEL 9 (vtrefny) +- lvm-dbus: Add support for changing compression and deduplication (vtrefny) +- s390: Remove double fclose in bd_s390_dasd_online (#2045784) (vtrefny) +- fs: Return BD_FS_ERROR_UNKNOWN_FS on mounting unknown filesystem (tbzatek) +- tests: Use losetup to create 4k sector size loop device for testing (vtrefny) +- tests: Fix creating loop device for CryptoTestLuksSectorSize (vtrefny) +- lvm: Fix reading statistics for VDO pools with VDO 8 (vtrefny) +- vdo_stats: Default to 100 % savings for invalid savings values (vtrefny) +- tests: Remove test for NTFS read-only mounting (vtrefny) +- tests: Lower expected free space on newly created Ext filesystems (vtrefny) +- tests: Do not check that swap flag is not supported on DOS table (vtrefny) +- overrides: Fix translating exceptions in ErrorProxy (vtrefny) + * 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) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/docs/Makefile.in new/libblockdev-2.27/docs/Makefile.in --- old/libblockdev-2.26/docs/Makefile.in 2021-07-28 08:45:15.000000000 +0200 +++ new/libblockdev-2.27/docs/Makefile.in 2022-06-01 12:56:48.000000000 +0200 @@ -315,6 +315,7 @@ python2 = @python2@ python3 = @python3@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ skip_patterns = @skip_patterns@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/docs/libblockdev-docs.xml new/libblockdev-2.27/docs/libblockdev-docs.xml --- old/libblockdev-2.26/docs/libblockdev-docs.xml 2021-07-28 08:45:20.000000000 +0200 +++ new/libblockdev-2.27/docs/libblockdev-docs.xml 2022-06-01 12:56:50.000000000 +0200 @@ -8,7 +8,7 @@ <bookinfo> <title>libblockdev Reference Manual</title> <releaseinfo> - for libblockdev 2.26. + for libblockdev 2.27. 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.26/include/Makefile.in new/libblockdev-2.27/include/Makefile.in --- old/libblockdev-2.26/include/Makefile.in 2021-07-28 08:45:15.000000000 +0200 +++ new/libblockdev-2.27/include/Makefile.in 2022-06-01 12:56:48.000000000 +0200 @@ -371,6 +371,7 @@ python2 = @python2@ python3 = @python3@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ skip_patterns = @skip_patterns@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/include/blockdev/Makefile.in new/libblockdev-2.27/include/blockdev/Makefile.in --- old/libblockdev-2.26/include/blockdev/Makefile.in 2021-07-28 08:45:15.000000000 +0200 +++ new/libblockdev-2.27/include/blockdev/Makefile.in 2022-06-01 12:56:48.000000000 +0200 @@ -311,6 +311,7 @@ python2 = @python2@ python3 = @python3@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ skip_patterns = @skip_patterns@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/ltmain.sh new/libblockdev-2.27/ltmain.sh --- old/libblockdev-2.26/ltmain.sh 2021-07-28 08:43:52.000000000 +0200 +++ new/libblockdev-2.27/ltmain.sh 2022-06-01 12:55:02.000000000 +0200 @@ -2124,7 +2124,7 @@ # a configuration failure hint, and exit. func_fatal_configuration () { - func_fatal_error ${1+"$@"} \ + func__fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } @@ -2415,17 +2415,10 @@ # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" - case $host in - # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 - # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 - *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) - # don't eliminate duplications in $postdeps and $predeps - opt_duplicate_compiler_generated_deps=: - ;; - *) - opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps - ;; - esac + # Keeping compiler generated duplicates in $postdeps and $predeps is not + # harmful, and is necessary in a majority of systems that use it to satisfy + # symbol dependencies. + opt_duplicate_compiler_generated_deps=: $opt_help || { # Sanity checks first: @@ -7272,12 +7265,10 @@ # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization - # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ - -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ - -specs=*) + -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result func_append compile_command " $arg" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/scripts/Makefile.in new/libblockdev-2.27/scripts/Makefile.in --- old/libblockdev-2.26/scripts/Makefile.in 2021-07-28 08:45:15.000000000 +0200 +++ new/libblockdev-2.27/scripts/Makefile.in 2022-06-01 12:56:48.000000000 +0200 @@ -314,6 +314,7 @@ python2 = @python2@ python3 = @python3@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ skip_patterns = @skip_patterns@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/scripts/boilerplate_generator.py new/libblockdev-2.27/scripts/boilerplate_generator.py --- old/libblockdev-2.26/scripts/boilerplate_generator.py 2021-07-28 08:43:23.000000000 +0200 +++ new/libblockdev-2.27/scripts/boilerplate_generator.py 2022-06-01 12:54:40.000000000 +0200 @@ -80,7 +80,6 @@ elif in_skip or line.strip().startswith("/* BpG-skip"): in_skip = True elif line.rstrip() == "}" and in_body: - in_body = False # nothing more for this function break elif in_body: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/src/Makefile.in new/libblockdev-2.27/src/Makefile.in --- old/libblockdev-2.26/src/Makefile.in 2021-07-28 08:45:15.000000000 +0200 +++ new/libblockdev-2.27/src/Makefile.in 2022-06-01 12:56:48.000000000 +0200 @@ -371,6 +371,7 @@ python2 = @python2@ python3 = @python3@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ skip_patterns = @skip_patterns@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/src/lib/Makefile.in new/libblockdev-2.27/src/lib/Makefile.in --- old/libblockdev-2.26/src/lib/Makefile.in 2021-07-28 08:45:15.000000000 +0200 +++ new/libblockdev-2.27/src/lib/Makefile.in 2022-06-01 12:56:48.000000000 +0200 @@ -455,6 +455,7 @@ python2 = @python2@ python3 = @python3@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ skip_patterns = @skip_patterns@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/src/lib/plugin_apis/Makefile.in new/libblockdev-2.27/src/lib/plugin_apis/Makefile.in --- old/libblockdev-2.26/src/lib/plugin_apis/Makefile.in 2021-07-28 08:45:15.000000000 +0200 +++ new/libblockdev-2.27/src/lib/plugin_apis/Makefile.in 2022-06-01 12:56:48.000000000 +0200 @@ -332,6 +332,7 @@ python2 = @python2@ python3 = @python3@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ skip_patterns = @skip_patterns@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/src/lib/plugin_apis/fs.api new/libblockdev-2.27/src/lib/plugin_apis/fs.api --- old/libblockdev-2.26/src/lib/plugin_apis/fs.api 2021-07-28 08:43:23.000000000 +0200 +++ new/libblockdev-2.27/src/lib/plugin_apis/fs.api 2022-05-27 09:21:17.000000000 +0200 @@ -21,6 +21,7 @@ BD_FS_ERROR_NOT_MOUNTED, BD_FS_ERROR_AUTH, BD_FS_ERROR_TECH_UNAVAIL, + BD_FS_ERROR_UNKNOWN_FS = 11, } BDFsError; #define BD_FS_TYPE_EXT2_INFO (bd_fs_ext2_info_get_type ()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/src/lib/plugin_apis/fs.h new/libblockdev-2.27/src/lib/plugin_apis/fs.h --- old/libblockdev-2.26/src/lib/plugin_apis/fs.h 2021-07-28 08:46:43.000000000 +0200 +++ new/libblockdev-2.27/src/lib/plugin_apis/fs.h 2022-06-01 12:58:10.000000000 +0200 @@ -21,6 +21,7 @@ BD_FS_ERROR_NOT_MOUNTED, BD_FS_ERROR_AUTH, BD_FS_ERROR_TECH_UNAVAIL, + BD_FS_ERROR_UNKNOWN_FS = 11, } BDFsError; #define BD_FS_TYPE_EXT2_INFO (bd_fs_ext2_info_get_type ()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/src/plugins/Makefile.in new/libblockdev-2.27/src/plugins/Makefile.in --- old/libblockdev-2.26/src/plugins/Makefile.in 2021-07-28 08:45:16.000000000 +0200 +++ new/libblockdev-2.27/src/plugins/Makefile.in 2022-06-01 12:56:48.000000000 +0200 @@ -722,6 +722,7 @@ python2 = @python2@ python3 = @python3@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ skip_patterns = @skip_patterns@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/src/plugins/crypto.c new/libblockdev-2.27/src/plugins/crypto.c --- old/libblockdev-2.26/src/plugins/crypto.c 2021-07-28 08:43:23.000000000 +0200 +++ new/libblockdev-2.27/src/plugins/crypto.c 2022-06-01 12:54:40.000000000 +0200 @@ -876,7 +876,7 @@ bd_utils_report_finished (progress_id, (*error)->message); return FALSE; } - bd_utils_report_progress (progress_id, ((data_size != 0) && key_file) ? 70 : 100, "Added key"); + bd_utils_report_progress (progress_id, key_file ? 70 : 100, "Added key"); } if (key_file) { @@ -2269,7 +2269,6 @@ GIOChannel *out_file = NULL; GIOStatus status = G_IO_STATUS_ERROR; gsize bytes_written = 0; - GError *tmp_error = NULL; packet_data = libvk_volume_create_packet_asymmetric_with_format (volume, &packet_data_size, secret_type, cert, ui, LIBVK_PACKET_FORMAT_ASYMMETRIC_WRAP_SECRET_ONLY, error); @@ -2293,7 +2292,7 @@ g_free(packet_data); /* try to shutdown the channel, but if it fails, we cannot do anything about it here */ - g_io_channel_shutdown (out_file, TRUE, &tmp_error); + g_io_channel_shutdown (out_file, TRUE, NULL); /* error is already populated */ g_io_channel_unref (out_file); @@ -2305,7 +2304,7 @@ g_free (packet_data); if (status != G_IO_STATUS_NORMAL) { /* try to shutdown the channel, but if it fails, we cannot do anything about it here */ - g_io_channel_shutdown (out_file, TRUE, &tmp_error); + g_io_channel_shutdown (out_file, TRUE, NULL); /* error is already populated */ g_io_channel_unref (out_file); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/src/plugins/fs/Makefile.in new/libblockdev-2.27/src/plugins/fs/Makefile.in --- old/libblockdev-2.26/src/plugins/fs/Makefile.in 2021-07-28 08:45:16.000000000 +0200 +++ new/libblockdev-2.27/src/plugins/fs/Makefile.in 2022-06-01 12:56:48.000000000 +0200 @@ -411,6 +411,7 @@ python2 = @python2@ python3 = @python3@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ skip_patterns = @skip_patterns@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/src/plugins/fs/mount.c new/libblockdev-2.27/src/plugins/fs/mount.c --- old/libblockdev-2.26/src/plugins/fs/mount.c 2021-07-28 08:43:23.000000000 +0200 +++ new/libblockdev-2.27/src/plugins/fs/mount.c 2022-05-27 09:39:47.000000000 +0200 @@ -227,7 +227,7 @@ g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_FAIL, "Filesystem type not specified"); else - g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_FAIL, + g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_UNKNOWN_FS, "Filesystem type %s not configured in kernel.", args->fstype); break; case EROFS: @@ -343,6 +343,9 @@ if (permission) g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_AUTH, "Operation not permitted."); + else if (syscall_errno == ENODEV) + g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_UNKNOWN_FS, + "Filesystem type %s not configured in kernel.", args->fstype); else { if (*buf == '\0') g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_FAIL, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/src/plugins/fs.h new/libblockdev-2.27/src/plugins/fs.h --- old/libblockdev-2.26/src/plugins/fs.h 2021-07-28 08:43:23.000000000 +0200 +++ new/libblockdev-2.27/src/plugins/fs.h 2022-05-27 09:21:17.000000000 +0200 @@ -16,6 +16,7 @@ BD_FS_ERROR_NOT_MOUNTED, BD_FS_ERROR_AUTH, // keep this entry last (XXX?) BD_FS_ERROR_TECH_UNAVAIL, + BD_FS_ERROR_UNKNOWN_FS = 11, } BDFsError; /* XXX: where the file systems start at the enum of technologies */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/src/plugins/kbd.c new/libblockdev-2.27/src/plugins/kbd.c --- old/libblockdev-2.26/src/plugins/kbd.c 2021-07-28 08:43:23.000000000 +0200 +++ new/libblockdev-2.27/src/plugins/kbd.c 2022-06-01 12:54:40.000000000 +0200 @@ -812,6 +812,7 @@ if (!present) { g_set_error (error, BD_KBD_ERROR, BD_KBD_ERROR_BCACHE_NOEXIST, "Failed to locate uuid symlink '%s'", device_uuid[i]); + bd_utils_report_finished (progress_id, (*error)->message); return FALSE; } } @@ -843,6 +844,8 @@ } if (!dev_name) { globfree (&globbuf); + g_set_error (error, BD_KBD_ERROR, BD_KBD_ERROR_BCACHE_SETUP_FAIL, + "Failed to determine bcache device name"); bd_utils_report_finished (progress_id, (*error)->message); return FALSE; } @@ -959,6 +962,7 @@ path = g_strdup_printf ("/sys/block/%s/bcache/detach", bcache_device); success = bd_utils_echo_str_to_file (uuid, path, error); if (!success) { + g_clear_error (error); g_set_error (error, BD_KBD_ERROR, BD_KBD_ERROR_BCACHE_DETACH_FAIL, "Failed to detach '%s' from '%s'", uuid, bcache_device); g_free (link); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/src/plugins/lvm-dbus.c new/libblockdev-2.27/src/plugins/lvm-dbus.c --- old/libblockdev-2.26/src/plugins/lvm-dbus.c 2021-07-28 08:43:28.000000000 +0200 +++ new/libblockdev-2.27/src/plugins/lvm-dbus.c 2022-06-01 12:54:40.000000000 +0200 @@ -375,15 +375,9 @@ } else return TRUE; case BD_LVM_TECH_VDO: - if (mode & BD_LVM_TECH_MODE_MODIFY) { - g_set_error (error, BD_LVM_ERROR, BD_LVM_ERROR_TECH_UNAVAIL, - "Modifying existing LVM VDO devices is not supported by this plugin implementation."); - return FALSE; - - } else - return check_dbus_deps (&avail_dbus_deps, DBUS_DEPS_LVMDBUSD_MASK, dbus_deps, DBUS_DEPS_LAST, &deps_check_lock, error) && - check_features (&avail_features, FEATURES_VDO_MASK, features, FEATURES_LAST, &deps_check_lock, error) && - check_module_deps (&avail_module_deps, MODULE_DEPS_VDO_MASK, module_deps, MODULE_DEPS_LAST, &deps_check_lock, error); + return check_dbus_deps (&avail_dbus_deps, DBUS_DEPS_LVMDBUSD_MASK, dbus_deps, DBUS_DEPS_LAST, &deps_check_lock, error) && + check_features (&avail_features, FEATURES_VDO_MASK, features, FEATURES_LAST, &deps_check_lock, error) && + check_module_deps (&avail_module_deps, MODULE_DEPS_VDO_MASK, module_deps, MODULE_DEPS_LAST, &deps_check_lock, error); default: /* everything is supported by this implementation of the plugin */ return check_dbus_deps (&avail_dbus_deps, DBUS_DEPS_LVMDBUSD_MASK, dbus_deps, DBUS_DEPS_LAST, &deps_check_lock, error); @@ -809,6 +803,13 @@ g_free (obj_id); } +static void call_vdopool_method_sync (const gchar *vg_name, const gchar *pool_name, const gchar *method, GVariant *params, GVariant *extra_params, const BDExtraArg **extra_args, gboolean lock_config, GError **error) { + gchar *obj_id = g_strdup_printf ("%s/%s", vg_name, pool_name); + + call_lvm_obj_method_sync (obj_id, VDO_POOL_INTF, method, params, extra_params, extra_args, lock_config, error); + g_free (obj_id); +} + static GVariant* get_lv_property (const gchar *vg_name, const gchar *lv_name, const gchar *property, GError **error) { gchar *lv_spec = NULL; GVariant *ret = NULL; @@ -2625,7 +2626,10 @@ g_free (global_config_str); /* now store the new one */ - global_config_str = g_strdup (new_config); + if (!new_config || g_strcmp0 (new_config, "") == 0) + global_config_str = NULL; + else + global_config_str = g_strdup (new_config); g_mutex_unlock (&global_config_lock); return TRUE; @@ -3478,8 +3482,10 @@ * * Tech category: %BD_LVM_TECH_VDO-%BD_LVM_TECH_MODE_MODIFY */ -gboolean bd_lvm_vdo_enable_compression (const gchar *vg_name UNUSED, const gchar *pool_name UNUSED, const BDExtraArg **extra UNUSED, GError **error) { - return bd_lvm_is_tech_avail (BD_LVM_TECH_VDO, BD_LVM_TECH_MODE_MODIFY, error); +gboolean bd_lvm_vdo_enable_compression (const gchar *vg_name, const gchar *pool_name, const BDExtraArg **extra, GError **error) { + call_vdopool_method_sync (vg_name, pool_name, "EnableCompression", NULL, NULL, extra, TRUE, error); + + return (*error == NULL); } /** @@ -3494,8 +3500,10 @@ * * Tech category: %BD_LVM_TECH_VDO-%BD_LVM_TECH_MODE_MODIFY */ -gboolean bd_lvm_vdo_disable_compression (const gchar *vg_name UNUSED, const gchar *pool_name UNUSED, const BDExtraArg **extra UNUSED, GError **error) { - return bd_lvm_is_tech_avail (BD_LVM_TECH_VDO, BD_LVM_TECH_MODE_MODIFY, error); +gboolean bd_lvm_vdo_disable_compression (const gchar *vg_name, const gchar *pool_name, const BDExtraArg **extra, GError **error) { + call_vdopool_method_sync (vg_name, pool_name, "DisableCompression", NULL, NULL, extra, TRUE, error); + + return (*error == NULL); } /** @@ -3510,8 +3518,10 @@ * * Tech category: %BD_LVM_TECH_VDO-%BD_LVM_TECH_MODE_MODIFY */ -gboolean bd_lvm_vdo_enable_deduplication (const gchar *vg_name UNUSED, const gchar *pool_name UNUSED, const BDExtraArg **extra UNUSED, GError **error) { - return bd_lvm_is_tech_avail (BD_LVM_TECH_VDO, BD_LVM_TECH_MODE_MODIFY, error); +gboolean bd_lvm_vdo_enable_deduplication (const gchar *vg_name, const gchar *pool_name, const BDExtraArg **extra, GError **error) { + call_vdopool_method_sync (vg_name, pool_name, "EnableDeduplication", NULL, NULL, extra, TRUE, error); + + return (*error == NULL); } /** @@ -3526,8 +3536,10 @@ * * Tech category: %BD_LVM_TECH_VDO-%BD_LVM_TECH_MODE_MODIFY */ -gboolean bd_lvm_vdo_disable_deduplication (const gchar *vg_name UNUSED, const gchar *pool_name UNUSED, const BDExtraArg **extra UNUSED, GError **error) { - return bd_lvm_is_tech_avail (BD_LVM_TECH_VDO, BD_LVM_TECH_MODE_MODIFY, error); +gboolean bd_lvm_vdo_disable_deduplication (const gchar *vg_name, const gchar *pool_name, const BDExtraArg **extra, GError **error) { + call_vdopool_method_sync (vg_name, pool_name, "DisableDeduplication", NULL, NULL, extra, TRUE, error); + + return (*error == NULL); } /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/src/plugins/lvm.c new/libblockdev-2.27/src/plugins/lvm.c --- old/libblockdev-2.26/src/plugins/lvm.c 2021-07-28 08:43:23.000000000 +0200 +++ new/libblockdev-2.27/src/plugins/lvm.c 2022-06-01 12:54:40.000000000 +0200 @@ -1176,8 +1176,8 @@ * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_CREATE */ gboolean bd_lvm_vgcreate (const gchar *name, const gchar **pv_list, guint64 pe_size, const BDExtraArg **extra, GError **error) { - guint8 i = 0; - guint8 pv_list_len = pv_list ? g_strv_length ((gchar **) pv_list) : 0; + guint i = 0; + guint pv_list_len = pv_list ? g_strv_length ((gchar **) pv_list) : 0; const gchar **argv = g_new0 (const gchar*, pv_list_len + 5); pe_size = RESOLVE_PE_SIZE (pe_size); gboolean success = FALSE; @@ -1810,8 +1810,20 @@ if (table && (num_items == 15)) { /* valid line, try to parse and record it */ lvdata = get_lv_data_from_table (table, TRUE); - if (lvdata) - g_ptr_array_add (lvs, lvdata); + if (lvdata) { + /* ignore duplicate entries in lvs output, these are caused by multi segments LVs */ + for (gsize i = 0; i < lvs->len; i++) { + if (g_strcmp0 (((BDLVMLVdata *) g_ptr_array_index (lvs, i))->lv_name, lvdata->lv_name) == 0) { + g_debug ("Duplicate LV entry for '%s' found in lvs output", lvdata->lv_name); + bd_lvm_lvdata_free (lvdata); + lvdata = NULL; + break; + } + } + + if (lvdata) + g_ptr_array_add (lvs, lvdata); + } } else if (table) g_hash_table_destroy (table); @@ -1993,7 +2005,10 @@ g_free (global_config_str); /* now store the new one */ - global_config_str = g_strdup (new_config); + if (!new_config || g_strcmp0 (new_config, "") == 0) + global_config_str = NULL; + else + global_config_str = g_strdup (new_config); g_mutex_unlock (&global_config_lock); return TRUE; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/src/plugins/s390.c new/libblockdev-2.27/src/plugins/s390.c --- old/libblockdev-2.26/src/plugins/s390.c 2021-07-28 08:43:23.000000000 +0200 +++ new/libblockdev-2.27/src/plugins/s390.c 2022-05-27 09:21:17.000000000 +0200 @@ -290,7 +290,6 @@ if (wrc == EOF) { g_set_error (error, BD_S390_ERROR, BD_S390_ERROR_DEVICE, "Could not set DASD device %s online", dasd); - fclose(fd); bd_utils_report_finished (progress_id, (*error)->message); return FALSE; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/src/plugins/vdo_stats.c new/libblockdev-2.27/src/plugins/vdo_stats.c --- old/libblockdev-2.26/src/plugins/vdo_stats.c 2021-01-11 12:38:37.000000000 +0100 +++ new/libblockdev-2.27/src/plugins/vdo_stats.c 2022-05-27 09:21:17.000000000 +0200 @@ -96,7 +96,7 @@ g_hash_table_replace (stats, g_strdup ("oneKBlocksUsed"), g_strdup_printf ("%"G_GINT64_FORMAT, (data_blocks_used + overhead_blocks_used) * block_size / 1024)); g_hash_table_replace (stats, g_strdup ("oneKBlocksAvailable"), g_strdup_printf ("%"G_GINT64_FORMAT, (physical_blocks - data_blocks_used - overhead_blocks_used) * block_size / 1024)); g_hash_table_replace (stats, g_strdup ("usedPercent"), g_strdup_printf ("%.0f", 100.0 * (gfloat) (data_blocks_used + overhead_blocks_used) / (gfloat) physical_blocks + 0.5)); - savings = (logical_blocks_used > 0) ? (gint64) (100.0 * (gfloat) (logical_blocks_used - data_blocks_used) / (gfloat) logical_blocks_used) : -1; + savings = (logical_blocks_used > 0) ? (gint64) (100.0 * (gfloat) (logical_blocks_used - data_blocks_used) / (gfloat) logical_blocks_used) : 100; g_hash_table_replace (stats, g_strdup ("savings"), g_strdup_printf ("%"G_GINT64_FORMAT, savings)); if (savings >= 0) g_hash_table_replace (stats, g_strdup ("savingPercent"), g_strdup_printf ("%"G_GINT64_FORMAT, savings)); @@ -133,6 +133,23 @@ add_journal_stats (stats); } +static gchar* _dm_node_from_name (const gchar *map_name, GError **error) { + gchar *dev_path = NULL; + gchar *ret = NULL; + gchar *dev_mapper_path = g_strdup_printf ("/dev/mapper/%s", map_name); + + dev_path = bd_utils_resolve_device (dev_mapper_path, error); + g_free (dev_mapper_path); + if (!dev_path) + /* error is already populated */ + return NULL; + + ret = g_path_get_basename (dev_path); + g_free (dev_path); + + return ret; +} + GHashTable __attribute__ ((visibility ("hidden"))) *vdo_get_stats_full (const gchar *name, GError **error) { GHashTable *stats; @@ -141,14 +158,31 @@ const gchar *direntry; gchar *s; gchar *val = NULL; + g_autofree gchar *dm_node = NULL; - /* TODO: does the `name` need to be escaped? */ - stats_dir = g_build_path (G_DIR_SEPARATOR_S, VDO_SYS_PATH, name, "statistics", NULL); + /* try "new" (kvdo >= 8) path first -- /sys/block/dm-X/vdo/statistics */ + dm_node = _dm_node_from_name (name, error); + if (dm_node == NULL) { + g_prefix_error (error, "Failed to get DM node for %s: ", name); + return NULL; + } + + stats_dir = g_build_path (G_DIR_SEPARATOR_S, "/sys/block", dm_node, "vdo/statistics", NULL); dir = g_dir_open (stats_dir, 0, error); if (dir == NULL) { - g_prefix_error (error, "Error reading statistics from %s: ", stats_dir); + g_debug ("Failed to read VDO stats using the new API, falling back to %s: %s", + VDO_SYS_PATH, (*error)->message); g_free (stats_dir); - return NULL; + g_clear_error (error); + + /* lets try /sys/kvdo */ + stats_dir = g_build_path (G_DIR_SEPARATOR_S, VDO_SYS_PATH, name, "statistics", NULL); + dir = g_dir_open (stats_dir, 0, error); + if (dir == NULL) { + g_prefix_error (error, "Error reading statistics from %s: ", stats_dir); + g_free (stats_dir); + return NULL; + } } stats = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/src/python/Makefile.in new/libblockdev-2.27/src/python/Makefile.in --- old/libblockdev-2.26/src/python/Makefile.in 2021-07-28 08:45:16.000000000 +0200 +++ new/libblockdev-2.27/src/python/Makefile.in 2022-06-01 12:56:48.000000000 +0200 @@ -371,6 +371,7 @@ python2 = @python2@ python3 = @python3@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ skip_patterns = @skip_patterns@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/src/python/gi/Makefile.in new/libblockdev-2.27/src/python/gi/Makefile.in --- old/libblockdev-2.26/src/python/gi/Makefile.in 2021-07-28 08:45:16.000000000 +0200 +++ new/libblockdev-2.27/src/python/gi/Makefile.in 2022-06-01 12:56:48.000000000 +0200 @@ -371,6 +371,7 @@ python2 = @python2@ python3 = @python3@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ skip_patterns = @skip_patterns@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/src/python/gi/overrides/BlockDev.py new/libblockdev-2.27/src/python/gi/overrides/BlockDev.py --- old/libblockdev-2.26/src/python/gi/overrides/BlockDev.py 2021-07-28 08:43:23.000000000 +0200 +++ new/libblockdev-2.27/src/python/gi/overrides/BlockDev.py 2022-05-27 09:21:17.000000000 +0200 @@ -29,7 +29,7 @@ import re import os -from collections import namedtuple +from collections import namedtuple, defaultdict from gi.importer import modules from gi.overrides import override @@ -1000,10 +1000,12 @@ self._prefix = prefix self._mod = mod self._tr_excs = tr_excs + + self._xrules = defaultdict() if xrules: - self._xrules = {xrule.orig_exc: xrule for xrule in xrules} - else: - self._xrules = dict() + for xrule in xrules: + self._xrules.setdefault(xrule.orig_exc, []).append(xrule) + self._use_local = use_local self._wrapped_cache = dict() @@ -1045,13 +1047,9 @@ e_type = type(e) if e_type in self._xrules: - matches = True - if self._xrules[e_type].code and self._xrules[e_type].code != getattr(e, "code"): - matches = False - if matches and self._xrules[e_type].regexp and not self._xrules[e_type].regexp.match(msg): - matches = False - if matches: - raise self._xrules[e_type].new_exc(msg) + for xrule in self._xrules[e_type]: + if xrule.code == getattr(e, "code") or (xrule.regexp and xrule.regexp.match(msg)): + raise xrule.new_exc(msg) # try to find exact type match transform = next((tr_t for tr_t in self._tr_excs if self._tr_excs == e_type), None) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/src/python/gi/overrides/Makefile.in new/libblockdev-2.27/src/python/gi/overrides/Makefile.in --- old/libblockdev-2.26/src/python/gi/overrides/Makefile.in 2021-07-28 08:45:16.000000000 +0200 +++ new/libblockdev-2.27/src/python/gi/overrides/Makefile.in 2022-06-01 12:56:48.000000000 +0200 @@ -344,6 +344,7 @@ python2 = @python2@ python3 = @python3@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ skip_patterns = @skip_patterns@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/src/utils/Makefile.in new/libblockdev-2.27/src/utils/Makefile.in --- old/libblockdev-2.26/src/utils/Makefile.in 2021-07-28 08:45:16.000000000 +0200 +++ new/libblockdev-2.27/src/utils/Makefile.in 2022-06-01 12:56:48.000000000 +0200 @@ -409,6 +409,7 @@ python2 = @python2@ python3 = @python3@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ skip_patterns = @skip_patterns@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/tests/crypto_test.py new/libblockdev-2.27/tests/crypto_test.py --- old/libblockdev-2.26/tests/crypto_test.py 2021-07-28 08:43:28.000000000 +0200 +++ new/libblockdev-2.27/tests/crypto_test.py 2022-05-27 09:21:17.000000000 +0200 @@ -967,20 +967,16 @@ 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 + # create a 4k sector loop device + ret, out, err = run_command("losetup -f %s --show --sector-size 4096" % self.dev_file) + self.assertEqual(ret, 0, "Failed to setup loop device for testing: %s" % err) + self.loop_dev = out.strip() - succ, loop = BlockDev.loop_setup(self.dev_file) + succ, loop = BlockDev.loop_setup(self.dev_file2) 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") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/tests/fs_test.py new/libblockdev-2.27/tests/fs_test.py --- old/libblockdev-2.26/tests/fs_test.py 2021-07-28 08:43:23.000000000 +0200 +++ new/libblockdev-2.27/tests/fs_test.py 2022-05-27 09:21:17.000000000 +0200 @@ -425,8 +425,8 @@ self.assertTrue(fi) self.assertEqual(fi.block_size, 1024) self.assertEqual(fi.block_count, 100 * 1024**2 / 1024) - # at least 90 % should be available, so it should be reported - self.assertGreater(fi.free_blocks, 0.90 * 100 * 1024**2 / 1024) + # at least 80 % should be available, so it should be reported + self.assertGreater(fi.free_blocks, 0.80 * 100 * 1024**2 / 1024) self.assertEqual(fi.label, "") # should be an non-empty string self.assertTrue(fi.uuid) @@ -436,8 +436,8 @@ fi = BlockDev.fs_ext4_get_info(self.loop_dev) self.assertEqual(fi.block_size, 1024) self.assertEqual(fi.block_count, 100 * 1024**2 / 1024) - # at least 90 % should be available, so it should be reported - self.assertGreater(fi.free_blocks, 0.90 * 100 * 1024**2 / 1024) + # at least 80 % should be available, so it should be reported + self.assertGreater(fi.free_blocks, 0.80 * 100 * 1024**2 / 1024) self.assertEqual(fi.label, "") # should be an non-empty string self.assertTrue(fi.uuid) @@ -515,8 +515,8 @@ self.assertTrue(fi) self.assertEqual(fi.block_size, 1024) self.assertEqual(fi.block_count, 100 * 1024**2 / 1024) - # at least 90 % should be available, so it should be reported - self.assertGreater(fi.free_blocks, 0.90 * 100 * 1024**2 / 1024) + # at least 80 % should be available, so it should be reported + self.assertGreater(fi.free_blocks, 0.80 * 100 * 1024**2 / 1024) succ = resize_function(self.loop_dev, 50 * 1024**2, None) self.assertTrue(succ) @@ -532,8 +532,8 @@ self.assertTrue(fi) self.assertEqual(fi.block_size, 1024) self.assertEqual(fi.block_count, 100 * 1024**2 / 1024) - # at least 90 % should be available, so it should be reported - self.assertGreater(fi.free_blocks, 0.90 * 100 * 1024**2 / 1024) + # at least 80 % should be available, so it should be reported + self.assertGreater(fi.free_blocks, 0.80 * 100 * 1024**2 / 1024) # resize again succ = resize_function(self.loop_dev, 50 * 1024**2, None) @@ -550,8 +550,8 @@ self.assertTrue(fi) self.assertEqual(fi.block_size, 1024) self.assertEqual(fi.block_count, 100 * 1024**2 / 1024) - # at least 90 % should be available, so it should be reported - self.assertGreater(fi.free_blocks, 0.90 * 100 * 1024**2 / 1024) + # at least 80 % should be available, so it should be reported + self.assertGreater(fi.free_blocks, 0.80 * 100 * 1024**2 / 1024) def test_ext2_resize(self): """Verify that it is possible to resize an ext2 file system""" @@ -1050,6 +1050,10 @@ self.addCleanup(umount, self.loop_dev) + # try mounting unknown filesystem type + with self.assertRaisesRegex(GLib.GError, r"Filesystem type .* not configured in kernel."): + BlockDev.fs_mount(self.loop_dev, tmp, "nonexisting", None) + succ = BlockDev.fs_mount(self.loop_dev, tmp, "vfat", None) self.assertTrue(succ) self.assertTrue(os.path.ismount(tmp)) @@ -1270,34 +1274,6 @@ self.assertTrue(succ) self.assertFalse(os.path.ismount(tmp)) - def test_mount_ntfs_ro(self): - """ Test mounting and unmounting read-only device with NTFS filesystem""" - - if not self.ntfs_avail: - self.skipTest("skipping NTFS: not available") - - succ = BlockDev.fs_ntfs_mkfs(self.loop_dev, None) - self.assertTrue(succ) - - tmp = tempfile.mkdtemp(prefix="libblockdev.", suffix="mount_test") - self.addCleanup(os.rmdir, tmp) - - # set the device read-only - self.setro(self.loop_dev) - self.addCleanup(self.setrw, self.loop_dev) - - # forced rw mount should fail - with self.assertRaises(GLib.GError): - BlockDev.fs_mount(self.loop_dev, tmp, "ntfs", "rw") - - # read-only mount should work - succ = BlockDev.fs_mount(self.loop_dev, tmp, "ntfs", "ro") - self.assertTrue(succ) - self.assertTrue(os.path.ismount(tmp)) - - succ = BlockDev.fs_unmount(self.loop_dev, False, False, None) - self.assertTrue(succ) - self.assertFalse(os.path.ismount(tmp)) class GenericCheck(FSTestCase): log = [] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/tests/lvm_dbus_tests.py new/libblockdev-2.27/tests/lvm_dbus_tests.py --- old/libblockdev-2.26/tests/lvm_dbus_tests.py 2021-07-28 08:43:28.000000000 +0200 +++ new/libblockdev-2.27/tests/lvm_dbus_tests.py 2022-06-01 12:54:40.000000000 +0200 @@ -1619,11 +1619,57 @@ @tag_test(TestTags.SLOW) def test_enabla_disable_compression(self): - self.skipTest("Enabling/disabling compression on LVM VDO not implemented in LVM DBus API.") + succ = BlockDev.lvm_vdo_pool_create("testVDOVG", "vdoLV", "vdoPool", 7 * 1024**3, 35 * 1024**3, + 300 * 1024**2) + self.assertTrue(succ) + + # enabled by default + vdo_info = BlockDev.lvm_vdo_info("testVDOVG", "vdoPool") + self.assertIsNotNone(vdo_info) + self.assertTrue(vdo_info.compression) + + # disable compression + succ = BlockDev.lvm_vdo_disable_compression("testVDOVG", "vdoPool") + self.assertTrue(succ) + + vdo_info = BlockDev.lvm_vdo_info("testVDOVG", "vdoPool") + self.assertIsNotNone(vdo_info) + self.assertFalse(vdo_info.compression) + + # and enable compression back + succ = BlockDev.lvm_vdo_enable_compression("testVDOVG", "vdoPool") + self.assertTrue(succ) + + vdo_info = BlockDev.lvm_vdo_info("testVDOVG", "vdoPool") + self.assertIsNotNone(vdo_info) + self.assertTrue(vdo_info.compression) @tag_test(TestTags.SLOW) def test_enable_disable_deduplication(self): - self.skipTest("Enabling/disabling deduplication on LVM VDO not implemented in LVM DBus API.") + succ = BlockDev.lvm_vdo_pool_create("testVDOVG", "vdoLV", "vdoPool", 7 * 1024**3, 35 * 1024**3, + 300 * 1024**2) + self.assertTrue(succ) + + # enabled by default + vdo_info = BlockDev.lvm_vdo_info("testVDOVG", "vdoPool") + self.assertIsNotNone(vdo_info) + self.assertTrue(vdo_info.deduplication) + + # disable compression + succ = BlockDev.lvm_vdo_disable_deduplication("testVDOVG", "vdoPool") + self.assertTrue(succ) + + vdo_info = BlockDev.lvm_vdo_info("testVDOVG", "vdoPool") + self.assertIsNotNone(vdo_info) + self.assertFalse(vdo_info.deduplication) + + # and enable compression back + succ = BlockDev.lvm_vdo_enable_deduplication("testVDOVG", "vdoPool") + self.assertTrue(succ) + + vdo_info = BlockDev.lvm_vdo_info("testVDOVG", "vdoPool") + self.assertIsNotNone(vdo_info) + self.assertTrue(vdo_info.deduplication) @tag_test(TestTags.SLOW) def test_vdo_pool_convert(self): @@ -1653,3 +1699,15 @@ full_stats = BlockDev.lvm_vdo_get_stats_full("testVDOVG", "vdoPool") self.assertIn("writeAmplificationRatio", full_stats.keys()) + + +class LvmConfigTestPvremove(LvmPVonlyTestCase): + + @tag_test(TestTags.REGRESSION) + def test_set_empty_config(self): + succ = BlockDev.lvm_pvcreate(self.loop_dev) + self.assertTrue(succ) + + BlockDev.lvm_set_global_config("") + succ = BlockDev.lvm_pvremove(self.loop_dev) + self.assertTrue(succ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/tests/lvm_test.py new/libblockdev-2.27/tests/lvm_test.py --- old/libblockdev-2.26/tests/lvm_test.py 2021-07-28 08:43:28.000000000 +0200 +++ new/libblockdev-2.27/tests/lvm_test.py 2022-06-01 12:54:40.000000000 +0200 @@ -915,6 +915,47 @@ lvs = BlockDev.lvm_lvs("testVG") self.assertEqual(len(lvs), 1) +class LvmTestLVsMultiSegment(LvmPVVGLVTestCase): + def _clean_up(self): + try: + BlockDev.lvm_lvremove("testVG", "testLV2", True, None) + except: + pass + + LvmPVVGLVTestCase._clean_up(self) + + def test_lvs(self): + """Verify that it's possible to gather info about LVs""" + + succ = BlockDev.lvm_pvcreate(self.loop_dev, 0, 0, None) + self.assertTrue(succ) + + succ = BlockDev.lvm_vgcreate("testVG", [self.loop_dev], 0, None) + self.assertTrue(succ) + + succ = BlockDev.lvm_lvcreate("testVG", "testLV", 10 * 1024**2) + self.assertTrue(succ) + + lvs = BlockDev.lvm_lvs("testVG") + self.assertEqual(len(lvs), 1) + self.assertListEqual([lv.lv_name for lv in lvs], ["testLV"]) + + # add second LV + succ = BlockDev.lvm_lvcreate("testVG", "testLV2", 10 * 1024**2) + self.assertTrue(succ) + + lvs = BlockDev.lvm_lvs("testVG") + self.assertEqual(len(lvs), 2) + self.assertListEqual([lv.lv_name for lv in lvs], ["testLV", "testLV2"]) + + # by resizing the first LV we will create two segments + succ = BlockDev.lvm_lvresize("testVG", "testLV", 20 * 1024**2, None) + self.assertTrue(succ) + + lvs = BlockDev.lvm_lvs("testVG") + self.assertEqual(len(lvs), 2) + self.assertListEqual([lv.lv_name for lv in lvs], ["testLV", "testLV2"]) + class LvmPVVGthpoolTestCase(LvmPVVGTestCase): def _clean_up(self): try: @@ -1632,3 +1673,15 @@ full_stats = BlockDev.lvm_vdo_get_stats_full("testVDOVG", "vdoPool") self.assertIn("writeAmplificationRatio", full_stats.keys()) + + +class LvmConfigTestPvremove(LvmPVonlyTestCase): + + @tag_test(TestTags.REGRESSION) + def test_set_empty_config(self): + succ = BlockDev.lvm_pvcreate(self.loop_dev) + self.assertTrue(succ) + + BlockDev.lvm_set_global_config("") + succ = BlockDev.lvm_pvremove(self.loop_dev) + self.assertTrue(succ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/tests/part_test.py new/libblockdev-2.27/tests/part_test.py --- old/libblockdev-2.26/tests/part_test.py 2021-07-28 08:43:23.000000000 +0200 +++ new/libblockdev-2.27/tests/part_test.py 2022-05-27 09:38:37.000000000 +0200 @@ -356,7 +356,7 @@ # as is the start of the first part from the start of the disk self.assertTrue(abs(ps4.start - (ps3.start + ps3.size + 1)) < ps.start) self.assertEqual(ps4.size, 10 * 1024**2) - self.assertEqual(ps4.flags, 0) # no flags (combination of bit flags) + self.assertIn(ps4.flags, [0, 128]) # no flags or extended+lba (combination of bit flags) # no more primary partitions allowed in the MSDOS table with self.assertRaises(GLib.GError): @@ -404,7 +404,7 @@ # as is the start of the first part from the start of the disk self.assertTrue(abs(ps3.start - (ps2.start + ps2.size + 1)) < ps.start) self.assertEqual(ps3.size, 30 * 1024**2) - self.assertEqual(ps3.flags, 0) # no flags (combination of bit flags) + self.assertIn(ps3.flags, [0, 128]) # no flags or extended+lba (combination of bit flags) # the logical partition has number 5 even though the extended partition # has number 3 @@ -871,7 +871,7 @@ # as is the start of the first part from the start of the disk self.assertTrue(abs(ps3.start - (ps2.start + ps2.size + 1)) < ps.start) self.assertEqual(ps3.size, 35 * 1024**2) - self.assertEqual(ps3.flags, 0) # no flags (combination of bit flags) + self.assertIn(ps3.flags, [0, 128]) # no flags or extended+lba (combination of bit flags) # the logical partition has number 5 even though the extended partition # has number 3 @@ -1117,11 +1117,6 @@ self.assertTrue(ps.flags & BlockDev.PartFlag.BOOT) self.assertTrue(ps.flags & BlockDev.PartFlag.LVM) - # SWAP label not supported on the MSDOS table - with self.assertRaises(GLib.GError): - BlockDev.part_set_part_flag (self.loop_dev, ps.path, BlockDev.PartFlag.SWAP, True) - with self.assertRaises(GLib.GError): - BlockDev.part_set_part_flag (self.loop_dev, ps.path, BlockDev.PartFlag.SWAP, False) # so isn't GPT_HIDDEN with self.assertRaises(GLib.GError): BlockDev.part_set_part_flag (self.loop_dev, ps.path, BlockDev.PartFlag.GPT_HIDDEN, True) @@ -1235,10 +1230,6 @@ self.assertTrue(ps.flags & BlockDev.PartFlag.BOOT) self.assertTrue(ps.flags & BlockDev.PartFlag.LVM) - # SWAP label not supported on the MSDOS table - with self.assertRaises(GLib.GError): - BlockDev.part_set_part_flags (self.loop_dev, ps.path, BlockDev.PartFlag.SWAP) - # also try some GPT-only flags succ = BlockDev.part_create_table (self.loop_dev, BlockDev.PartTableType.GPT, True) self.assertTrue(succ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/tests/skip.yml new/libblockdev-2.27/tests/skip.yml --- old/libblockdev-2.26/tests/skip.yml 2021-07-28 08:43:23.000000000 +0200 +++ new/libblockdev-2.27/tests/skip.yml 2022-05-27 09:21:25.000000000 +0200 @@ -34,12 +34,6 @@ version: "9" reason: "volume_key asks for password in non-interactive mode on this release" -- test: fs_test.MountTest.test_mount_ntfs_ro - skip_on: - - distro: "debian" - version: ["9", "10", "11", "testing"] - reason: "NTFS mounting of read-only devices doesn't work as expected on Debian" - - test: kbd_test.KbdZRAM* skip_on: - distro: "debian" @@ -143,3 +137,9 @@ - distro: "centos" version: "9" reason: "snapshot merge doesn't work on CentOS 9 Stream with LVM DBus API" + +- test: (lvm_test|lvm_dbus_tests).LvmTestLVcreateType + skip_on: + - distro: "centos" + version: "9" + reason: "Creating RAID 1 LV on CentOS/RHEL 9 causes a system deadlock" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/tests/swap_test.py new/libblockdev-2.27/tests/swap_test.py --- old/libblockdev-2.26/tests/swap_test.py 2021-07-28 08:43:23.000000000 +0200 +++ new/libblockdev-2.27/tests/swap_test.py 2022-05-27 09:21:17.000000000 +0200 @@ -8,6 +8,7 @@ class SwapTest(unittest.TestCase): requested_plugins = BlockDev.plugin_specs_from_names(("swap",)) + dev_size = 1024**3 @classmethod def setUpClass(cls): @@ -19,7 +20,7 @@ class SwapTestCase(SwapTest): def setUp(self): self.addCleanup(self._clean_up) - self.dev_file = create_sparse_tempfile("swap_test", 1024**3) + self.dev_file = create_sparse_tempfile("swap_test", self.dev_size) try: self.loop_dev = create_lio_device(self.dev_file) except RuntimeError as e: @@ -110,6 +111,18 @@ with self.assertRaises(BlockDev.SwapPagesizeError): BlockDev.swap.swapon(self.loop_dev) + def test_swapon_wrong_size(self): + """Verify that activating swap with a wrong size fails with expected exception""" + + # create swap bigger than the device (twice as big in 1024 sectors) + ret, out, err = run_command("mkswap -f %s %d" % (self.loop_dev, (self.dev_size * 2) / 1024)) + if ret != 0: + self.fail("Failed to prepare swap for wrong size test: %s %s" % (out, err)) + + # activation should fail because swap is bigger than the underlying device + with self.assertRaises(BlockDev.SwapActivateError): + BlockDev.swap.swapon(self.loop_dev) + def _remove_map(self, map_name): run("dmsetup remove -f %s" % map_name) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libblockdev-2.26/tools/Makefile.in new/libblockdev-2.27/tools/Makefile.in --- old/libblockdev-2.26/tools/Makefile.in 2021-07-28 08:45:16.000000000 +0200 +++ new/libblockdev-2.27/tools/Makefile.in 2022-06-01 12:56:48.000000000 +0200 @@ -370,6 +370,7 @@ python2 = @python2@ python3 = @python3@ pythondir = @pythondir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ skip_patterns = @skip_patterns@