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-10-12 21:48:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libstorage-ng (Old)
 and      /work/SRC/openSUSE:Factory/.libstorage-ng.new.2443 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libstorage-ng"

Tue Oct 12 21:48:39 2021 rev:132 rq:924646 version:4.4.44

Changes:
--------
--- /work/SRC/openSUSE:Factory/libstorage-ng/libstorage-ng.changes      
2021-10-08 22:05:21.540590797 +0200
+++ /work/SRC/openSUSE:Factory/.libstorage-ng.new.2443/libstorage-ng.changes    
2021-10-12 21:49:57.487923669 +0200
@@ -1,0 +2,8 @@
+Mon Oct 11 09:52:49 UTC 2021 - aschn...@suse.com
+
+- merge gh#openSUSE/libstorage-ng#836
+- added non-const versions of several existing functions
+- added detect_remove_info()
+- 4.4.44
+
+--------------------------------------------------------------------

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

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

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

Other differences:
------------------
++++++ libstorage-ng.spec ++++++
--- /var/tmp/diff_new_pack.ZyEL8T/_old  2021-10-12 21:49:58.019924430 +0200
+++ /var/tmp/diff_new_pack.ZyEL8T/_new  2021-10-12 21:49:58.019924430 +0200
@@ -18,7 +18,7 @@
 
 %define libname %{name}1
 Name:           libstorage-ng
-Version:        4.4.43
+Version:        4.4.44
 Release:        0
 Summary:        Library for storage management
 License:        GPL-2.0-only

++++++ libstorage-ng-4.4.43.tar.xz -> libstorage-ng-4.4.44.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.4.43/LIBVERSION 
new/libstorage-ng-4.4.44/LIBVERSION
--- old/libstorage-ng-4.4.43/LIBVERSION 2021-10-07 12:08:08.000000000 +0200
+++ new/libstorage-ng-4.4.44/LIBVERSION 2021-10-11 11:52:49.000000000 +0200
@@ -1 +1 @@
-1.64.0
+1.65.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.4.43/VERSION 
new/libstorage-ng-4.4.44/VERSION
--- old/libstorage-ng-4.4.43/VERSION    2021-10-07 12:08:08.000000000 +0200
+++ new/libstorage-ng-4.4.44/VERSION    2021-10-11 11:52:49.000000000 +0200
@@ -1 +1 @@
-4.4.43
+4.4.44
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.4.43/bindings/storage-catches.i 
new/libstorage-ng-4.4.44/bindings/storage-catches.i
--- old/libstorage-ng-4.4.43/bindings/storage-catches.i 2021-10-07 
12:08:08.000000000 +0200
+++ new/libstorage-ng-4.4.44/bindings/storage-catches.i 2021-10-11 
11:52:49.000000000 +0200
@@ -223,10 +223,10 @@
 %catches(storage::LogicException, storage::Exception) 
storage::Bcache::remove_bcache_cset();
 %catches(storage::DeviceNotFound, storage::DeviceHasWrongType) 
storage::BcacheCset::find_by_uuid(Devicegraph *devicegraph, const std::string 
&uuid);
 %catches(storage::DeviceNotFound, storage::DeviceHasWrongType) 
storage::BcacheCset::find_by_uuid(const Devicegraph *devicegraph, const 
std::string &uuid);
-%catches(storage::Exception) storage::BlkDevice::can_be_removed() const;
 %catches(storage::WrongNumberOfChildren) 
storage::BlkDevice::create_bcache_cset();
 %catches(storage::WrongNumberOfChildren, storage::UnsupportedException) 
storage::BlkDevice::create_blk_filesystem(FsType fs_type);
 %catches(storage::WrongNumberOfChildren, storage::UnsupportedException) 
storage::BlkDevice::create_filesystem(FsType fs_type);
+%catches(storage::Exception) storage::BlkDevice::detect_remove_info() const;
 %catches(storage::Exception) storage::BlkDevice::exists_by_any_name(const 
Devicegraph *devicegraph, const std::string &name, SystemInfo &system_info);
 %catches(storage::DeviceNotFoundByName, storage::DeviceHasWrongType, 
storage::Exception) storage::BlkDevice::find_by_any_name(Devicegraph 
*devicegraph, const std::string &name);
 %catches(storage::DeviceNotFoundByName, storage::DeviceHasWrongType, 
storage::Exception) storage::BlkDevice::find_by_any_name(Devicegraph 
*devicegraph, const std::string &name, SystemInfo &system_info);
@@ -354,7 +354,9 @@
 %catches(storage::DeviceNotFound, storage::DeviceHasWrongType) 
