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-07-05 12:27:33 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libstorage-ng (Old) and /work/SRC/openSUSE:Factory/.libstorage-ng.new.1548 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libstorage-ng" Tue Jul 5 12:27:33 2022 rev:173 rq:986636 version:4.5.25 Changes: -------- --- /work/SRC/openSUSE:Factory/libstorage-ng/libstorage-ng.changes 2022-06-29 16:01:54.884667148 +0200 +++ /work/SRC/openSUSE:Factory/.libstorage-ng.new.1548/libstorage-ng.changes 2022-07-05 12:27:40.501888066 +0200 @@ -1,0 +2,9 @@ +Mon Jul 4 12:19:59 UTC 2022 - aschn...@suse.com + +- merge gh#openSUSE/libstorage-ng#886 +- removed unused class MdadmExamine +- added Pool::empty function +- use in-class member initialization +- 4.5.25 + +-------------------------------------------------------------------- Old: ---- libstorage-ng-4.5.24.tar.xz New: ---- libstorage-ng-4.5.25.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libstorage-ng.spec ++++++ --- /var/tmp/diff_new_pack.rTXlW9/_old 2022-07-05 12:27:40.965888745 +0200 +++ /var/tmp/diff_new_pack.rTXlW9/_new 2022-07-05 12:27:40.973888757 +0200 @@ -18,7 +18,7 @@ %define libname %{name}1 Name: libstorage-ng -Version: 4.5.24 +Version: 4.5.25 Release: 0 Summary: Library for storage management License: GPL-2.0-only ++++++ libstorage-ng-4.5.24.tar.xz -> libstorage-ng-4.5.25.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.24/LIBVERSION new/libstorage-ng-4.5.25/LIBVERSION --- old/libstorage-ng-4.5.24/LIBVERSION 2022-06-28 13:45:53.000000000 +0200 +++ new/libstorage-ng-4.5.25/LIBVERSION 2022-07-04 14:19:59.000000000 +0200 @@ -1 +1 @@ -1.78.0 +1.79.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.24/VERSION new/libstorage-ng-4.5.25/VERSION --- old/libstorage-ng-4.5.24/VERSION 2022-06-28 13:45:53.000000000 +0200 +++ new/libstorage-ng-4.5.25/VERSION 2022-07-04 14:19:59.000000000 +0200 @@ -1 +1 @@ -4.5.24 +4.5.25 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.24/examples/SystemInfo/.gitignore new/libstorage-ng-4.5.25/examples/SystemInfo/.gitignore --- old/libstorage-ng-4.5.24/examples/SystemInfo/.gitignore 2022-06-28 13:45:53.000000000 +0200 +++ new/libstorage-ng-4.5.25/examples/SystemInfo/.gitignore 2022-07-04 14:19:59.000000000 +0200 @@ -25,7 +25,6 @@ test-lsattr test-lsscsi test-mdadm-detail -test-mdadm-examine test-mdlinks test-multipath test-parted diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.24/examples/SystemInfo/Makefile.am new/libstorage-ng-4.5.25/examples/SystemInfo/Makefile.am --- old/libstorage-ng-4.5.24/examples/SystemInfo/Makefile.am 2022-06-28 13:45:53.000000000 +0200 +++ new/libstorage-ng-4.5.25/examples/SystemInfo/Makefile.am 2022-07-04 14:19:59.000000000 +0200 @@ -11,7 +11,7 @@ test-cmd-vgs test-cmd-udevadm-info test-dasdview test-dir test-dmraid \ test-cmd-dumpe2fs test-cmd-resize2fs test-cmd-ntfsresize \ test-lsattr test-lsscsi \ - test-mdadm-detail test-mdadm-examine test-mdlinks test-multipath \ + test-mdadm-detail test-mdlinks test-multipath \ test-parted test-cmd-stat test-cmd-blockdev \ test-proc-mdstat test-proc-mounts test-cmd-df \ test-cmd-btrfs-subvolume-list test-cmd-btrfs-subvolume-get-default \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.24/examples/SystemInfo/test-mdadm-examine.cc new/libstorage-ng-4.5.25/examples/SystemInfo/test-mdadm-examine.cc --- old/libstorage-ng-4.5.24/examples/SystemInfo/test-mdadm-examine.cc 2022-06-28 13:45:53.000000000 +0200 +++ new/libstorage-ng-4.5.25/examples/SystemInfo/test-mdadm-examine.cc 1970-01-01 01:00:00.000000000 +0100 @@ -1,34 +0,0 @@ - -#include <iostream> - -#include <storage/SystemInfo/SystemInfoImpl.h> - -using namespace std; -using namespace storage; - - -void -test_mdadm_examine(SystemInfo::Impl& system_info, const vector<string>& devices) -{ - try - { - const MdadmExamine& mdadm_examine = system_info.getMdadmExamine(devices); - cout << "MdadmExamine success" << endl; - cout << mdadm_examine << endl; - } - catch (const exception& e) - { - cerr << "MdadmExamine failed" << endl; - } -} - - -int -main() -{ - set_logger(get_logfile_logger()); - - SystemInfo::Impl system_info; - - test_mdadm_examine(system_info, { "/dev/sda", "/dev/sdb" }); -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.24/storage/Pool.cc new/libstorage-ng-4.5.25/storage/Pool.cc --- old/libstorage-ng-4.5.24/storage/Pool.cc 2022-06-28 13:45:53.000000000 +0200 +++ new/libstorage-ng-4.5.25/storage/Pool.cc 2022-07-04 14:19:59.000000000 +0200 @@ -1,6 +1,6 @@ /* * Copyright (c) 2020 Arvin Schnell - * Copyright (c) 2021 SUSE LLC + * Copyright (c) [2021-2022] SUSE LLC * * All Rights Reserved. * @@ -61,6 +61,13 @@ } + bool + Pool::empty(const Devicegraph* devicegraph) const + { + return get_impl().empty(devicegraph); + } + + size_t Pool::size(const Devicegraph* devicegraph) const { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.24/storage/Pool.h new/libstorage-ng-4.5.25/storage/Pool.h --- old/libstorage-ng-4.5.24/storage/Pool.h 2022-06-28 13:45:53.000000000 +0200 +++ new/libstorage-ng-4.5.25/storage/Pool.h 2022-07-04 14:19:59.000000000 +0200 @@ -1,6 +1,6 @@ /* * Copyright (c) 2020 Arvin Schnell - * Copyright (c) 2021 SUSE LLC + * Copyright (c) [2021-2022] SUSE LLC * * All Rights Reserved. * @@ -120,6 +120,12 @@ void remove_device(const Device* device); /** + * Check whether the pool has any devices in the devicegraph. It is no error if + * devices are not available in the devicegraph. + */ + bool empty(const Devicegraph* devicegraph) const; + + /** * Get the number of devices of the pool available in the devicegraph. It is no * error if devices are not available in the devicegraph. */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.24/storage/PoolImpl.cc new/libstorage-ng-4.5.25/storage/PoolImpl.cc --- old/libstorage-ng-4.5.24/storage/PoolImpl.cc 2022-06-28 13:45:53.000000000 +0200 +++ new/libstorage-ng-4.5.25/storage/PoolImpl.cc 2022-07-04 14:19:59.000000000 +0200 @@ -1,6 +1,6 @@ /* * Copyright (c) 2020 Arvin Schnell - * Copyright (c) 2021 SUSE LLC + * Copyright (c) [2021-2022] SUSE LLC * * All Rights Reserved. * @@ -68,6 +68,17 @@ } + bool + Pool::Impl::empty(const Devicegraph* devicegraph) const + { + ST_CHECK_PTR(devicegraph); + + return none_of(devices.begin(), devices.end(), [devicegraph](sid_t sid) + { return devicegraph->device_exists(sid); } + ); + } + + size_t Pool::Impl::size(const Devicegraph* devicegraph) const { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.24/storage/PoolImpl.h new/libstorage-ng-4.5.25/storage/PoolImpl.h --- old/libstorage-ng-4.5.24/storage/PoolImpl.h 2022-06-28 13:45:53.000000000 +0200 +++ new/libstorage-ng-4.5.25/storage/PoolImpl.h 2022-07-04 14:19:59.000000000 +0200 @@ -1,6 +1,6 @@ /* * Copyright (c) 2020 Arvin Schnell - * Copyright (c) 2021 SUSE LLC + * Copyright (c) [2021-2022] SUSE LLC * * All Rights Reserved. * @@ -51,6 +51,7 @@ void add_device(const Device* device); void remove_device(const Device* device); + bool empty(const Devicegraph* devicegraph) const; size_t size(const Devicegraph* devicegraph) const; vector<Device*> get_devices(Devicegraph* devicegraph) const; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.24/storage/SystemInfo/ProcMdstat.cc new/libstorage-ng-4.5.25/storage/SystemInfo/ProcMdstat.cc --- old/libstorage-ng-4.5.24/storage/SystemInfo/ProcMdstat.cc 2022-06-28 13:45:53.000000000 +0200 +++ new/libstorage-ng-4.5.25/storage/SystemInfo/ProcMdstat.cc 2022-07-04 14:19:59.000000000 +0200 @@ -411,92 +411,4 @@ return s; } - - MdadmExamine::MdadmExamine(const vector<string>& devices) - : devices(devices) - { - SystemCmd cmd(MDADM_BIN " --examine " + quote(devices) + " --brief", SystemCmd::DoThrow); - - parse(cmd.stdout()); - } - - - void - MdadmExamine::parse(const vector<string>& lines) - { - for (vector<string>::const_iterator it = lines.begin(); it != lines.end(); ++it) - { - const list<string> items = splitString(*it, " "); - if (items.front() != "ARRAY" || items.size() < 3) - { - y2err("unexpected input"); - continue; - } - - bool is_container_line = true; - for (list<string>::const_iterator it = items.begin(); it != items.end(); ++it) - { - if (boost::starts_with(*it, "container=")) - is_container_line = false; - } - - if (is_container_line) - { - for (list<string>::const_iterator it = items.begin(); it != items.end(); ++it) - { - if (boost::starts_with(*it, "metadata=")) - metadata = string(*it, 9); - else if (boost::starts_with(*it, "UUID=")) - uuid = string(*it, 5); - } - } - else - { - string device = *(++items.begin()); - if (!boost::starts_with(device, DEV_MD_DIR "/")) - { - y2err("unexpected input"); - continue; - } - - string name = string(device, 8); - - Entry entry; - for (list<string>::const_iterator it = items.begin(); it != items.end(); ++it) - { - if (boost::starts_with(*it, "member=")) - string(*it, 7) >> entry.member; - else if (boost::starts_with(*it, "UUID=")) - entry.uuid = string(*it, 5); - } - - data[name] = entry; - } - } - - y2mil(*this); - } - - - std::ostream& - operator<<(std::ostream& s, const MdadmExamine& mdadm_examine) - { - s << "devices:" << mdadm_examine.devices << " metadata:" << mdadm_examine.metadata - << " uuid:" << mdadm_examine.uuid << '\n'; - - for (const pair<const string, MdadmExamine::Entry>& entry : mdadm_examine) - s << "data[" << entry.first << "] -> " << entry.second << '\n'; - - return s; - } - - - std::ostream& - operator<<(std::ostream& s, const MdadmExamine::Entry& entry) - { - s << "member:" << entry.member << " uuid:" << entry.uuid; - - return s; - } - } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.24/storage/SystemInfo/ProcMdstat.h new/libstorage-ng-4.5.25/storage/SystemInfo/ProcMdstat.h --- old/libstorage-ng-4.5.24/storage/SystemInfo/ProcMdstat.h 2022-06-28 13:45:53.000000000 +0200 +++ new/libstorage-ng-4.5.25/storage/SystemInfo/ProcMdstat.h 2022-07-04 14:19:59.000000000 +0200 @@ -1,6 +1,6 @@ /* * Copyright (c) [2004-2014] Novell, Inc. - * Copyright (c) [2017-2020] SUSE LLC + * Copyright (c) [2017-2022] SUSE LLC * * All Rights Reserved. * @@ -62,26 +62,22 @@ struct Entry { - Entry() : md_level(MdLevel::UNKNOWN), md_parity(MdParity::DEFAULT), size(0), - chunk_size(0), read_only(false), inactive(false), is_container(false), - has_container(false) {} - - MdLevel md_level; - MdParity md_parity; + MdLevel md_level = MdLevel::UNKNOWN; + MdParity md_parity = MdParity::DEFAULT; string super; - unsigned long long size; - unsigned long chunk_size; + unsigned long long size = 0; + unsigned long long chunk_size = 0; - bool read_only; - bool inactive; + bool read_only = false; + bool inactive = false; vector<Device> devices; - bool is_container; + bool is_container = false; - bool has_container; + bool has_container = false; string container_name; string container_member; }; @@ -142,44 +138,6 @@ }; - - class MdadmExamine - { - public: - - MdadmExamine(const vector<string>& devices); - - string metadata; - string uuid; - - struct Entry - { - Entry() : member(-1) {} - - int member; - string uuid; - }; - - typedef map<string, Entry>::const_iterator const_iterator; - - const_iterator begin() const { return data.begin(); } - const_iterator end() const { return data.end(); } - - const_iterator find(const string& name) const { return data.find(name); } - - friend std::ostream& operator<<(std::ostream& s, const MdadmExamine& mdadm_examine); - friend std::ostream& operator<<(std::ostream& s, const Entry& entry); - - private: - - void parse(const vector<string>& lines); - - vector<string> devices; - - map<string, Entry> data; - - }; - } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.24/storage/SystemInfo/SystemInfoImpl.h new/libstorage-ng-4.5.25/storage/SystemInfo/SystemInfoImpl.h --- old/libstorage-ng-4.5.24/storage/SystemInfo/SystemInfoImpl.h 2022-06-28 13:45:53.000000000 +0200 +++ new/libstorage-ng-4.5.25/storage/SystemInfo/SystemInfoImpl.h 2022-07-04 14:19:59.000000000 +0200 @@ -90,7 +90,6 @@ const ProcMounts& getProcMounts() { return proc_mounts.get(); } const ProcMdstat& getProcMdstat() { return proc_mdstat.get(); } const MdadmDetail& getMdadmDetail(const string& device) { return mdadm_details.get(device); } - const MdadmExamine& getMdadmExamine(const vector<string>& devices) { return mdadm_examines.get(devices); } const Blkid& getBlkid() { return blkid.get(); } const Lsscsi& getLsscsi() { return lsscsi.get(); } const Parted& getParted(const string& device) { return parteds.get(device); } @@ -245,7 +244,6 @@ LazyObject<ProcMounts> proc_mounts; LazyObject<ProcMdstat> proc_mdstat; LazyObjects<MdadmDetail> mdadm_details; - LazyObjects<MdadmExamine, vector<string>> mdadm_examines; LazyObject<Blkid> blkid; LazyObject<Lsscsi> lsscsi; LazyObjects<Parted> parteds; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.24/testsuite/SystemInfo/Makefile.am new/libstorage-ng-4.5.25/testsuite/SystemInfo/Makefile.am --- old/libstorage-ng-4.5.24/testsuite/SystemInfo/Makefile.am 2022-06-28 13:45:53.000000000 +0200 +++ new/libstorage-ng-4.5.25/testsuite/SystemInfo/Makefile.am 2022-07-04 14:19:59.000000000 +0200 @@ -13,7 +13,7 @@ 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 \ - mdadm-detail.test mdadm-examine.test mdlinks.test \ + mdadm-detail.test mdlinks.test \ parted-34.test parted-35.test \ proc-mdstat.test proc-mounts.test pvs.test systeminfo.test \ udevadm-info.test vgs.test multipath.test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.24/testsuite/SystemInfo/mdadm-examine.cc new/libstorage-ng-4.5.25/testsuite/SystemInfo/mdadm-examine.cc --- old/libstorage-ng-4.5.24/testsuite/SystemInfo/mdadm-examine.cc 2022-06-28 13:45:53.000000000 +0200 +++ new/libstorage-ng-4.5.25/testsuite/SystemInfo/mdadm-examine.cc 1970-01-01 01:00:00.000000000 +0100 @@ -1,48 +0,0 @@ - -#define BOOST_TEST_DYN_LINK -#define BOOST_TEST_MODULE libstorage - -#include <boost/test/unit_test.hpp> -#include <boost/algorithm/string.hpp> - -#include "storage/SystemInfo/ProcMdstat.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>& devices, const vector<string>& input, const vector<string>& output) -{ - Mockup::set_mode(Mockup::Mode::PLAYBACK); - Mockup::set_command(MDADM_BIN " --examine " + quote(devices) + " --brief", input); - - MdadmExamine mdadmdetail(devices); - - ostringstream parsed; - parsed.setf(std::ios::boolalpha); - parsed << mdadmdetail; - - string lhs = parsed.str(); - string rhs = boost::join(output, "\n") + "\n"; - - BOOST_CHECK_EQUAL(lhs, rhs); -} - - -BOOST_AUTO_TEST_CASE(parse1) -{ - vector<string> input = { - "ARRAY /dev/md/0 metadata=1.0 UUID=35dd06d4:b4e9e248:9262c3ad:02b61654 name=linux:0" - }; - - vector<string> output = { - "devices:</dev/sda1 /dev/sdb1> metadata:1.0 uuid:35dd06d4:b4e9e248:9262c3ad:02b61654" - }; - - check({ "/dev/sda1", "/dev/sdb1" }, input, output); -}