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-02-26 21:58:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libstorage-ng (Old)
 and      /work/SRC/openSUSE:Factory/.libstorage-ng.new.2378 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libstorage-ng"

Fri Feb 26 21:58:56 2021 rev:108 rq:875380 version:4.3.89

Changes:
--------
--- /work/SRC/openSUSE:Factory/libstorage-ng/libstorage-ng.changes      
2021-02-01 14:41:48.720677107 +0100
+++ /work/SRC/openSUSE:Factory/.libstorage-ng.new.2378/libstorage-ng.changes    
2021-02-26 21:59:06.119802407 +0100
@@ -1,0 +2,23 @@
+Fri Feb 26 12:26:46 UTC 2021 - aschn...@suse.com
+
+- merge gh#openSUSE/libstorage-ng#799
+- added CI based on Leap since Tumbleweed is currently broken
+- 4.3.89
+
+--------------------------------------------------------------------
+Thu Feb 4 08:33:12 UTC 2021 - aschn...@suse.com
+
+- merge gh#openSUSE/libstorage-ng#798
+- handle logical partitions in Pool::create_partitions
+- 4.3.88
+
+--------------------------------------------------------------------
+Mon Feb 1 10:56:10 UTC 2021 - aschn...@suse.com
+
+- merge gh#openSUSE/libstorage-ng#797
+- added function to calculate size of underlying devices of MD RAID
+- added unit tests
+- updated documentation
+- 4.3.87
+
+--------------------------------------------------------------------

Old:
----
  libstorage-ng-4.3.86.tar.xz

New:
----
  libstorage-ng-4.3.89.tar.xz

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

Other differences:
------------------
++++++ libstorage-ng.spec ++++++
--- /var/tmp/diff_new_pack.pHAKLB/_old  2021-02-26 21:59:06.667802888 +0100
+++ /var/tmp/diff_new_pack.pHAKLB/_new  2021-02-26 21:59:06.671802891 +0100
@@ -18,7 +18,7 @@
 
 %define libname %{name}1
 Name:           libstorage-ng
-Version:        4.3.86
+Version:        4.3.89
 Release:        0
 Summary:        Library for storage management
 License:        GPL-2.0-only

++++++ libstorage-ng-4.3.86.tar.xz -> libstorage-ng-4.3.89.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.3.86/.github/workflows/ci-leap.yml 
new/libstorage-ng-4.3.89/.github/workflows/ci-leap.yml
--- old/libstorage-ng-4.3.86/.github/workflows/ci-leap.yml      1970-01-01 
01:00:00.000000000 +0100
+++ new/libstorage-ng-4.3.89/.github/workflows/ci-leap.yml      2021-02-26 
13:26:46.000000000 +0100
@@ -0,0 +1,34 @@
+name: CI Leap
+
+on: [push, pull_request]
+
+jobs:
+  Tests:
+    runs-on: ubuntu-latest
+    container: opensuse/leap
+
+    steps:
+
+    - name: Install additional packages
+      run: zypper --non-interactive in --no-recommends autoconf automake 
doxygen gcc-c++ gettext-runtime glibc-locale graphviz libboost_headers-devel 
libboost_test-devel libjson-c-devel libtool libxml2-devel make python3-devel 
ruby-devel swig xz
+
+    - name: List installed packages
+      run: rpm -qa | sort
+
+    - name: Git checkout
+      uses: actions/checkout@v1
+
+    - name: Configure
+      run: make -f Makefile.repo
+
+    - name: Compile
+      run: make -j 2
+
+    - name: Install
+      run: make install
+
+    - name: Run unit tests
+      run: make -j 2 check VERBOSE=1
+
+    - name: Make package
+      run: make package
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.3.86/.github/workflows/ci-tumbleweed.yml 
new/libstorage-ng-4.3.89/.github/workflows/ci-tumbleweed.yml
--- old/libstorage-ng-4.3.86/.github/workflows/ci-tumbleweed.yml        
2021-01-29 14:36:24.000000000 +0100
+++ new/libstorage-ng-4.3.89/.github/workflows/ci-tumbleweed.yml        
2021-02-26 13:26:46.000000000 +0100
@@ -10,7 +10,7 @@
     steps:
 
     - name: Install additional packages