storage::Nfs::find_by_server_and_path(const Devicegraph *devicegraph, const 
std::string &server, const std::string &path);
 %catches(storage::DeviceNotFound, storage::DeviceHasWrongType) 
storage::Partition::find_by_name(Devicegraph *devicegraph, const std::string 
&name);
 %catches(storage::DeviceNotFound, storage::DeviceHasWrongType) 
storage::Partition::find_by_name(const Devicegraph *devicegraph, const 
std::string &name);
+%catches(storage::WrongNumberOfChildren, storage::DeviceHasWrongType) 
storage::Partition::get_partition_table();
 %catches(storage::WrongNumberOfChildren, storage::DeviceHasWrongType) 
storage::Partition::get_partition_table() const;
+%catches(storage::WrongNumberOfChildren, storage::DeviceHasWrongType) 
storage::Partition::get_partitionable();
 %catches(storage::WrongNumberOfChildren, storage::DeviceHasWrongType) 
storage::Partition::get_partitionable() const;
 %catches(storage::Exception) 
storage::Partition::get_unused_surrounding_region() const;
 %catches(storage::Exception) storage::Partition::set_boot(bool boot);
@@ -365,6 +367,7 @@
 %catches(storage::DifferentBlockSizes) 
storage::PartitionTable::create_partition(const std::string &name, const Region 
&region, PartitionType type);
 %catches(storage::Exception) storage::PartitionTable::get_extended() const;
 %catches(storage::Exception) storage::PartitionTable::get_partition(const 
std::string &name);
+%catches(storage::Exception) storage::PartitionTable::get_partitionable();
 %catches(storage::Exception) storage::PartitionTable::get_partitionable() 
const;
 %catches(storage::Exception) 
storage::PartitionTable::get_unused_partition_slots(AlignPolicy 
align_policy=AlignPolicy::ALIGN_START_KEEP_END, AlignType 
align_type=AlignType::OPTIMAL) const;
 %catches(storage::WrongNumberOfChildren, storage::UnsupportedException, 
storage::Exception) storage::Partitionable::create_partition_table(PtType 
pt_type);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.4.43/storage/Devices/BlkDevice.cc 
new/libstorage-ng-4.4.44/storage/Devices/BlkDevice.cc
--- old/libstorage-ng-4.4.43/storage/Devices/BlkDevice.cc       2021-10-07 
12:08:08.000000000 +0200
+++ new/libstorage-ng-4.4.44/storage/Devices/BlkDevice.cc       2021-10-11 
11:52:49.000000000 +0200
@@ -113,10 +113,10 @@
     }
 
 
-    bool
-    BlkDevice::can_be_removed() const
+    RemoveInfo
+    BlkDevice::detect_remove_info() const
     {
-       return get_impl().can_be_removed();
+       return get_impl().detect_remove_info();
     }
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.4.43/storage/Devices/BlkDevice.h 
new/libstorage-ng-4.4.44/storage/Devices/BlkDevice.h
--- old/libstorage-ng-4.4.43/storage/Devices/BlkDevice.h        2021-10-07 
12:08:08.000000000 +0200
+++ new/libstorage-ng-4.4.44/storage/Devices/BlkDevice.h        2021-10-11 
11:52:49.000000000 +0200
@@ -41,6 +41,7 @@
     enum class EncryptionType;
     class Bcache;
     class BcacheCset;
+    class RemoveInfo;
 
 
     //! An abstract Block Device.
@@ -141,9 +142,11 @@
         * Check whether the device can be removed. E.g. disks and DASDs cannot 
be
         * removed.
         *
+        * @see RemoveInfo
+        *
         * @throw Exception
         */
