Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libstorage-ng for openSUSE:Factory checked in at 2022-12-07 17:34:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libstorage-ng (Old) and /work/SRC/openSUSE:Factory/.libstorage-ng.new.1835 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libstorage-ng" Wed Dec 7 17:34:08 2022 rev:190 rq:1040906 version:4.5.56 Changes: -------- --- /work/SRC/openSUSE:Factory/libstorage-ng/libstorage-ng.changes 2022-12-04 14:58:27.496306184 +0100 +++ /work/SRC/openSUSE:Factory/.libstorage-ng.new.1835/libstorage-ng.changes 2022-12-07 17:34:52.504509585 +0100 @@ -1,0 +2,14 @@ +Wed Dec 7 09:44:34 UTC 2022 - aschn...@suse.com + +- merge gh#openSUSE/libstorage-ng#907 +- handle changed output from 'btrfs qgroup show' (bsc#1206090) +- 4.5.56 + +-------------------------------------------------------------------- +Mon Dec 5 12:18:33 UTC 2022 - aschn...@suse.com + +- merge gh#openSUSE/libstorage-ng#906 +- use RAII +- 4.5.55 + +-------------------------------------------------------------------- Old: ---- libstorage-ng-4.5.54.tar.xz New: ---- libstorage-ng-4.5.56.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libstorage-ng.spec ++++++ --- /var/tmp/diff_new_pack.UqVLsp/_old 2022-12-07 17:34:55.212524413 +0100 +++ /var/tmp/diff_new_pack.UqVLsp/_new 2022-12-07 17:34:55.228524500 +0100 @@ -18,7 +18,7 @@ %define libname %{name}1 Name: libstorage-ng -Version: 4.5.54 +Version: 4.5.56 Release: 0 Summary: Library for storage management License: GPL-2.0-only ++++++ libstorage-ng-4.5.54.tar.xz -> libstorage-ng-4.5.56.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.54/LIBVERSION new/libstorage-ng-4.5.56/LIBVERSION --- old/libstorage-ng-4.5.54/LIBVERSION 2022-12-03 13:13:49.000000000 +0100 +++ new/libstorage-ng-4.5.56/LIBVERSION 2022-12-07 10:44:34.000000000 +0100 @@ -1 +1 @@ -1.82.0 +1.82.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.54/VERSION new/libstorage-ng-4.5.56/VERSION --- old/libstorage-ng-4.5.54/VERSION 2022-12-03 13:13:49.000000000 +0100 +++ new/libstorage-ng-4.5.56/VERSION 2022-12-07 10:44:34.000000000 +0100 @@ -1 +1 @@ -4.5.54 +4.5.56 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.54/storage/SystemInfo/CmdBtrfs.cc new/libstorage-ng-4.5.56/storage/SystemInfo/CmdBtrfs.cc --- old/libstorage-ng-4.5.54/storage/SystemInfo/CmdBtrfs.cc 2022-12-03 13:13:49.000000000 +0100 +++ new/libstorage-ng-4.5.56/storage/SystemInfo/CmdBtrfs.cc 2022-12-07 10:44:34.000000000 +0100 @@ -1,6 +1,6 @@ /* * Copyright (c) [2004-2015] Novell, Inc. - * Copyright (c) [2017-2020] SUSE LLC + * Copyright (c) [2017-2022] SUSE LLC * * All Rights Reserved. * @@ -317,7 +317,6 @@ CmdBtrfsSubvolumeGetDefault::CmdBtrfsSubvolumeGetDefault(const key_t& key, const string& mount_point) - : id(BtrfsSubvolume::Impl::unknown_id) { SystemCmd::Options cmd_options(BTRFS_BIN " subvolume get-default " + quote(mount_point), SystemCmd::DoThrow); @@ -359,7 +358,6 @@ CmdBtrfsFilesystemDf::CmdBtrfsFilesystemDf(const key_t& key, const string& mount_point) - : metadata_raid_level(BtrfsRaidLevel::UNKNOWN), data_raid_level(BtrfsRaidLevel::UNKNOWN) { SystemCmd::Options cmd_options(BTRFS_BIN " filesystem df " + quote(mount_point), SystemCmd::DoThrow); @@ -425,7 +423,7 @@ SystemCmd::Options cmd_options(BTRFS_BIN " qgroup show -rep --raw " + quote(mount_point), SystemCmd::DoThrow); - cmd_options.mockup_key = BTRFS_BIN " qgroup show -repc --raw (device:" + key + ")"; + cmd_options.mockup_key = BTRFS_BIN " qgroup show -rep --raw (device:" + key + ")"; cmd_options.verify = [](int exit_code) { return exit_code == 0 || exit_code == 1; }; SystemCmd cmd(cmd_options); @@ -440,15 +438,19 @@ void CmdBtrfsQgroupShow::parse(const vector<string>& lines) { + // Output changed slightly between btrfsprogs 6.0.0 and 6.0.2. Handle both. + for (const string& line : lines) { + const string line_trimmed = boost::trim_copy(line); + vector<string> columns; - boost::split(columns, line, boost::is_any_of("\t "), boost::token_compress_on); + boost::split(columns, line_trimmed, boost::is_any_of("\t "), boost::token_compress_on); - if (columns.size() != 7) + if (columns.size() < 6) ST_THROW(Exception("failed to parse qgroup output")); - if (columns[0] == "qgroupid" || columns[0] == "--------") + if (columns[0] == "qgroupid" || columns[0] == "Qgroupid" || columns[0] == "--------") continue; Entry entry; @@ -472,7 +474,7 @@ entry.exclusive_limit = tmp; } - if (columns[5] != "---") + if (columns[5] != "---" && columns[5] != "-") { vector<string> tmp; boost::split(tmp, columns[5], boost::is_any_of(","), boost::token_compress_on); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.54/storage/SystemInfo/CmdBtrfs.h new/libstorage-ng-4.5.56/storage/SystemInfo/CmdBtrfs.h --- old/libstorage-ng-4.5.54/storage/SystemInfo/CmdBtrfs.h 2022-12-03 13:13:49.000000000 +0100 +++ new/libstorage-ng-4.5.56/storage/SystemInfo/CmdBtrfs.h 2022-12-07 10:44:34.000000000 +0100 @@ -1,6 +1,6 @@ /* * Copyright (c) [2004-2015] Novell, Inc. - * Copyright (c) [2017-2021] SUSE LLC + * Copyright (c) [2017-2022] SUSE LLC * * All Rights Reserved. * @@ -199,7 +199,7 @@ void parse(const vector<string>& lines); - long id; + long id = BtrfsSubvolume::Impl::unknown_id; }; @@ -226,8 +226,8 @@ void parse(const vector<string>& lines); - BtrfsRaidLevel metadata_raid_level; - BtrfsRaidLevel data_raid_level; + BtrfsRaidLevel metadata_raid_level = BtrfsRaidLevel::UNKNOWN; + BtrfsRaidLevel data_raid_level = BtrfsRaidLevel::UNKNOWN; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.54/storage/Utils/JsonFile.cc new/libstorage-ng-4.5.56/storage/Utils/JsonFile.cc --- old/libstorage-ng-4.5.54/storage/Utils/JsonFile.cc 2022-12-03 13:13:49.000000000 +0100 +++ new/libstorage-ng-4.5.56/storage/Utils/JsonFile.cc 2022-12-07 10:44:34.000000000 +0100 @@ -83,29 +83,25 @@ } if (fclose(fp) != 0) - { ST_THROW(Exception(sformat("close for json file '%s' failed", filename))); - } - json_tokener* tokener = json_tokener_new(); + std::unique_ptr<json_tokener, std::function<void(json_tokener*)>> tokener( + json_tokener_new(), [](json_tokener* p) { json_tokener_free(p); } + ); - root = json_tokener_parse_ex(tokener, data.data(), st.st_size); + root = json_tokener_parse_ex(tokener.get(), data.data(), st.st_size); - if (json_tokener_get_error(tokener) != json_tokener_success) + if (json_tokener_get_error(tokener.get()) != json_tokener_success) { - json_tokener_free(tokener); json_object_put(root); ST_THROW(Exception(sformat("parsing json file '%s' failed", filename))); } if (tokener->char_offset != st.st_size) { - json_tokener_free(tokener); json_object_put(root); ST_THROW(Exception(sformat("excessive content in json file '%s'", filename))); } - - json_tokener_free(tokener); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.54/testsuite/SystemInfo/Makefile.am new/libstorage-ng-4.5.56/testsuite/SystemInfo/Makefile.am --- old/libstorage-ng-4.5.54/testsuite/SystemInfo/Makefile.am 2022-12-03 13:13:49.000000000 +0100 +++ new/libstorage-ng-4.5.56/testsuite/SystemInfo/Makefile.am 2022-12-07 10:44:34.000000000 +0100 @@ -9,7 +9,7 @@ check_PROGRAMS = \ blkid.test btrfs-filesystem-df.test btrfs-filesystem-show.test \ btrfs-subvolume-get-default.test btrfs-subvolume-list.test \ - btrfs-subvolume-show.test cryptsetup-status.test \ + btrfs-subvolume-show.test btrfs-qgroup-show.test cryptsetup-status.test \ cryptsetup-bitlk-dump.test cryptsetup-luks-dump.test dasdview.test \ dir.test dmraid.test dumpe2fs.test resize2fs.test ntfsresize.test \ dmsetup-info.test dmsetup-table.test lsattr.test lsscsi.test lvs.test \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.54/testsuite/SystemInfo/btrfs-qgroup-show.cc new/libstorage-ng-4.5.56/testsuite/SystemInfo/btrfs-qgroup-show.cc --- old/libstorage-ng-4.5.54/testsuite/SystemInfo/btrfs-qgroup-show.cc 1970-01-01 01:00:00.000000000 +0100 +++ new/libstorage-ng-4.5.56/testsuite/SystemInfo/btrfs-qgroup-show.cc 2022-12-07 10:44:34.000000000 +0100 @@ -0,0 +1,85 @@ + +#define BOOST_TEST_DYN_LINK +#define BOOST_TEST_MODULE libstorage + +#include <numeric> +#include <boost/test/unit_test.hpp> + +#include "storage/SystemInfo/CmdBtrfs.h" +#include "storage/Utils/Mockup.h" +#include "storage/Utils/SystemCmd.h" +#include "storage/Utils/StorageDefines.h" + + +using namespace std; +using namespace storage; + + +void +check(const vector<string>& input, const vector<string>& output) +{ + Mockup::set_mode(Mockup::Mode::PLAYBACK); + Mockup::set_command(BTRFS_BIN " qgroup show -rep --raw (device:/dev/system/btrfs)", input); + + CmdBtrfsQgroupShow cmd_btrfs_qgroup_show( + CmdBtrfsQgroupShow::key_t("/dev/system/btrfs"), "/btrfs" + ); + + ostringstream parsed; + parsed.setf(std::ios::boolalpha); + parsed << cmd_btrfs_qgroup_show; + + string lhs = parsed.str(); + string rhs = accumulate(output.begin(), output.end(), ""s, + [](auto a, auto b) { return a + b + "\n"; }); + + BOOST_CHECK_EQUAL(lhs, rhs); +} + + +BOOST_AUTO_TEST_CASE(parse_btrfsprogs_6_0_0) +{ + vector<string> input = { + "qgroupid rfer excl max_rfer max_excl parent ", + "-------- ---- ---- -------- -------- ------ ", + "0/5 16384 16384 none none --- ", + "0/256 16384 16384 none none 1/0 ", + "0/257 16384 16384 none none --- ", + "1/0 32768 32768 none 2147483648 --- ", + "2/0 0 0 1073741824 none --- " + }; + + vector<string> output = { + "id:0/5 referenced:16384 exclusive:16384", + "id:0/256 referenced:16384 exclusive:16384 parents:1/0", + "id:0/257 referenced:16384 exclusive:16384", + "id:1/0 referenced:32768 exclusive:32768 exclusive-limit:2147483648", + "id:2/0 referenced:0 exclusive:0 referenced-limit:1073741824" + }; + + check(input, output); +} + + +BOOST_AUTO_TEST_CASE(parse_btrfsprogs_6_0_2) +{ + vector<string> input = { + "Qgroupid Referenced Exclusive Max referenced Max exclusive Parent Path ", + "-------- ---------- --------- -------------- ------------- ------ ---- ", + "0/5 16384 16384 none none - <toplevel>", + "0/256 16384 16384 none none 1/0 a", + "0/257 16384 16384 none none - b", + "1/0 32768 32768 none 2147483648 - <0 member qgroups>", + "2/0 0 0 1073741824 none - <0 member qgroups>" + }; + + vector<string> output = { + "id:0/5 referenced:16384 exclusive:16384", + "id:0/256 referenced:16384 exclusive:16384 parents:1/0", + "id:0/257 referenced:16384 exclusive:16384", + "id:1/0 referenced:32768 exclusive:32768 exclusive-limit:2147483648", + "id:2/0 referenced:0 exclusive:0 referenced-limit:1073741824" + }; + + check(input, output); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.54/testsuite/probe/ambiguous1-mockup.xml new/libstorage-ng-4.5.56/testsuite/probe/ambiguous1-mockup.xml --- old/libstorage-ng-4.5.54/testsuite/probe/ambiguous1-mockup.xml 2022-12-03 13:13:49.000000000 +0100 +++ new/libstorage-ng-4.5.56/testsuite/probe/ambiguous1-mockup.xml 2022-12-07 10:44:34.000000000 +0100 @@ -18,7 +18,7 @@ <stdout>GlobalReserve, single: total=3.25MiB, used=0.00B</stdout> </Command> <Command> - <name>/sbin/btrfs qgroup show -repc --raw (device:/dev/sdc)</name> + <name>/sbin/btrfs qgroup show -rep --raw (device:/dev/sdc)</name> <stderr>ERROR: can't list qgroups: quotas not enabled</stderr> <exit-code>1</exit-code> </Command> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.54/testsuite/probe/btrfs1-mockup.xml new/libstorage-ng-4.5.56/testsuite/probe/btrfs1-mockup.xml --- old/libstorage-ng-4.5.54/testsuite/probe/btrfs1-mockup.xml 2022-12-03 13:13:49.000000000 +0100 +++ new/libstorage-ng-4.5.56/testsuite/probe/btrfs1-mockup.xml 2022-12-07 10:44:34.000000000 +0100 @@ -41,12 +41,12 @@ <stdout></stdout> </Command> <Command> - <name>/sbin/btrfs qgroup show -repc --raw (device:/dev/sda2)</name> + <name>/sbin/btrfs qgroup show -rep --raw (device:/dev/sda2)</name> <stderr>ERROR: can't list qgroups: quotas not enabled</stderr> <exit-code>1</exit-code> </Command> <Command> - <name>/sbin/btrfs qgroup show -repc --raw (device:/dev/sda3)</name> + <name>/sbin/btrfs qgroup show -rep --raw (device:/dev/sda3)</name> <stderr>ERROR: can't list qgroups: quotas not enabled</stderr> <exit-code>1</exit-code> </Command> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.54/testsuite/probe/btrfs2-mockup.xml new/libstorage-ng-4.5.56/testsuite/probe/btrfs2-mockup.xml --- old/libstorage-ng-4.5.54/testsuite/probe/btrfs2-mockup.xml 2022-12-03 13:13:49.000000000 +0100 +++ new/libstorage-ng-4.5.56/testsuite/probe/btrfs2-mockup.xml 2022-12-07 10:44:34.000000000 +0100 @@ -39,7 +39,7 @@ <stdout></stdout> </Command> <Command> - <name>/sbin/btrfs qgroup show -repc --raw (device:/dev/sdb1)</name> + <name>/sbin/btrfs qgroup show -rep --raw (device:/dev/sdb1)</name> <stderr>ERROR: can't list qgroups: quotas not enabled</stderr> <exit-code>1</exit-code> </Command> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.54/testsuite/probe/btrfs3-mockup.xml new/libstorage-ng-4.5.56/testsuite/probe/btrfs3-mockup.xml --- old/libstorage-ng-4.5.54/testsuite/probe/btrfs3-mockup.xml 2022-12-03 13:13:49.000000000 +0100 +++ new/libstorage-ng-4.5.56/testsuite/probe/btrfs3-mockup.xml 2022-12-07 10:44:34.000000000 +0100 @@ -24,7 +24,7 @@ <stdout></stdout> </Command> <Command> - <name>/sbin/btrfs qgroup show -repc --raw (device:/dev/sdc1)</name> + <name>/sbin/btrfs qgroup show -rep --raw (device:/dev/sdc1)</name> <stderr>ERROR: can't list qgroups: quotas not enabled</stderr> <exit-code>1</exit-code> </Command> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.54/testsuite/probe/btrfs4-mockup.xml new/libstorage-ng-4.5.56/testsuite/probe/btrfs4-mockup.xml --- old/libstorage-ng-4.5.54/testsuite/probe/btrfs4-mockup.xml 2022-12-03 13:13:49.000000000 +0100 +++ new/libstorage-ng-4.5.56/testsuite/probe/btrfs4-mockup.xml 2022-12-07 10:44:34.000000000 +0100 @@ -25,7 +25,7 @@ <stdout></stdout> </Command> <Command> - <name>/sbin/btrfs qgroup show -repc --raw (device:/dev/sdd1)</name> + <name>/sbin/btrfs qgroup show -rep --raw (device:/dev/sdd1)</name> <stderr>ERROR: can't list qgroups: quotas not enabled</stderr> <exit-code>1</exit-code> </Command> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.54/testsuite/probe/btrfs5-mockup.xml new/libstorage-ng-4.5.56/testsuite/probe/btrfs5-mockup.xml --- old/libstorage-ng-4.5.54/testsuite/probe/btrfs5-mockup.xml 2022-12-03 13:13:49.000000000 +0100 +++ new/libstorage-ng-4.5.56/testsuite/probe/btrfs5-mockup.xml 2022-12-07 10:44:34.000000000 +0100 @@ -25,7 +25,7 @@ <stdout></stdout> </Command> <Command> - <name>/sbin/btrfs qgroup show -repc --raw (device:/dev/sdb1)</name> + <name>/sbin/btrfs qgroup show -rep --raw (device:/dev/sdb1)</name> <stdout>qgroupid rfer excl max_rfer max_excl parent </stdout> <stdout>-------- ---- ---- -------- -------- ------ </stdout> <stdout>0/5 16384 16384 none none --- </stdout> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.54/testsuite/probe/integrity-mockup.xml new/libstorage-ng-4.5.56/testsuite/probe/integrity-mockup.xml --- old/libstorage-ng-4.5.54/testsuite/probe/integrity-mockup.xml 2022-12-03 13:13:49.000000000 +0100 +++ new/libstorage-ng-4.5.56/testsuite/probe/integrity-mockup.xml 2022-12-07 10:44:34.000000000 +0100 @@ -48,7 +48,7 @@ <stdout></stdout> </Command> <Command> - <name>/sbin/btrfs qgroup show -repc --raw (device:/dev/mapper/crypto)</name> + <name>/sbin/btrfs qgroup show -rep --raw (device:/dev/mapper/crypto)</name> <stderr>ERROR: can't list qgroups: quotas not enabled</stderr> <exit-code>1</exit-code> </Command>