-      run: zypper --non-interactive in --no-recommends autoconf automake 
doxygen gcc-c++ gettext-runtime glibc-locale graphviz libboost_headers-devel 
libboost_test-devel libjson-c-devel libtool libxml2-devel make python3-devel 
ruby-devel swig
+      run: zypper --non-interactive in --no-recommends autoconf automake 
doxygen gcc-c++ gettext-runtime glibc-locale graphviz libboost_headers-devel 
libboost_test-devel libjson-c-devel libtool libxml2-devel make python3-devel 
ruby-devel swig xz
 
     - name: List installed packages
       run: rpm -qa | sort
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.3.86/VERSION 
new/libstorage-ng-4.3.89/VERSION
--- old/libstorage-ng-4.3.86/VERSION    2021-01-29 14:36:24.000000000 +0100
+++ new/libstorage-ng-4.3.89/VERSION    2021-02-26 13:26:46.000000000 +0100
@@ -1 +1 @@
-4.3.86
+4.3.89
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.3.86/po/README 
new/libstorage-ng-4.3.89/po/README
--- old/libstorage-ng-4.3.86/po/README  2021-01-29 14:36:24.000000000 +0100
+++ new/libstorage-ng-4.3.89/po/README  2021-02-26 13:26:46.000000000 +0100
@@ -1,6 +1,6 @@
 
-After adding or modifying messages run 'make merge' and commit the pot and po
-files.
+After adding or modifying messages run 'make libstorage-ng.pot' and
+'make merge' and commit the pot and po files.
 
 Translations themself are done in Weblate.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.3.86/storage/Devices/Md.cc 
new/libstorage-ng-4.3.89/storage/Devices/Md.cc
--- old/libstorage-ng-4.3.86/storage/Devices/Md.cc      2021-01-29 
14:36:24.000000000 +0100
+++ new/libstorage-ng-4.3.89/storage/Devices/Md.cc      2021-02-26 
13:26:46.000000000 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) [2016-2018] SUSE LLC
+ * Copyright (c) [2016-2021] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -296,6 +296,13 @@
     }
 
 