-       bool can_be_removed() const;
+       RemoveInfo detect_remove_info() const;
 
        /**
         * Return device-mapper table name (dm-table-name for short). Empty if
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.4.43/storage/Devices/BlkDeviceImpl.h 
new/libstorage-ng-4.4.44/storage/Devices/BlkDeviceImpl.h
--- old/libstorage-ng-4.4.43/storage/Devices/BlkDeviceImpl.h    2021-10-07 
12:08:08.000000000 +0200
+++ new/libstorage-ng-4.4.44/storage/Devices/BlkDeviceImpl.h    2021-10-11 
11:52:49.000000000 +0200
@@ -29,6 +29,7 @@
 #include "storage/Utils/Topology.h"
 #include "storage/Devices/BlkDevice.h"
 #include "storage/Devices/DeviceImpl.h"
+#include "storage/FreeInfo.h"
 
 
 namespace storage
@@ -62,7 +63,7 @@
 
        virtual bool is_usable_as_blk_device() const { return active; }
 
-       virtual bool can_be_removed() const { return true; }
+       virtual RemoveInfo detect_remove_info() const { return RemoveInfo(true, 
0); }
 
        const string& get_name() const { return name; }
        void set_name(const string& name);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.4.43/storage/Devices/DasdImpl.h 
new/libstorage-ng-4.4.44/storage/Devices/DasdImpl.h
--- old/libstorage-ng-4.4.43/storage/Devices/DasdImpl.h 2021-10-07 
12:08:08.000000000 +0200
+++ new/libstorage-ng-4.4.44/storage/Devices/DasdImpl.h 2021-10-11 
11:52:49.000000000 +0200
@@ -66,7 +66,7 @@
 
        virtual void check(const CheckCallbacks* check_callbacks) const 
override;
 
-       virtual bool can_be_removed() const override { return false; }
+       virtual RemoveInfo detect_remove_info() const override { return 
RemoveInfo(false, RMB_HARDWARE); }
 
        string get_bus_id() const { return bus_id; }
        void set_bus_id(string bus_id) { Impl::bus_id = bus_id; }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.4.43/storage/Devices/Device.h 
new/libstorage-ng-4.4.44/storage/Devices/Device.h
--- old/libstorage-ng-4.4.43/storage/Devices/Device.h   2021-10-07 
12:08:08.000000000 +0200
+++ new/libstorage-ng-4.4.44/storage/Devices/Device.h   2021-10-11 
11:52:49.000000000 +0200
@@ -136,6 +136,8 @@
         *
         * If the device holds an NTFS it must not be mounted.
         *
+        * @see ResizeInfo
+        *
         * @throw Exception
         */
        ResizeInfo detect_resize_info() const;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.4.43/storage/Devices/DeviceImpl.cc 
new/libstorage-ng-4.4.44/storage/Devices/DeviceImpl.cc
--- old/libstorage-ng-4.4.43/storage/Devices/DeviceImpl.cc      2021-10-07 
12:08:08.000000000 +0200
+++ new/libstorage-ng-4.4.44/storage/Devices/DeviceImpl.cc      2021-10-11 
11:52:49.000000000 +0200
@@ -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.
  *
@@ -25,6 +25,7 @@
 #include "storage/Devices/BlkDevice.h"
 #include "storage/Devicegraph.h"
 #include "storage/Action.h"
+#include "storage/Filesystems/MountPoint.h"
 #include "storage/Utils/XmlFile.h"
 #include "storage/Utils/StorageTmpl.h"
 #include "storage/FreeInfo.h"
@@ -244,6 +245,22 @@
     }
 
 
