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 2021-08-19 13:06:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libstorage-ng (Old) and /work/SRC/openSUSE:Factory/.libstorage-ng.new.1899 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libstorage-ng" Thu Aug 19 13:06:40 2021 rev:127 rq:912891 version:4.4.35 Changes: -------- --- /work/SRC/openSUSE:Factory/libstorage-ng/libstorage-ng.changes 2021-08-12 09:01:46.866140017 +0200 +++ /work/SRC/openSUSE:Factory/.libstorage-ng.new.1899/libstorage-ng.changes 2021-08-19 13:06:45.519974476 +0200 @@ -1,0 +2,17 @@ +Wed Aug 18 11:28:02 UTC 2021 - aschn...@suse.com + +- merge gh#openSUSE/libstorage-ng#829 +- added function BlkFilesystem::supports_tune_options() +- coding style +- 4.4.35 + +-------------------------------------------------------------------- +Mon Aug 16 07:55:24 UTC 2021 - aschn...@suse.com + +- merge gh#openSUSE/libstorage-ng#828 +- added non-const version of BlkFilesystem::get_blk_devices() +- use in-class member initialization +- coding style and documentation +- 4.4.34 + +-------------------------------------------------------------------- Old: ---- libstorage-ng-4.4.33.tar.xz New: ---- libstorage-ng-4.4.35.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libstorage-ng.spec ++++++ --- /var/tmp/diff_new_pack.BO8hnf/_old 2021-08-19 13:06:46.067973719 +0200 +++ /var/tmp/diff_new_pack.BO8hnf/_new 2021-08-19 13:06:46.071973713 +0200 @@ -18,7 +18,7 @@ %define libname %{name}1 Name: libstorage-ng -Version: 4.4.33 +Version: 4.4.35 Release: 0 Summary: Library for storage management License: GPL-2.0-only ++++++ libstorage-ng-4.4.33.tar.xz -> libstorage-ng-4.4.35.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.33/LIBVERSION new/libstorage-ng-4.4.35/LIBVERSION --- old/libstorage-ng-4.4.33/LIBVERSION 2021-08-09 08:47:35.000000000 +0200 +++ new/libstorage-ng-4.4.35/LIBVERSION 2021-08-18 13:28:02.000000000 +0200 @@ -1 +1 @@ -1.60.0 +1.61.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.33/VERSION new/libstorage-ng-4.4.35/VERSION --- old/libstorage-ng-4.4.33/VERSION 2021-08-09 08:47:35.000000000 +0200 +++ new/libstorage-ng-4.4.35/VERSION 2021-08-18 13:28:02.000000000 +0200 @@ -1 +1 @@ -4.4.33 +4.4.35 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.33/storage/Devices/MdImpl.cc new/libstorage-ng-4.4.35/storage/Devices/MdImpl.cc --- old/libstorage-ng-4.4.33/storage/Devices/MdImpl.cc 2021-08-09 08:47:35.000000000 +0200 +++ new/libstorage-ng-4.4.35/storage/Devices/MdImpl.cc 2021-08-18 13:28:02.000000000 +0200 @@ -920,7 +920,7 @@ if (exists_in_system()) return; - vector<BlkDevice*> devices = get_devices(); + vector<const BlkDevice*> devices = as_const(*this).get_devices(); long real_chunk_size = chunk_size; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.33/storage/Devices/PartitionImpl.cc new/libstorage-ng-4.4.35/storage/Devices/PartitionImpl.cc --- old/libstorage-ng-4.4.33/storage/Devices/PartitionImpl.cc 2021-08-09 08:47:35.000000000 +0200 +++ new/libstorage-ng-4.4.35/storage/Devices/PartitionImpl.cc 2021-08-18 13:28:02.000000000 +0200 @@ -916,6 +916,7 @@ break; case ID_SWAP: + // 'swap on' should work with parted 3.5 also for ms-dos if (!is_msdos(partition_table)) cmd_line += "swap on"; else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.33/storage/Filesystems/BlkFilesystem.cc new/libstorage-ng-4.4.35/storage/Filesystems/BlkFilesystem.cc --- old/libstorage-ng-4.4.33/storage/Filesystems/BlkFilesystem.cc 2021-08-09 08:47:35.000000000 +0200 +++ new/libstorage-ng-4.4.35/storage/Filesystems/BlkFilesystem.cc 2021-08-18 13:28:02.000000000 +0200 @@ -1,6 +1,6 @@ /* * Copyright (c) [2014-2015] Novell, Inc. - * Copyright (c) [2016-2017] SUSE LLC + * Copyright (c) [2016-2021] SUSE LLC * * All Rights Reserved. * @@ -131,6 +131,13 @@ } + bool + BlkFilesystem::supports_tune_options() const + { + return get_impl().supports_tune_options(); + } + + const string& BlkFilesystem::get_tune_options() const { @@ -230,6 +237,13 @@ } + vector<BlkDevice*> + BlkFilesystem::get_blk_devices() + { + return get_impl().get_blk_devices(); + } + + vector<const BlkDevice*> BlkFilesystem::get_blk_devices() const { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.33/storage/Filesystems/BlkFilesystem.h new/libstorage-ng-4.4.35/storage/Filesystems/BlkFilesystem.h --- old/libstorage-ng-4.4.33/storage/Filesystems/BlkFilesystem.h 2021-08-09 08:47:35.000000000 +0200 +++ new/libstorage-ng-4.4.35/storage/Filesystems/BlkFilesystem.h 2021-08-18 13:28:02.000000000 +0200 @@ -103,6 +103,11 @@ void set_mkfs_options(const std::string& mkfs_options); /** + * Checks whether the filesystem supports tune options. + */ + bool supports_tune_options() const; + + /** * Get extra options for the filesystem tune command. */ const std::string& get_tune_options() const; @@ -179,6 +184,14 @@ static std::vector<const BlkFilesystem*> find_by_uuid(const Devicegraph* devicegraph, const std::string& uuid); + /** + * Get underlying blk devices of the blk filesystem. + */ + std::vector<BlkDevice*> get_blk_devices(); + + /** + * @copydoc get_blk_devices() + */ std::vector<const BlkDevice*> get_blk_devices() const; public: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.33/storage/Filesystems/BlkFilesystemImpl.cc new/libstorage-ng-4.4.35/storage/Filesystems/BlkFilesystemImpl.cc --- old/libstorage-ng-4.4.33/storage/Filesystems/BlkFilesystemImpl.cc 2021-08-09 08:47:35.000000000 +0200 +++ new/libstorage-ng-4.4.35/storage/Filesystems/BlkFilesystemImpl.cc 2021-08-18 13:28:02.000000000 +0200 @@ -541,6 +541,16 @@ } + vector<BlkDevice*> + BlkFilesystem::Impl::get_blk_devices() + { + Devicegraph* devicegraph = get_devicegraph(); + Devicegraph::Impl::vertex_descriptor vertex = get_vertex(); + + return devicegraph->get_impl().filter_devices_of_type<BlkDevice>(devicegraph->get_impl().parents(vertex)); + } + + vector<const BlkDevice*> BlkFilesystem::Impl::get_blk_devices() const { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.33/storage/Filesystems/BlkFilesystemImpl.h new/libstorage-ng-4.4.35/storage/Filesystems/BlkFilesystemImpl.h --- old/libstorage-ng-4.4.33/storage/Filesystems/BlkFilesystemImpl.h 2021-08-09 08:47:35.000000000 +0200 +++ new/libstorage-ng-4.4.35/storage/Filesystems/BlkFilesystemImpl.h 2021-08-18 13:28:02.000000000 +0200 @@ -82,6 +82,8 @@ const string& get_mkfs_options() const { return mkfs_options; } void set_mkfs_options(const string& mkfs_options) { Impl::mkfs_options = mkfs_options; } + virtual bool supports_tune_options() const { return false; } + const string& get_tune_options() const { return tune_options; } void set_tune_options(const string& tune_options) { Impl::tune_options = tune_options; } @@ -95,7 +97,9 @@ static void probe_blk_filesystems(Prober& prober); virtual void probe_pass_2a(Prober& prober); + vector<BlkDevice*> get_blk_devices(); vector<const BlkDevice*> get_blk_devices() const; + const BlkDevice* get_blk_device() const; virtual void wait_for_devices() const override; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.33/storage/Filesystems/BtrfsImpl.cc new/libstorage-ng-4.4.35/storage/Filesystems/BtrfsImpl.cc --- old/libstorage-ng-4.4.33/storage/Filesystems/BtrfsImpl.cc 2021-08-09 08:47:35.000000000 +0200 +++ new/libstorage-ng-4.4.35/storage/Filesystems/BtrfsImpl.cc 2021-08-18 13:28:02.000000000 +0200 @@ -1000,7 +1000,7 @@ cmd_line += " " + get_mkfs_options(); // sort is required for testsuite - vector<const BlkDevice*> blk_devices = get_blk_devices(); + vector<const BlkDevice*> blk_devices = std::as_const(*this).get_blk_devices(); sort(blk_devices.begin(), blk_devices.end(), BlkDevice::compare_by_name); for (const BlkDevice* blk_device : blk_devices) cmd_line += " " + quote(blk_device->get_name()); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.33/storage/Filesystems/ExtImpl.h new/libstorage-ng-4.4.35/storage/Filesystems/ExtImpl.h --- old/libstorage-ng-4.4.33/storage/Filesystems/ExtImpl.h 2021-08-09 08:47:35.000000000 +0200 +++ new/libstorage-ng-4.4.35/storage/Filesystems/ExtImpl.h 2021-08-18 13:28:02.000000000 +0200 @@ -43,6 +43,8 @@ public: + virtual bool supports_tune_options() const override { return true; } + virtual bool supports_mounted_shrink() const override { return false; } virtual bool supports_mounted_grow() const override { return true; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.33/storage/Filesystems/ReiserfsImpl.h new/libstorage-ng-4.4.35/storage/Filesystems/ReiserfsImpl.h --- old/libstorage-ng-4.4.33/storage/Filesystems/ReiserfsImpl.h 2021-08-09 08:47:35.000000000 +0200 +++ new/libstorage-ng-4.4.35/storage/Filesystems/ReiserfsImpl.h 2021-08-18 13:28:02.000000000 +0200 @@ -46,6 +46,8 @@ virtual unsigned long long min_size() const override { return 64 * MiB; } virtual unsigned long long max_size() const override { return 16 * TiB; } + virtual bool supports_tune_options() const override { return true; } + virtual bool supports_mounted_shrink() const override { return false; } virtual bool supports_mounted_grow() const override { return true; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.33/storage/PoolImpl.cc new/libstorage-ng-4.4.35/storage/PoolImpl.cc --- old/libstorage-ng-4.4.33/storage/PoolImpl.cc 2021-08-09 08:47:35.000000000 +0200 +++ new/libstorage-ng-4.4.35/storage/PoolImpl.cc 2021-08-18 13:28:02.000000000 +0200 @@ -130,6 +130,10 @@ partitionables.push_back(partitionable); } + // sort_by_key is stable so first sort by name to get nice and predictable results + + sort(partitionables.begin(), partitionables.end(), Partitionable::compare_by_name); + std::function<unsigned long long(Partitionable*)> key_fnc = [](const Partitionable* partitionable) { const PartitionTable* partition_table = partitionable->get_partition_table(); @@ -249,6 +253,9 @@ if (candidates.size() < number) ST_THROW(PoolOutOfSpace()); + // somehow reversing the candidates gives the "natural" order in the actiongraph + std::reverse(candidates.begin(), candidates.end()); + // TODO exceptions thrown below can result in only some partitions created vector<Partition*> partitions; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.33/storage/SystemInfo/CmdParted.cc new/libstorage-ng-4.4.35/storage/SystemInfo/CmdParted.cc --- old/libstorage-ng-4.4.33/storage/SystemInfo/CmdParted.cc 2021-08-09 08:47:35.000000000 +0200 +++ new/libstorage-ng-4.4.35/storage/SystemInfo/CmdParted.cc 2021-08-18 13:28:02.000000000 +0200 @@ -41,9 +41,7 @@ Parted::Parted(const string& device) - : device(device), label(PtType::UNKNOWN), region(), primary_slots(-1), implicit(false), - gpt_undersized(false), gpt_backup_broken(false), gpt_pmbr_boot(false), - logical_sector_size(0), physical_sector_size(0) + : device(device) { SystemCmd::Options options(PARTED_BIN " --script --machine " + quote(device) + " unit s print", SystemCmd::DoThrow); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.33/storage/SystemInfo/CmdParted.h new/libstorage-ng-4.4.35/storage/SystemInfo/CmdParted.h --- old/libstorage-ng-4.4.33/storage/SystemInfo/CmdParted.h 2021-08-09 08:47:35.000000000 +0200 +++ new/libstorage-ng-4.4.35/storage/SystemInfo/CmdParted.h 2021-08-18 13:28:02.000000000 +0200 @@ -55,16 +55,26 @@ */ struct Entry { - Entry() : number(0), type(PartitionType::PRIMARY), id(0), boot(false), - legacy_boot(false), name() {} + /** Partition number (1..n) */ + unsigned int number = 0; - unsigned int number; // Partition number (1..n) - Region region; // Partition region in sectors - PartitionType type; // primary / extended / logical - unsigned int id; // Numeric partition ID (Linux: 0x83 etc.) - bool boot; // Boot flag of the partition (only MSDOS) - bool legacy_boot; // Legacy boot flag of the partition (only GPT) - string name; // Partition name (only GPT) + /** Partition region in sectors */ + Region region; + + /** Partition type (primary, extended or logical) */ + PartitionType type = PartitionType::PRIMARY; + + /** Numeric partition ID (Linux = 0x83 etc.) */ + unsigned int id = 0; + + /** Boot flag of the partition (only MS-DOS) */ + bool boot = false; + + /** Legacy boot flag of the partition (only GPT) */ + bool legacy_boot = false; + + /** Partition name (only GPT) */ + string name; }; friend std::ostream& operator<<(std::ostream& s, const Parted& parted); @@ -88,9 +98,8 @@ int get_primary_slots() const { return primary_slots; } /** - * S/390 arch: zFCP DASDs create implicit partitions if there is none - * on that disk yet. This function returns if this is the case for - * this device. + * S/390 arch: zFCP DASDs create implicit partitions if there is none on that disk + * yet. This function returns true if this is the case for this device. */ bool is_implicit() const { return implicit; } @@ -127,19 +136,19 @@ typedef vector<Entry>::const_iterator const_iterator; - string device; - PtType label; + const string device; + PtType label = PtType::UNKNOWN; Region region; - int primary_slots; - bool implicit; - bool gpt_undersized; - bool gpt_backup_broken; - bool gpt_pmbr_boot; + int primary_slots = -1; + bool implicit = false; + bool gpt_undersized = false; + bool gpt_backup_broken = false; + bool gpt_pmbr_boot = false; vector<Entry> entries; vector<string> stderr; - int logical_sector_size; - int physical_sector_size; + int logical_sector_size = 0; + int physical_sector_size = 0; /** * Parse the output of the 'parted' command in 'lines'. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.33/storage/Utils/Logger.cc new/libstorage-ng-4.4.35/storage/Utils/Logger.cc --- old/libstorage-ng-4.4.33/storage/Utils/Logger.cc 2021-08-09 08:47:35.000000000 +0200 +++ new/libstorage-ng-4.4.35/storage/Utils/Logger.cc 2021-08-18 13:28:02.000000000 +0200 @@ -57,7 +57,7 @@ bool - Logger::test(LogLevel log_level, const std::string& component) + Logger::test(LogLevel log_level, const string& component) { return log_level != LogLevel::DEBUG; } @@ -65,17 +65,18 @@ class StdoutLogger : public Logger { + public: - virtual void write(LogLevel log_level, const std::string& component, const std::string& file, - int line, const std::string& function, const std::string& content) override; + virtual void write(LogLevel log_level, const string& component, const string& file, + int line, const string& function, const string& content) override; }; void - StdoutLogger::write(LogLevel log_level, const std::string& component, const std::string& file, - int line, const std::string& function, const std::string& content) + StdoutLogger::write(LogLevel log_level, const string& component, const string& file, + int line, const string& function, const string& content) { std::cout << datetime(time(nullptr)) << " <" << static_cast<log_level_underlying_type>(log_level) << "> [" << component << "] " << file << "(" << function << "):" << line << " " @@ -94,33 +95,34 @@ class LogfileLogger : public Logger { + public: - LogfileLogger(const std::string& filename, int permissions = DEFAULT_PERMISSIONS); - virtual void write(LogLevel log_level, const std::string& component, const std::string& file, - int line, const std::string& function, const std::string& content) override; + LogfileLogger(const string& filename, int permissions = DEFAULT_PERMISSIONS); + + virtual void write(LogLevel log_level, const string& component, const string& file, + int line, const string& function, const string& content) override; private: // log file should not be world-readable static const int DEFAULT_PERMISSIONS = 0640; - const std::string filename; + const string filename; const int permissions; }; - LogfileLogger::LogfileLogger(const string& filename, int permissions) : - filename(filename), - permissions(permissions) + LogfileLogger::LogfileLogger(const string& filename, int permissions) + : filename(filename), permissions(permissions) { } void - LogfileLogger::write(LogLevel log_level, const std::string& component, const std::string& file, - int line, const std::string& function, const std::string& content) + LogfileLogger::write(LogLevel log_level, const string& component, const string& file, + int line, const string& function, const string& content) { int fd = open(filename.c_str(), O_WRONLY | O_APPEND | O_CREAT | O_CLOEXEC, permissions); @@ -141,7 +143,7 @@ Logger* - get_logfile_logger(const std::string& filename) + get_logfile_logger(const string& filename) { static LogfileLogger logfile_logger(filename);