+    unsigned long long
+    Md::calculate_underlying_size(MdLevel md_level, unsigned int 
number_of_devices, unsigned long long size)
+    {
+       return Md::Impl::calculate_underlying_size(md_level, number_of_devices, 
size);
+    }
+
+
     bool
     Md::compare_by_number(const Md* lhs, const Md* rhs)
     {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.3.86/storage/Devices/Md.h 
new/libstorage-ng-4.3.89/storage/Devices/Md.h
--- old/libstorage-ng-4.3.86/storage/Devices/Md.h       2021-01-29 
14:36:24.000000000 +0100
+++ new/libstorage-ng-4.3.89/storage/Devices/Md.h       2021-02-26 
13:26:46.000000000 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) [2016-2020] SUSE LLC
+ * Copyright (c) [2016-2021] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -268,6 +268,18 @@
        static std::string find_free_numeric_name(const Devicegraph* 
devicegraph);
 
        /**
+        * Calculate the required size of the underlying block devices to get 
an MD of the
+        * desired size.
+        *
+        * Calculation is not accurate. Does not consider details like 
alignment, chunk
+        * size, bitmap location or metadata version.
+        *
+        * @throw Exception
+        */
+       static unsigned long long calculate_underlying_size(MdLevel md_level, 
unsigned int number_of_devices,
+                                                           unsigned long long 
size);
+
+       /**
         * Compare (less than) two Mds by number.
         *
         * @see get_number()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.3.86/storage/Devices/MdImpl.cc 
new/libstorage-ng-4.3.89/storage/Devices/MdImpl.cc
--- old/libstorage-ng-4.3.86/storage/Devices/MdImpl.cc  2021-01-29 
14:36:24.000000000 +0100
+++ new/libstorage-ng-4.3.89/storage/Devices/MdImpl.cc  2021-02-26 
13:26:46.000000000 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) [2014-2015] Novell, Inc.
- * Copyright (c) [2016-2020] SUSE LLC
+ * Copyright (c) [2016-2021] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -163,6 +163,48 @@
     }
 
 
+    unsigned long long
+    Md::Impl::calculate_underlying_size(MdLevel md_level, unsigned int 
number_of_devices, unsigned long long size)
+    {
+       if (number_of_devices < minimal_number_of_devices(md_level))
+           ST_THROW(Exception("too few devices"));
+
+       unsigned long long underlying_size = 0;
+
+       switch (md_level)
+       {
+           case MdLevel::RAID0:
+               underlying_size = size / number_of_devices;
+               break;
+
+           case MdLevel::RAID1:
+               underlying_size = size;
+               break;
+
+           case MdLevel::RAID4:
+           case MdLevel::RAID5:
+               underlying_size = size / (number_of_devices - 1);
+               break;
+
+           case MdLevel::RAID6:
+               underlying_size = size / (number_of_devices - 2);
+               break;
+
+           case MdLevel::RAID10:
+               underlying_size = size * 2 / number_of_devices;
+               break;
+
+           default:
+               ST_THROW(Exception("illegal raid level"));
+       }
+
+       // see calculate_region_and_topology
+       underlying_size += min(128 * MiB, underlying_size / 64);
+
+       return underlying_size;
+    }
+
+
     void
     Md::Impl::check(const CheckCallbacks* check_callbacks) const
     {
@@ -759,7 +801,7 @@
 
 
     unsigned int
-    Md::Impl::minimal_number_of_devices() const
+    Md::Impl::minimal_number_of_devices(MdLevel md_level)
     {
        switch (md_level)
        {
@@ -785,6 +827,13 @@
     }
 
 
+    unsigned int
+    Md::Impl::minimal_number_of_devices() const
+    {
+       return minimal_number_of_devices(md_level);
+    }
+
+
     bool
     Md::Impl::supports_spare_devices() const
     {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.3.86/storage/Devices/MdImpl.h 
new/libstorage-ng-4.3.89/storage/Devices/MdImpl.h
--- old/libstorage-ng-4.3.86/storage/Devices/MdImpl.h   2021-01-29 
14:36:24.000000000 +0100
+++ new/libstorage-ng-4.3.89/storage/Devices/MdImpl.h   2021-02-26 
13:26:46.000000000 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) [2014-2015] Novell, Inc.
- * Copyright (c) [2016-2019] SUSE LLC
+ * Copyright (c) [2016-2021] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -101,6 +101,8 @@
        const string& get_metadata() const { return metadata; }
        void set_metadata(const string& metadata) { Impl::metadata = metadata; }
 
+       static unsigned int minimal_number_of_devices(MdLevel md_level);
+
        unsigned int minimal_number_of_devices() const;
        bool supports_spare_devices() const;
        bool supports_journal_device() const;
@@ -118,6 +120,9 @@
 
        static string find_free_numeric_name(const Devicegraph* devicegraph);
 
+       static unsigned long long calculate_underlying_size(MdLevel md_level, 
unsigned int number_of_devices,
+                                                           unsigned long long 
size);
+
        static bool activate_mds(const ActivateCallbacks* activate_callbacks, 
const TmpDir& tmp_dir);
 
        static bool deactivate_mds();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.3.86/storage/PoolImpl.cc 
new/libstorage-ng-4.3.89/storage/PoolImpl.cc
--- old/libstorage-ng-4.3.86/storage/PoolImpl.cc        2021-01-29 
14:36:24.000000000 +0100
+++ new/libstorage-ng-4.3.89/storage/PoolImpl.cc        2021-02-26 
13:26:46.000000000 +0100
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2020 Arvin Schnell
+ * Copyright (c) 2021 SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -193,6 +194,7 @@
            PartitionTable* partition_table;
            string name;
            Region region;
+           PartitionType type;
        };
 
        // For each partitionable find the smallest unused region that is still 
big
@@ -226,7 +228,8 @@
            if (best == partition_slots.end())
                continue;
 
-           Candidate candidate { partition_table, best->name, best->region };
+           Candidate candidate { partition_table, best->name, best->region,
+               best->primary_possible ? PartitionType::PRIMARY : 
PartitionType::LOGICAL };
            candidates.push_back(candidate);
 
            if (candidates.size() == number)
@@ -251,7 +254,7 @@
            region = candidate.partition_table->align(region);
 
            Partition* partition = 
candidate.partition_table->create_partition(candidate.name, region,
-                                                                              
PartitionType::PRIMARY);
+                                                                              
candidate.type);
 
            partitions.push_back(partition);
        }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.3.86/testsuite/Devices/Makefile.am 
new/libstorage-ng-4.3.89/testsuite/Devices/Makefile.am
--- old/libstorage-ng-4.3.86/testsuite/Devices/Makefile.am      2021-01-29 
14:36:24.000000000 +0100
+++ new/libstorage-ng-4.3.89/testsuite/Devices/Makefile.am      2021-02-26 
13:26:46.000000000 +0100
@@ -7,7 +7,7 @@
 LDADD = ../../storage/libstorage-ng.la -lboost_unit_test_framework
 
 check_PROGRAMS =                                                               
\
-       lvm-vg.test
+       lvm-vg.test md-underlying-size.test
 
 AM_DEFAULT_SOURCE_EXT = .cc
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.3.86/testsuite/Devices/md-underlying-size.cc 
new/libstorage-ng-4.3.89/testsuite/Devices/md-underlying-size.cc
--- old/libstorage-ng-4.3.86/testsuite/Devices/md-underlying-size.cc    
1970-01-01 01:00:00.000000000 +0100
+++ new/libstorage-ng-4.3.89/testsuite/Devices/md-underlying-size.cc    
2021-02-26 13:26:46.000000000 +0100
@@ -0,0 +1,34 @@
+
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_MODULE libstorage
+
+#include <boost/test/unit_test.hpp>
+
+#include "storage/Utils/HumanString.h"
+#include "storage/Devices/Md.h"
+
+
+using namespace std;
+using namespace storage;
+
+
+BOOST_AUTO_TEST_CASE(test1)
+{
+    BOOST_CHECK_CLOSE(Md::calculate_underlying_size(MdLevel::RAID0, 4, 1 * 
TiB), 1.0 * TiB / 4 + 128.0 * MiB, 0.1);
+    BOOST_CHECK_CLOSE(Md::calculate_underlying_size(MdLevel::RAID1, 2, 1 * 
TiB), 1.0 * TiB + 128.0 * MiB, 0.1);
+    BOOST_CHECK_CLOSE(Md::calculate_underlying_size(MdLevel::RAID5, 4, 1 * 
TiB), 1.0 * TiB / 3 + 128.0 * MiB, 0.1);
+    BOOST_CHECK_CLOSE(Md::calculate_underlying_size(MdLevel::RAID6, 4, 1 * 
TiB), 1.0 * TiB / 2 + 128.0 * MiB, 0.1);
+    BOOST_CHECK_CLOSE(Md::calculate_underlying_size(MdLevel::RAID10, 4, 1 * 
TiB), 1.0 * TiB / 2 + 128.0 * MiB, 0.1);
+}
+
+
+BOOST_AUTO_TEST_CASE(test2)
+{
+    BOOST_CHECK_EXCEPTION(Md::calculate_underlying_size(MdLevel::UNKNOWN, 2, 1 
* TiB), Exception,
+       [](const Exception& e) { return e.what() == "illegal raid level"s; }
+    );
+
+    BOOST_CHECK_EXCEPTION(Md::calculate_underlying_size(MdLevel::RAID5, 2, 1 * 
TiB), Exception,
+       [](const Exception& e) { return e.what() == "too few devices"s; }
+    );
+}

Reply via email to