+    bool
+    Device::Impl::has_any_active_descendants() const
+    {
+       for (const Device* descendant : get_non_impl()->get_descendants(false))
+       {
+           if (is_mount_point(descendant) && 
to_mount_point(descendant)->is_active())
+               return true;
+
+           if (is_blk_device(descendant) && 
to_blk_device(descendant)->is_active())
+               return true;
+       }
+
+       return false;
+    }
+
+
     void
     Device::Impl::has_new_parent()
     {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.4.43/storage/Devices/DeviceImpl.h 
new/libstorage-ng-4.4.44/storage/Devices/DeviceImpl.h
--- old/libstorage-ng-4.4.43/storage/Devices/DeviceImpl.h       2021-10-07 
12:08:08.000000000 +0200
+++ new/libstorage-ng-4.4.44/storage/Devices/DeviceImpl.h       2021-10-11 
11:52:49.000000000 +0200
@@ -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.
  *
@@ -136,6 +136,8 @@
 
        void remove_descendants(View view = View::CLASSIC);
 
+       bool has_any_active_descendants() const;
+
        const map<string, string>& get_userdata() const { return userdata; }
        void set_userdata(const map<string, string>& userdata) { Impl::userdata 
= userdata; }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.4.43/storage/Devices/DiskImpl.h 
new/libstorage-ng-4.4.44/storage/Devices/DiskImpl.h
--- old/libstorage-ng-4.4.43/storage/Devices/DiskImpl.h 2021-10-07 
12:08:08.000000000 +0200
+++ new/libstorage-ng-4.4.44/storage/Devices/DiskImpl.h 2021-10-11 
11:52:49.000000000 +0200
@@ -70,7 +70,7 @@
 
        virtual ResizeInfo detect_resize_info(const BlkDevice* blk_device = 
nullptr) const override;
 
-       virtual bool can_be_removed() const override { return false; }
+       virtual RemoveInfo detect_remove_info() const override { return 
RemoveInfo(false, RMB_HARDWARE); }
 
        bool is_rotational() const { return rotational; }
        void set_rotational(bool rotational) { Impl::rotational = rotational; }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.4.43/storage/Devices/MultipathImpl.h 
new/libstorage-ng-4.4.44/storage/Devices/MultipathImpl.h
--- old/libstorage-ng-4.4.43/storage/Devices/MultipathImpl.h    2021-10-07 
12:08:08.000000000 +0200
+++ new/libstorage-ng-4.4.44/storage/Devices/MultipathImpl.h    2021-10-11 
11:52:49.000000000 +0200
@@ -65,7 +65,7 @@
 
        virtual void check(const CheckCallbacks* check_callbacks) const 
override;
 
-       virtual bool can_be_removed() const override { return false; }
+       virtual RemoveInfo detect_remove_info() const override { return 
RemoveInfo(false, RMB_HARDWARE); }
 
        static bool is_valid_name(const string& name);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.4.43/storage/Devices/Partition.cc 
new/libstorage-ng-4.4.44/storage/Devices/Partition.cc
--- old/libstorage-ng-4.4.43/storage/Devices/Partition.cc       2021-10-07 
12:08:08.000000000 +0200
+++ new/libstorage-ng-4.4.44/storage/Devices/Partition.cc       2021-10-11 
11:52:49.000000000 +0200
@@ -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.
  *
@@ -174,6 +174,13 @@
     }
 
 
+    PartitionTable*
+    Partition::get_partition_table()
+    {
+       return get_impl().get_partition_table();
+    }
+
+
     const PartitionTable*
     Partition::get_partition_table() const
     {
@@ -181,6 +188,13 @@
     }
 
 
+    Partitionable*
+    Partition::get_partitionable()
+    {
+       return get_impl().get_partitionable();
+    }
+
+
     const Partitionable*
     Partition::get_partitionable() const
     {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.4.43/storage/Devices/Partition.h 
new/libstorage-ng-4.4.44/storage/Devices/Partition.h
--- old/libstorage-ng-4.4.43/storage/Devices/Partition.h        2021-10-07 
12:08:08.000000000 +0200
+++ new/libstorage-ng-4.4.44/storage/Devices/Partition.h        2021-10-11 
11:52:49.000000000 +0200
@@ -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.
  *
@@ -246,6 +246,11 @@
         *
         * @throw WrongNumberOfChildren, DeviceHasWrongType
         */
+       PartitionTable* get_partition_table();
+
+       /**
+        * @copydoc get_partition_table()
+        */
        const PartitionTable* get_partition_table() const;
 
        /**
@@ -253,6 +258,11 @@
         *
         * @throw WrongNumberOfChildren, DeviceHasWrongType
         */
+       Partitionable* get_partitionable();
+
+       /**
+        * @copydoc get_partitionable()
+        */
        const Partitionable* get_partitionable() const;
 
        /**
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.4.43/storage/Devices/PartitionImpl.cc 
new/libstorage-ng-4.4.44/storage/Devices/PartitionImpl.cc
--- old/libstorage-ng-4.4.43/storage/Devices/PartitionImpl.cc   2021-10-07 
12:08:08.000000000 +0200
+++ new/libstorage-ng-4.4.44/storage/Devices/PartitionImpl.cc   2021-10-11 
11:52:49.000000000 +0200
@@ -36,6 +36,7 @@
 #include "storage/Devices/ImplicitPt.h"
 #include "storage/Devices/DiskImpl.h"
 #include "storage/Filesystems/FilesystemImpl.h"
+#include "storage/Filesystems/MountPoint.h"
 #include "storage/Devicegraph.h"
 #include "storage/SystemInfo/SystemInfoImpl.h"
 #include "storage/Storage.h"
@@ -293,6 +294,15 @@
     }
 
 
+    Partitionable*
+    Partition::Impl::get_partitionable()
+    {
+       PartitionTable* partition_table = get_partition_table();
+
+       return partition_table->get_partitionable();
+    }
+
+
     const Partitionable*
     Partition::Impl::get_partitionable() const
     {
@@ -616,6 +626,35 @@
     }
 
 
+    RemoveInfo
+    Partition::Impl::detect_remove_info() const
+    {
+       const PartitionTable* partition_table = get_partition_table();
+
+       if ((is_msdos(partition_table) && get_type() == PartitionType::LOGICAL) 
||
+           (is_dasd(partition_table)))
+       {
+           for (const Partition* partition : partition_table->get_partitions())
+           {
+               if (partition->get_number() <= get_number())
+                   continue;
+
+               if (partition->get_impl().has_any_active_descendants())
+               {
+                   return RemoveInfo(false, RMB_RENUMBER_ACTIVE_PARTITIONS);
+               }
+           }
+       }
+
+       if (is_implicit_pt(partition_table))
+       {
+           return RemoveInfo(false, RMB_ON_IMPLICIT_PARTITION_TABLE);
+       }
+
+       return RemoveInfo(true, 0);
+    }
+
+
     Region
     Partition::Impl::get_unused_surrounding_region() const
     {
@@ -906,7 +945,8 @@
            to_string(get_number()) + " ";
 
        // Note: The 'type' option is not available in upstream parted 
(2021-07-26).
-       // 'swap' is not available for MS-DOS in parted (2021-07-26).
+       // 'swap' is not available for MS-DOS in parted (2021-07-26). 'swap' 
for DASD is
+       // SUSE specific (2021-10-07).
 
        switch (get_id())
        {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.4.43/storage/Devices/PartitionImpl.h 
new/libstorage-ng-4.4.44/storage/Devices/PartitionImpl.h
--- old/libstorage-ng-4.4.43/storage/Devices/PartitionImpl.h    2021-10-07 
12:08:08.000000000 +0200
+++ new/libstorage-ng-4.4.44/storage/Devices/PartitionImpl.h    2021-10-11 
11:52:49.000000000 +0200
@@ -107,11 +107,14 @@
 
        virtual ResizeInfo detect_resize_info(const BlkDevice* blk_device = 
nullptr) const override;
 
+       virtual RemoveInfo detect_remove_info() const override;
+
        Region get_unused_surrounding_region() const;
 
        PartitionTable* get_partition_table();
        const PartitionTable* get_partition_table() const;
 
+       Partitionable* get_partitionable();
        const Partitionable* get_partitionable() const;
 
        virtual void add_create_actions(Actiongraph::Impl& actiongraph) const 
override;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.4.43/storage/Devices/PartitionTable.cc 
new/libstorage-ng-4.4.44/storage/Devices/PartitionTable.cc
--- old/libstorage-ng-4.4.43/storage/Devices/PartitionTable.cc  2021-10-07 
12:08:08.000000000 +0200
+++ new/libstorage-ng-4.4.44/storage/Devices/PartitionTable.cc  2021-10-11 
11:52:49.000000000 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) [2015-2017] SUSE LLC
+ * Copyright (c) [2015-2021] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -212,6 +212,13 @@
     }
 
 
+    Partitionable*
+    PartitionTable::get_partitionable()
+    {
+       return get_impl().get_partitionable();
+    }
+
+
     const Partitionable*
     PartitionTable::get_partitionable() const
     {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.4.43/storage/Devices/PartitionTable.h 
new/libstorage-ng-4.4.44/storage/Devices/PartitionTable.h
--- old/libstorage-ng-4.4.43/storage/Devices/PartitionTable.h   2021-10-07 
12:08:08.000000000 +0200
+++ new/libstorage-ng-4.4.44/storage/Devices/PartitionTable.h   2021-10-11 
11:52:49.000000000 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) [2015-2018] SUSE LLC
+ * Copyright (c) [2015-2021] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -161,8 +161,15 @@
        const Partition* get_extended() const;
 
        /**
+        * Return the partitionable of the partition table.
+        *
         * @throw Exception
         */
+       Partitionable* get_partitionable();
+
+       /**
+        * @copydoc get_partitionable()
+        */
        const Partitionable* get_partitionable() const;
 
        Alignment get_alignment(AlignType align_type = AlignType::OPTIMAL) 
const;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.4.43/storage/Devices/StrayBlkDeviceImpl.h 
new/libstorage-ng-4.4.44/storage/Devices/StrayBlkDeviceImpl.h
--- old/libstorage-ng-4.4.43/storage/Devices/StrayBlkDeviceImpl.h       
2021-10-07 12:08:08.000000000 +0200
+++ new/libstorage-ng-4.4.44/storage/Devices/StrayBlkDeviceImpl.h       
2021-10-11 11:52:49.000000000 +0200
@@ -61,7 +61,7 @@
 
        virtual ResizeInfo detect_resize_info(const BlkDevice* blk_device = 
nullptr) const override;
 
-       virtual bool can_be_removed() const override { return false; }
+       virtual RemoveInfo detect_remove_info() const override { return 
RemoveInfo(false, RMB_HARDWARE); }
 
        static void probe_stray_blk_devices(Prober& prober);
        virtual void probe_pass_1a(Prober& prober) override;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.4.43/storage/FreeInfo.cc 
new/libstorage-ng-4.4.44/storage/FreeInfo.cc
--- old/libstorage-ng-4.4.43/storage/FreeInfo.cc        2021-10-07 
12:08:08.000000000 +0200
+++ new/libstorage-ng-4.4.44/storage/FreeInfo.cc        2021-10-11 
11:52:49.000000000 +0200
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) [2004-2010] Novell, Inc.
- * Copyright (c) [2016-2018] SUSE LLC
+ * Copyright (c) [2016-2021] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -158,6 +158,19 @@
     }
 
 
+    RemoveInfo::RemoveInfo(bool remove_ok, uint32_t reasons)
+       : remove_ok(remove_ok), reasons(reasons)
+    {
+    }
+
+
+    std::ostream&
+    operator<<(std::ostream& out, const RemoveInfo& remove_info)
+    {
+       return out << "remove-ok:" << remove_info.remove_ok << " reasons:" << 
remove_info.reasons;
+    }
+
+
     ContentInfo::ContentInfo(bool is_windows, bool is_efi, unsigned num_homes)
        : is_windows(is_windows), is_efi(is_efi), num_homes(num_homes)
     {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.4.43/storage/FreeInfo.h 
new/libstorage-ng-4.4.44/storage/FreeInfo.h
--- old/libstorage-ng-4.4.43/storage/FreeInfo.h 2021-10-07 12:08:08.000000000 
+0200
+++ new/libstorage-ng-4.4.44/storage/FreeInfo.h 2021-10-11 11:52:49.000000000 
+0200
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) [2004-2010] Novell, Inc.
- * Copyright (c) [2016-2020] SUSE LLC
+ * Copyright (c) [2016-2021] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -247,6 +247,54 @@
 
     };
 
+
+    /**
+     * Remove blockers.
+     *
+     * Some remove operations are not supported (e.g. remove a disk or DASD). 
Some are not
+     * supported by the library (e.g. remove a partition if that causes 
renumbering of
+     * active partition).
+     *
+     * Be careful: Temporarily deactivating e.g. a mount point with the aim of 
getting rid
+     * of the blocker will result in failures later on.
+     */
+    enum : uint32_t
+    {
+
+       /**
+        * The device corresponds to hardware, e.g. a disk or DASD.
+        */
+       RMB_HARDWARE = 1 << 0,
+
+       /**
+        * Removing the partition would result in renumbering of partitions 
with active
+        * stuff on them.
+        */
+       RMB_RENUMBER_ACTIVE_PARTITIONS = 1 << 1,
+
+       /**
+        * Partition on an implicit partition table cannot be removed - at 
least not
+        * without creating a partition table.
+        */
+       RMB_ON_IMPLICIT_PARTITION_TABLE = 1 << 2,
+
+    };
+
+
+    class RemoveInfo
+    {
+    public:
+
+       RemoveInfo(bool remove_ok, uint32_t reasons);
+
+       bool remove_ok;
+
+       uint32_t reasons;
+
+       friend std::ostream& operator<<(std::ostream& out, const RemoveInfo& 
remove_info);
+
+    };
+
 
     class ContentInfo
     {

Reply via email to