Hello community,

here is the log from the commit of package libstorage-ng for openSUSE:Factory 
checked in at 2019-04-18 09:55:23
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libstorage-ng (Old)
 and      /work/SRC/openSUSE:Factory/.libstorage-ng.new.17052 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libstorage-ng"

Thu Apr 18 09:55:23 2019 rev:51 rq:695110 version:4.1.110

Changes:
--------
--- /work/SRC/openSUSE:Factory/libstorage-ng/libstorage-ng.changes      
2019-04-15 11:51:15.702512368 +0200
+++ /work/SRC/openSUSE:Factory/.libstorage-ng.new.17052/libstorage-ng.changes   
2019-04-18 09:55:26.265304040 +0200
@@ -1,0 +2,24 @@
+Wed Apr 17 10:43:28 UTC 2019 - [email protected]
+
+- merge gh#openSUSE/libstorage-ng#637
+- extended documentation
+- changed wording
+- 4.1.110
+
+--------------------------------------------------------------------
+Tue Apr 16 16:42:44 UTC 2019 - [email protected]
+
+- merge gh#openSUSE/libstorage-ng#636
+- handle btrfs raid levels during create
+- added unit test
+- fixed typo
+- 4.1.109
+
+--------------------------------------------------------------------
+Mon Apr 15 12:04:45 UTC 2019 - [email protected]
+
+- merge gh#openSUSE/libstorage-ng#635
+- handle multiple devices for btrfs subvolumes
+- 4.1.108
+
+--------------------------------------------------------------------

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

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

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

Other differences:
------------------
++++++ libstorage-ng.spec ++++++
--- /var/tmp/diff_new_pack.xosVHH/_old  2019-04-18 09:55:26.889304433 +0200
+++ /var/tmp/diff_new_pack.xosVHH/_new  2019-04-18 09:55:26.889304433 +0200
@@ -18,7 +18,7 @@
 
 %define libname %{name}1
 Name:           libstorage-ng
-Version:        4.1.107
+Version:        4.1.110
 Release:        0
 Summary:        Library for storage management
 License:        GPL-2.0-only

++++++ libstorage-ng-4.1.107.tar.xz -> libstorage-ng-4.1.110.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.1.107/LIBVERSION 
new/libstorage-ng-4.1.110/LIBVERSION
--- old/libstorage-ng-4.1.107/LIBVERSION        2019-04-11 22:43:47.000000000 
+0200
+++ new/libstorage-ng-4.1.110/LIBVERSION        2019-04-17 12:43:28.000000000 
+0200
@@ -1 +1 @@
-1.9.0
+1.10.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.1.107/VERSION 
new/libstorage-ng-4.1.110/VERSION
--- old/libstorage-ng-4.1.107/VERSION   2019-04-11 22:43:47.000000000 +0200
+++ new/libstorage-ng-4.1.110/VERSION   2019-04-17 12:43:28.000000000 +0200
@@ -1 +1 @@
-4.1.107
+4.1.110
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.1.107/bindings/storage-template.i 
new/libstorage-ng-4.1.110/bindings/storage-template.i
--- old/libstorage-ng-4.1.107/bindings/storage-template.i       2019-04-11 
22:43:47.000000000 +0200
+++ new/libstorage-ng-4.1.110/bindings/storage-template.i       2019-04-17 
12:43:28.000000000 +0200
@@ -95,6 +95,7 @@
 %template(VectorPtType) std::vector<PtType>;
 %template(VectorMountByType) std::vector<MountByType>;
 %template(VectorMdParity) std::vector<MdParity>;
+%template(VectorBtrfsRaidLevel) std::vector<BtrfsRaidLevel>;
 
 %template(VectorSimpleEtcFstabEntry) std::vector<SimpleEtcFstabEntry>;
 %template(VectorSimpleEtcCrypttabEntry) std::vector<SimpleEtcCrypttabEntry>;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.1.107/integration-tests/filesystems/btrfs/create-multiple-devices.py
 
new/libstorage-ng-4.1.110/integration-tests/filesystems/btrfs/create-multiple-devices.py
--- 
old/libstorage-ng-4.1.107/integration-tests/filesystems/btrfs/create-multiple-devices.py
    2019-04-11 22:43:47.000000000 +0200
+++ 
new/libstorage-ng-4.1.110/integration-tests/filesystems/btrfs/create-multiple-devices.py
    2019-04-17 12:43:28.000000000 +0200
@@ -28,8 +28,8 @@
 btrfs.add_device(sdd1)
 
 btrfs.set_label("TEST")
-btrfs.set_metadata_raid_level(BtrfsRaidLevel_SINGLE)
-btrfs.set_data_raid_level(BtrfsRaidLevel_DUP)
+btrfs.set_metadata_raid_level(BtrfsRaidLevel_RAID1)
+btrfs.set_data_raid_level(BtrfsRaidLevel_RAID1)
 
 mount_point = btrfs.create_mount_point("/test")
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.1.107/storage/Filesystems/Btrfs.cc 
new/libstorage-ng-4.1.110/storage/Filesystems/Btrfs.cc
--- old/libstorage-ng-4.1.107/storage/Filesystems/Btrfs.cc      2019-04-11 
22:43:47.000000000 +0200
+++ new/libstorage-ng-4.1.110/storage/Filesystems/Btrfs.cc      2019-04-17 
12:43:28.000000000 +0200
@@ -106,6 +106,20 @@
     }
 
 
+    vector<BtrfsRaidLevel>
+    Btrfs::get_allowed_metadata_raid_levels() const
+    {
+       return get_impl().get_allowed_metadata_raid_levels();
+    }
+
+
+    vector<BtrfsRaidLevel>
+    Btrfs::get_allowed_data_raid_levels() const
+    {
+       return get_impl().get_allowed_data_raid_levels();
+    }
+
+
     FilesystemUser*
     Btrfs::add_device(BlkDevice* blk_device)
     {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.1.107/storage/Filesystems/Btrfs.h 
new/libstorage-ng-4.1.110/storage/Filesystems/Btrfs.h
--- old/libstorage-ng-4.1.107/storage/Filesystems/Btrfs.h       2019-04-11 
22:43:47.000000000 +0200
+++ new/libstorage-ng-4.1.110/storage/Filesystems/Btrfs.h       2019-04-17 
12:43:28.000000000 +0200
@@ -41,7 +41,7 @@
      */
     enum class BtrfsRaidLevel
     {
-        UNKNOWN, SINGLE, DUP, RAID0, RAID1, RAID5, RAID6, RAID10
+       UNKNOWN, DEFAULT, SINGLE, DUP, RAID0, RAID1, RAID5, RAID6, RAID10
     };
 
 
@@ -91,6 +91,24 @@
        void set_data_raid_level(BtrfsRaidLevel data_raid_level);
 
        /**
+        * Get the allowed metadata RAID levels for the btrfs. So far,
+        * this depends on the number of devices. Levels for which
+        * mkfs.btrfs warns that they are not recommended are not
+        * included here. Additionally DEFAULT is allowed when creating
+        * a btrfs.
+        */
+       std::vector<BtrfsRaidLevel> get_allowed_metadata_raid_levels() const;
+
+       /**
+        * Get the allowed data RAID levels for the btrfs. So far,
+        * this depends on the number of devices. Levels for which
+        * mkfs.btrfs warns that they are not recommended are not
+        * included here. Additionally DEFAULT is allowed when creating
+        * a btrfs.
+        */
+       std::vector<BtrfsRaidLevel> get_allowed_data_raid_levels() const;
+
+       /**
         * Add a block device to the btrfs.
         *
         * @throw WrongNumberOfChildren
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.1.107/storage/Filesystems/BtrfsImpl.cc 
new/libstorage-ng-4.1.110/storage/Filesystems/BtrfsImpl.cc
--- old/libstorage-ng-4.1.107/storage/Filesystems/BtrfsImpl.cc  2019-04-11 
22:43:47.000000000 +0200
+++ new/libstorage-ng-4.1.110/storage/Filesystems/BtrfsImpl.cc  2019-04-17 
12:43:28.000000000 +0200
@@ -53,13 +53,13 @@
 
 
     const vector<string> EnumTraits<BtrfsRaidLevel>::names({
-       "UNKNOWN", "SINGLE", "DUP", "RAID0", "RAID1", "RAID5", "RAID6", "RAID10"
+       "UNKNOWN", "DEFAULT", "SINGLE", "DUP", "RAID0", "RAID1", "RAID5", 
"RAID6", "RAID10"
     });
 
 
     Btrfs::Impl::Impl()
        : BlkFilesystem::Impl(), configure_snapper(false), 
snapper_config(nullptr),
-         metadata_raid_level(BtrfsRaidLevel::UNKNOWN), 
data_raid_level(BtrfsRaidLevel::UNKNOWN)
+         metadata_raid_level(BtrfsRaidLevel::DEFAULT), 
data_raid_level(BtrfsRaidLevel::DEFAULT)
     {
     }
 
@@ -113,6 +113,45 @@
     }
 
 
+    vector<BtrfsRaidLevel>
+    Btrfs::Impl::get_allowed_metadata_raid_levels() const
+    {
+       vector<const BlkDevice*> devices = get_blk_devices();
+
+       // For some number of devies more RAID levels work, e.g. RAID5 with two
+       // devices, but are not recommended (warning in mkfs.btrfs output) and
+       // are also not mentioned in the btrfs wiki
+       // 
(https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices).
+
+       switch (devices.size())
+       {
+           case 0:
+               return { };
+
+           case 1:
+               return { BtrfsRaidLevel::SINGLE, BtrfsRaidLevel::DUP };
+
+           case 2:
+               return { BtrfsRaidLevel::SINGLE, BtrfsRaidLevel::RAID0, 
BtrfsRaidLevel::RAID1 };
+
+           case 3:
+               return { BtrfsRaidLevel::SINGLE, BtrfsRaidLevel::RAID0, 
BtrfsRaidLevel::RAID1,
+                        BtrfsRaidLevel::RAID5 };
+
+           default:
+               return { BtrfsRaidLevel::SINGLE, BtrfsRaidLevel::RAID0, 
BtrfsRaidLevel::RAID1,
+                        BtrfsRaidLevel::RAID5, BtrfsRaidLevel::RAID6, 
BtrfsRaidLevel::RAID10 };
+       }
+    }
+
+
+    vector<BtrfsRaidLevel>
+    Btrfs::Impl::get_allowed_data_raid_levels() const
+    {
+       return get_allowed_metadata_raid_levels();
+    }
+
+
     FilesystemUser*
     Btrfs::Impl::add_device(BlkDevice* blk_device)
     {
@@ -257,14 +296,11 @@
 
        const ProcMounts& proc_mounts = system_info.getProcMounts();
 
-       for (const string& name : names)
+       for (const FstabEntry* mount_entry : proc_mounts.get_by_names(names, 
system_info))
        {
-           for (const FstabEntry* mount_entry : proc_mounts.get_by_name(name, 
system_info))
-           {
-               if (!mount_entry->get_mount_opts().has_subvol() ||
-                   mount_entry->get_mount_opts().has_subvol(default_id))
-                   ret.push_back(mount_entry);
-           }
+           if (!mount_entry->get_mount_opts().has_subvol() ||
+               mount_entry->get_mount_opts().has_subvol(default_id))
+               ret.push_back(mount_entry);
        }
 
        return ret;
@@ -498,9 +534,16 @@
     void
     Btrfs::Impl::do_create()
     {
-       string cmd_line = MKFSBTRFSBIN " --force " + get_mkfs_options();
+       string cmd_line = MKFSBTRFSBIN " --force";
+
+       if (metadata_raid_level != BtrfsRaidLevel::DEFAULT)
+           cmd_line += " --metadata=" + toString(metadata_raid_level);
+
+       if (data_raid_level != BtrfsRaidLevel::DEFAULT)
+           cmd_line += " --data=" + toString(data_raid_level);
 
-       // TODO metadata and data raid level
+       if (!get_mkfs_options().empty())
+           cmd_line += " " + get_mkfs_options();
 
        for (const BlkDevice* blk_device : get_blk_devices())
            cmd_line += " " + quote(blk_device->get_name());
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.1.107/storage/Filesystems/BtrfsImpl.h 
new/libstorage-ng-4.1.110/storage/Filesystems/BtrfsImpl.h
--- old/libstorage-ng-4.1.107/storage/Filesystems/BtrfsImpl.h   2019-04-11 
22:43:47.000000000 +0200
+++ new/libstorage-ng-4.1.110/storage/Filesystems/BtrfsImpl.h   2019-04-17 
12:43:28.000000000 +0200
@@ -69,6 +69,9 @@
        BtrfsRaidLevel get_data_raid_level() const { return data_raid_level; }
        void set_data_raid_level(BtrfsRaidLevel data_raid_level) { 
Impl::data_raid_level = data_raid_level; }
 
+       vector<BtrfsRaidLevel> get_allowed_metadata_raid_levels() const;
+       vector<BtrfsRaidLevel> get_allowed_data_raid_levels() const;
+
        FilesystemUser* add_device(BlkDevice* blk_device);
        void remove_device(BlkDevice* blk_device);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.1.107/storage/Filesystems/BtrfsSubvolumeImpl.cc 
new/libstorage-ng-4.1.110/storage/Filesystems/BtrfsSubvolumeImpl.cc
--- old/libstorage-ng-4.1.107/storage/Filesystems/BtrfsSubvolumeImpl.cc 
2019-04-11 22:43:47.000000000 +0200
+++ new/libstorage-ng-4.1.110/storage/Filesystems/BtrfsSubvolumeImpl.cc 
2019-04-17 12:43:28.000000000 +0200
@@ -249,7 +249,7 @@
 
        vector<const FstabEntry*> ret;
 
-       for (const FstabEntry* mount_entry : 
system_info.getProcMounts().get_by_name(names[0], system_info))
+       for (const FstabEntry* mount_entry : 
system_info.getProcMounts().get_by_names(names, system_info))
        {
            if (mount_entry->get_mount_opts().has_subvol(id, path) && id != 
default_id)
                ret.push_back(mount_entry);
@@ -293,12 +293,26 @@
        SystemInfo& system_info = prober.get_system_info();
 
        const Btrfs* btrfs = get_btrfs();
-       const BlkDevice* blk_device = btrfs->get_impl().get_blk_device();
 
-       vector<string> aliases = EtcFstab::construct_device_aliases(blk_device, 
btrfs);
+       vector<string> names;
+       vector<string> aliases;
+
+       for (const BlkDevice* blk_device : btrfs->get_blk_devices())
+       {
+           names.push_back(blk_device->get_name());
+
+           // The algorithm for merging here is by far not the fastest but 
keeps the order as
+           // needed by the testsuite.
+
+           for (const string& alias : 
EtcFstab::construct_device_aliases(blk_device, btrfs))
+           {
+               if (find(aliases.begin(), aliases.end(), alias) == 
aliases.end())
+                   aliases.push_back(alias);
+           }
+       }
 
        vector<const FstabEntry*> fstab_entries = 
find_etc_fstab_entries(system_info.getEtcFstab(), aliases);
-       vector<const FstabEntry*> mount_entries = 
find_proc_mounts_entries(system_info, aliases);
+       vector<const FstabEntry*> mount_entries = 
find_proc_mounts_entries(system_info, names);
 
        // The code here works only with one mount point per
        // mountable. Anything else is not supported since rejected by the
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.1.107/storage/Filesystems/MountableImpl.cc 
new/libstorage-ng-4.1.110/storage/Filesystems/MountableImpl.cc
--- old/libstorage-ng-4.1.107/storage/Filesystems/MountableImpl.cc      
2019-04-11 22:43:47.000000000 +0200
+++ new/libstorage-ng-4.1.110/storage/Filesystems/MountableImpl.cc      
2019-04-17 12:43:28.000000000 +0200
@@ -200,7 +200,7 @@
     vector<const FstabEntry*>
     Mountable::Impl::find_proc_mounts_entries(SystemInfo& system_info, const 
vector<string>& names) const
     {
-       return system_info.getProcMounts().get_by_name(names[0], system_info);
+       return system_info.getProcMounts().get_by_names(names, system_info);
     }
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.1.107/storage/SystemInfo/ProcMounts.cc 
new/libstorage-ng-4.1.110/storage/SystemInfo/ProcMounts.cc
--- old/libstorage-ng-4.1.107/storage/SystemInfo/ProcMounts.cc  2019-04-11 
22:43:47.000000000 +0200
+++ new/libstorage-ng-4.1.110/storage/SystemInfo/ProcMounts.cc  2019-04-17 
12:43:28.000000000 +0200
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) [2004-2014] Novell, Inc.
- * Copyright (c) [2016-2018] SUSE LLC
+ * Copyright (c) [2016-2019] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -128,7 +128,7 @@
 
 
     vector<const FstabEntry*>
-    ProcMounts::get_by_name(const string& name, SystemInfo& system_info) const
+    ProcMounts::get_by_names(const vector<string>& names, SystemInfo& 
system_info) const
     {
        vector<const FstabEntry*> ret;
 
@@ -136,14 +136,17 @@
        // devices (starting with '/dev/'). Parameter name will also be
        // e.g. 'tmpfs' and nfs mounts.
 
-       dev_t majorminor = system_info.getCmdUdevadmInfo(name).get_majorminor();
-
-       for (const value_type& value : data)
+       for (const string& name : names)
        {
-           if (value.first == name ||
-               (BlkDevice::Impl::is_valid_name(value.first) &&
-                system_info.getCmdUdevadmInfo(value.first).get_majorminor() == 
majorminor))
-               ret.push_back(value.second);
+           dev_t majorminor = 
system_info.getCmdUdevadmInfo(name).get_majorminor();
+
+           for (const value_type& value : data)
+           {
+               if (value.first == name ||
+                   (BlkDevice::Impl::is_valid_name(value.first) &&
+                    
system_info.getCmdUdevadmInfo(value.first).get_majorminor() == majorminor))
+                   ret.push_back(value.second);
+           }
        }
 
        return ret;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.1.107/storage/SystemInfo/ProcMounts.h 
new/libstorage-ng-4.1.110/storage/SystemInfo/ProcMounts.h
--- old/libstorage-ng-4.1.107/storage/SystemInfo/ProcMounts.h   2019-04-11 
22:43:47.000000000 +0200
+++ new/libstorage-ng-4.1.110/storage/SystemInfo/ProcMounts.h   2019-04-17 
12:43:28.000000000 +0200
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) [2004-2014] Novell, Inc.
- * Copyright (c) [2016-2017] SUSE LLC
+ * Copyright (c) [2016-2019] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -49,10 +49,12 @@
        ~ProcMounts();
 
        /**
-        * Return all entries for the device. This object keeps ownership of
-        * the entries; do not delete them.
+        * Return all entries for the device (possible by several names). 
Aliases,
+        * e.g. udev symlinks, are handles by the function. Passing several 
names is
+        * intended for multiple devices btrfs. This object keeps ownership of 
the
+        * entries; do not delete them.
         */
-       vector<const FstabEntry*> get_by_name(const string& name, SystemInfo& 
system_info) const;
+       vector<const FstabEntry*> get_by_names(const vector<string>& names, 
SystemInfo& system_info) const;
 
        /**
         * Return all NFS and NFS4 entries. This object keeps ownership of the 
entries;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.1.107/testsuite/SystemInfo/btrfs-filesystem-show.cc 
new/libstorage-ng-4.1.110/testsuite/SystemInfo/btrfs-filesystem-show.cc
--- old/libstorage-ng-4.1.107/testsuite/SystemInfo/btrfs-filesystem-show.cc     
2019-04-11 22:43:47.000000000 +0200
+++ new/libstorage-ng-4.1.110/testsuite/SystemInfo/btrfs-filesystem-show.cc     
2019-04-17 12:43:28.000000000 +0200
@@ -144,3 +144,23 @@
 
     check_systemcmd_exception(input, stderr);
 }
+
+
+BOOST_AUTO_TEST_CASE(parse_missing)
+{
+    vector<string> input = {
+       "Label: none  uuid: b0749dbe-7de5-4719-9cb6-043dd5c70d00",
+       "        Total devices 4 FS bytes used 256.00KiB",
+       "        devid    1 size 2.00GiB used 417.12MiB path /dev/sdb1",
+       "        devid    2 size 2.00GiB used 417.12MiB path /dev/sdc1",
+       "        devid    3 size 2.00GiB used 417.12MiB path /dev/sdd1",
+       "        *** Some devices missing",
+       ""
+    };
+
+    vector<string> output = {
+       "uuid:b0749dbe-7de5-4719-9cb6-043dd5c70d00 devices:</dev/sdb1 /dev/sdc1 
/dev/sdd1>"
+    };
+
+    check(input, output);
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.1.107/testsuite/actions/Makefile.am 
new/libstorage-ng-4.1.110/testsuite/actions/Makefile.am
--- old/libstorage-ng-4.1.107/testsuite/actions/Makefile.am     2019-04-11 
22:43:47.000000000 +0200
+++ new/libstorage-ng-4.1.110/testsuite/actions/Makefile.am     2019-04-17 
12:43:28.000000000 +0200
@@ -8,13 +8,14 @@
        -lboost_unit_test_framework
 
 check_PROGRAMS =                                                               
\
-       dasd1.test md1.test
+       btrfs1.test dasd1.test md1.test
 
 AM_DEFAULT_SOURCE_EXT = .cc
 
 TESTS = $(check_PROGRAMS)
 
-EXTRA_DIST =                                                                   
\
-       dasd1-probed.xml dasd1-staging.xml dasd1-expected.txt dasd1-mockup.xml  
\
+EXTRA_DIST =                                                                   
        \
+       btrfs1-probed.xml btrfs1-staging.xml btrfs1-expected.txt 
btrfs1-mockup.xml      \
+       dasd1-probed.xml dasd1-staging.xml dasd1-expected.txt dasd1-mockup.xml  
        \
        md1-probed.xml md1-staging.xml md1-expected.txt md1-mockup.xml
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.1.107/testsuite/actions/btrfs1-expected.txt 
new/libstorage-ng-4.1.110/testsuite/actions/btrfs1-expected.txt
--- old/libstorage-ng-4.1.107/testsuite/actions/btrfs1-expected.txt     
1970-01-01 01:00:00.000000000 +0100
+++ new/libstorage-ng-4.1.110/testsuite/actions/btrfs1-expected.txt     
2019-04-17 12:43:28.000000000 +0200
@@ -0,0 +1 @@
+1 - Create btrfs on /dev/sda (8.00 GiB), /dev/sdb (8.00 GiB), /dev/sdc (8.00 
GiB) and /dev/sdd (8.00 GiB) ->
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.1.107/testsuite/actions/btrfs1-mockup.xml 
new/libstorage-ng-4.1.110/testsuite/actions/btrfs1-mockup.xml
--- old/libstorage-ng-4.1.107/testsuite/actions/btrfs1-mockup.xml       
1970-01-01 01:00:00.000000000 +0100
+++ new/libstorage-ng-4.1.110/testsuite/actions/btrfs1-mockup.xml       
2019-04-17 12:43:28.000000000 +0200
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<Mockup>
+  <Commands>
+    <Command>
+      <name>/sbin/udevadm settle --timeout=20</name>
+    </Command>
+    <Command>
+      <name>/sbin/mkfs.btrfs --force --metadata=RAID1 --data=RAID0 --mixed 
'/dev/sda' '/dev/sdb' '/dev/sdc' '/dev/sdd'</name>
+    </Command>
+    <Command>
+      <name>/sbin/blkid -c '/dev/null' '/dev/sda'</name>
+      <stdout>/dev/sda: UUID="318eac77-bbe5-40b4-a8fd-b30ec45d0003" 
UUID_SUB="b62c72f0-2798-4a79-8307-c07a3781fbb2" TYPE="btrfs"</stdout>
+    </Command>
+  </Commands>
+</Mockup>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.1.107/testsuite/actions/btrfs1-probed.xml 
new/libstorage-ng-4.1.110/testsuite/actions/btrfs1-probed.xml
--- old/libstorage-ng-4.1.107/testsuite/actions/btrfs1-probed.xml       
1970-01-01 01:00:00.000000000 +0100
+++ new/libstorage-ng-4.1.110/testsuite/actions/btrfs1-probed.xml       
2019-04-17 12:43:28.000000000 +0200
@@ -0,0 +1,81 @@
+<?xml version="1.0"?>
+<Devicegraph>
+  <Devices>
+    <Disk>
+      <sid>42</sid>
+      <name>/dev/sda</name>
+      <sysfs-name>sda</sysfs-name>
+      
<sysfs-path>/devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda</sysfs-path>
+      <size-k>16777216</size-k>
+      <udev-path>pci-0000:00:1f.2-ata-1.0</udev-path>
+      <udev-id>ata-VBOX_HARDDISK_VBb5bd49a6-9719c9ff</udev-id>
+      <udev-id>scsi-0ATA_VBOX_HARDDISK_VBb5bd49a6-9719c9ff</udev-id>
+      <udev-id>scsi-1ATA_VBOX_HARDDISK_VBb5bd49a6-9719c9ff</udev-id>
+      <udev-id>scsi-SATA_VBOX_HARDDISK_VBb5bd49a6-9719c9ff</udev-id>
+      <region>
+        <length>16777216</length>
+        <block-size>512</block-size>
+      </region>
+      <range>256</range>
+      <rotational>true</rotational>
+      <transport>SATA</transport>
+    </Disk>
+    <Disk>
+      <sid>43</sid>
+      <name>/dev/sdb</name>
+      <sysfs-name>sdb</sysfs-name>
+      
<sysfs-path>/devices/pci0000:00/0000:00:1f.2/ata2/host1/target1:0:0/1:0:0:0/block/sdb</sysfs-path>
+      <size-k>16777216</size-k>
+      <udev-path>pci-0000:00:1f.2-ata-2.0</udev-path>
+      <udev-id>ata-VBOX_HARDDISK_VB558bee5c-c4399e89</udev-id>
+      <udev-id>scsi-0ATA_VBOX_HARDDISK_VB558bee5c-c4399e89</udev-id>
+      <udev-id>scsi-1ATA_VBOX_HARDDISK_VB558bee5c-c4399e89</udev-id>
+      <udev-id>scsi-SATA_VBOX_HARDDISK_VB558bee5c-c4399e89</udev-id>
+      <region>
+        <length>16777216</length>
+        <block-size>512</block-size>
+      </region>
+      <range>256</range>
+      <rotational>true</rotational>
+      <transport>SATA</transport>
+    </Disk>
+    <Disk>
+      <sid>44</sid>
+      <name>/dev/sdc</name>
+      <sysfs-name>sdc</sysfs-name>
+      
<sysfs-path>/devices/pci0000:00/0000:00:1f.2/ata3/host2/target2:0:0/2:0:0:0/block/sdc</sysfs-path>
+      <size-k>16777216</size-k>
+      <udev-path>pci-0000:00:1f.2-ata-3.0</udev-path>
+      <udev-id>ata-VBOX_HARDDISK_VB0eeaf303-8fd4e564</udev-id>
+      <udev-id>scsi-0ATA_VBOX_HARDDISK_VB0eeaf303-8fd4e564</udev-id>
+      <udev-id>scsi-1ATA_VBOX_HARDDISK_VB0eeaf303-8fd4e564</udev-id>
+      <udev-id>scsi-SATA_VBOX_HARDDISK_VB0eeaf303-8fd4e564</udev-id>
+      <region>
+        <length>16777216</length>
+        <block-size>512</block-size>
+      </region>
+      <range>256</range>
+      <rotational>true</rotational>
+      <transport>SATA</transport>
+    </Disk>
+    <Disk>
+      <sid>45</sid>
+      <name>/dev/sdd</name>
+      <sysfs-name>sdd</sysfs-name>
+      
<sysfs-path>/devices/pci0000:00/0000:00:1f.2/ata4/host3/target3:0:0/3:0:0:0/block/sdd</sysfs-path>
+      <size-k>16777216</size-k>
+      <udev-path>pci-0000:00:1f.2-ata-4.0</udev-path>
+      <udev-id>ata-VBOX_HARDDISK_VB2990e9d7-d065ff3e</udev-id>
+      <udev-id>scsi-0ATA_VBOX_HARDDISK_VB2990e9d7-d065ff3e</udev-id>
+      <udev-id>scsi-1ATA_VBOX_HARDDISK_VB2990e9d7-d065ff3e</udev-id>
+      <udev-id>scsi-SATA_VBOX_HARDDISK_VB2990e9d7-d065ff3e</udev-id>
+      <region>
+        <length>16777216</length>
+        <block-size>512</block-size>
+      </region>
+      <range>256</range>
+      <rotational>true</rotational>
+      <transport>SATA</transport>
+    </Disk>
+  </Devices>
+</Devicegraph>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.1.107/testsuite/actions/btrfs1-staging.xml 
new/libstorage-ng-4.1.110/testsuite/actions/btrfs1-staging.xml
--- old/libstorage-ng-4.1.107/testsuite/actions/btrfs1-staging.xml      
1970-01-01 01:00:00.000000000 +0100
+++ new/libstorage-ng-4.1.110/testsuite/actions/btrfs1-staging.xml      
2019-04-17 12:43:28.000000000 +0200
@@ -0,0 +1,119 @@
+<?xml version="1.0"?>
+<Devicegraph>
+  <Devices>
+    <Disk>
+      <sid>42</sid>
+      <name>/dev/sda</name>
+      <sysfs-name>sda</sysfs-name>
+      
<sysfs-path>/devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda</sysfs-path>
+      <size-k>16777216</size-k>
+      <udev-path>pci-0000:00:1f.2-ata-1.0</udev-path>
+      <udev-id>ata-VBOX_HARDDISK_VBb5bd49a6-9719c9ff</udev-id>
+      <udev-id>scsi-0ATA_VBOX_HARDDISK_VBb5bd49a6-9719c9ff</udev-id>
+      <udev-id>scsi-1ATA_VBOX_HARDDISK_VBb5bd49a6-9719c9ff</udev-id>
+      <udev-id>scsi-SATA_VBOX_HARDDISK_VBb5bd49a6-9719c9ff</udev-id>
+      <region>
+        <length>16777216</length>
+        <block-size>512</block-size>
+      </region>
+      <range>256</range>
+      <rotational>true</rotational>
+      <transport>SATA</transport>
+    </Disk>
+    <Disk>
+      <sid>43</sid>
+      <name>/dev/sdb</name>
+      <sysfs-name>sdb</sysfs-name>
+      
<sysfs-path>/devices/pci0000:00/0000:00:1f.2/ata2/host1/target1:0:0/1:0:0:0/block/sdb</sysfs-path>
+      <size-k>16777216</size-k>
+      <udev-path>pci-0000:00:1f.2-ata-2.0</udev-path>
+      <udev-id>ata-VBOX_HARDDISK_VB558bee5c-c4399e89</udev-id>
+      <udev-id>scsi-0ATA_VBOX_HARDDISK_VB558bee5c-c4399e89</udev-id>
+      <udev-id>scsi-1ATA_VBOX_HARDDISK_VB558bee5c-c4399e89</udev-id>
+      <udev-id>scsi-SATA_VBOX_HARDDISK_VB558bee5c-c4399e89</udev-id>
+      <region>
+        <length>16777216</length>
+        <block-size>512</block-size>
+      </region>
+      <range>256</range>
+      <rotational>true</rotational>
+      <transport>SATA</transport>
+    </Disk>
+    <Disk>
+      <sid>44</sid>
+      <name>/dev/sdc</name>
+      <sysfs-name>sdc</sysfs-name>
+      
<sysfs-path>/devices/pci0000:00/0000:00:1f.2/ata3/host2/target2:0:0/2:0:0:0/block/sdc</sysfs-path>
+      <size-k>16777216</size-k>
+      <udev-path>pci-0000:00:1f.2-ata-3.0</udev-path>
+      <udev-id>ata-VBOX_HARDDISK_VB0eeaf303-8fd4e564</udev-id>
+      <udev-id>scsi-0ATA_VBOX_HARDDISK_VB0eeaf303-8fd4e564</udev-id>
+      <udev-id>scsi-1ATA_VBOX_HARDDISK_VB0eeaf303-8fd4e564</udev-id>
+      <udev-id>scsi-SATA_VBOX_HARDDISK_VB0eeaf303-8fd4e564</udev-id>
+      <region>
+        <length>16777216</length>
+        <block-size>512</block-size>
+      </region>
+      <range>256</range>
+      <rotational>true</rotational>
+      <transport>SATA</transport>
+    </Disk>
+    <Disk>
+      <sid>45</sid>
+      <name>/dev/sdd</name>
+      <sysfs-name>sdd</sysfs-name>
+      
<sysfs-path>/devices/pci0000:00/0000:00:1f.2/ata4/host3/target3:0:0/3:0:0:0/block/sdd</sysfs-path>
+      <size-k>16777216</size-k>
+      <udev-path>pci-0000:00:1f.2-ata-4.0</udev-path>
+      <udev-id>ata-VBOX_HARDDISK_VB2990e9d7-d065ff3e</udev-id>
+      <udev-id>scsi-0ATA_VBOX_HARDDISK_VB2990e9d7-d065ff3e</udev-id>
+      <udev-id>scsi-1ATA_VBOX_HARDDISK_VB2990e9d7-d065ff3e</udev-id>
+      <udev-id>scsi-SATA_VBOX_HARDDISK_VB2990e9d7-d065ff3e</udev-id>
+      <region>
+        <length>16777216</length>
+        <block-size>512</block-size>
+      </region>
+      <range>256</range>
+      <rotational>true</rotational>
+      <transport>SATA</transport>
+    </Disk>
+    <Btrfs>
+      <sid>46</sid>
+      <metadata-raid-level>RAID1</metadata-raid-level>
+      <data-raid-level>RAID0</data-raid-level>
+      <mkfs-options>--mixed</mkfs-options>
+    </Btrfs>
+    <BtrfsSubvolume>
+      <sid>47</sid>
+      <id>5</id>
+      <path></path>
+      <default-btrfs-subvolume>true</default-btrfs-subvolume>
+    </BtrfsSubvolume>
+  </Devices>
+  <Holders>
+    <FilesystemUser>
+      <source-sid>42</source-sid>
+      <target-sid>46</target-sid>
+      <sort-key>1</sort-key>
+    </FilesystemUser>
+    <FilesystemUser>
+      <source-sid>43</source-sid>
+      <target-sid>46</target-sid>
+      <sort-key>3</sort-key>
+    </FilesystemUser>
+    <FilesystemUser>
+      <source-sid>44</source-sid>
+      <target-sid>46</target-sid>
+      <sort-key>2</sort-key>
+    </FilesystemUser>
+    <FilesystemUser>
+      <source-sid>45</source-sid>
+      <target-sid>46</target-sid>
+      <sort-key>4</sort-key>
+    </FilesystemUser>
+    <Subdevice>
+      <source-sid>46</source-sid>
+      <target-sid>47</target-sid>
+    </Subdevice>
+  </Holders>
+</Devicegraph>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.1.107/testsuite/actions/btrfs1.cc 
new/libstorage-ng-4.1.110/testsuite/actions/btrfs1.cc
--- old/libstorage-ng-4.1.107/testsuite/actions/btrfs1.cc       1970-01-01 
01:00:00.000000000 +0100
+++ new/libstorage-ng-4.1.110/testsuite/actions/btrfs1.cc       2019-04-17 
12:43:28.000000000 +0200
@@ -0,0 +1,22 @@
+
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_MODULE libstorage
+
+#include <boost/test/unit_test.hpp>
+
+#include "storage/Utils/Logger.h"
+#include "testsuite/helpers/TsCmp.h"
+
+
+using namespace storage;
+
+
+// Check that mkfs.btrfs is called with the correct parameters.
+
+BOOST_AUTO_TEST_CASE(actions)
+{
+    set_logger(get_stdout_logger());
+
+    TsCmpActiongraph cmp("btrfs1", true);
+    BOOST_CHECK_MESSAGE(cmp.ok(), cmp);
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.1.107/testsuite/probe/btrfs2-devicegraph.xml 
new/libstorage-ng-4.1.110/testsuite/probe/btrfs2-devicegraph.xml
--- old/libstorage-ng-4.1.107/testsuite/probe/btrfs2-devicegraph.xml    
2019-04-11 22:43:47.000000000 +0200
+++ new/libstorage-ng-4.1.110/testsuite/probe/btrfs2-devicegraph.xml    
2019-04-17 12:43:28.000000000 +0200
@@ -280,8 +280,18 @@
       <path></path>
       <default-btrfs-subvolume>true</default-btrfs-subvolume>
     </BtrfsSubvolume>
-    <MountPoint>
+    <BtrfsSubvolume>
       <sid>65</sid>
+      <id>258</id>
+      <path>sub1</path>
+    </BtrfsSubvolume>
+    <BtrfsSubvolume>
+      <sid>66</sid>
+      <id>259</id>
+      <path>sub2</path>
+    </BtrfsSubvolume>
+    <MountPoint>
+      <sid>67</sid>
       <path>/test</path>
       <mount-by>device</mount-by>
       <mount-type>btrfs</mount-type>
@@ -290,6 +300,17 @@
       <freq>0</freq>
       <passno>0</passno>
     </MountPoint>
+    <MountPoint>
+      <sid>68</sid>
+      <path>/test/sub1</path>
+      <mount-by>device</mount-by>
+      <mount-options>subvol=sub1</mount-options>
+      <mount-type>btrfs</mount-type>
+      <active>true</active>
+      <in-etc-fstab>true</in-etc-fstab>
+      <freq>0</freq>
+      <passno>0</passno>
+    </MountPoint>
   </Devices>
   <Holders>
     <User>
@@ -376,9 +397,21 @@
       <source-sid>58</source-sid>
       <target-sid>63</target-sid>
     </FilesystemUser>
+    <Subdevice>
+      <source-sid>64</source-sid>
+      <target-sid>65</target-sid>
+    </Subdevice>
+    <Subdevice>
+      <source-sid>64</source-sid>
+      <target-sid>66</target-sid>
+    </Subdevice>
     <User>
       <source-sid>63</source-sid>
-      <target-sid>65</target-sid>
+      <target-sid>67</target-sid>
+    </User>
+    <User>
+      <source-sid>65</source-sid>
+      <target-sid>68</target-sid>
     </User>
   </Holders>
 </Devicegraph>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.1.107/testsuite/probe/btrfs2-mockup.xml 
new/libstorage-ng-4.1.110/testsuite/probe/btrfs2-mockup.xml
--- old/libstorage-ng-4.1.107/testsuite/probe/btrfs2-mockup.xml 2019-04-11 
22:43:47.000000000 +0200
+++ new/libstorage-ng-4.1.110/testsuite/probe/btrfs2-mockup.xml 2019-04-17 
12:43:28.000000000 +0200
@@ -40,6 +40,20 @@
     </Command>
     <Command>
       <name>/sbin/btrfs subvolume list -a -p (device:/dev/sdb1)</name>
+      <stdout>ID 258 gen 12 parent 5 top level 5 path sub1</stdout>
+      <stdout>ID 259 gen 13 parent 5 top level 5 path sub2</stdout>
+    </Command>
+    <Command>
+      <name>/sbin/btrfs subvolume get-default (device:/dev/sdb1)</name>
+      <stdout>ID 5 (FS_TREE)</stdout>
+    </Command>
+    <Command>
+      <name>/usr/bin/lsattr -d (device:/dev/sdb1 path:sub1)</name>
+      <stdout>------------------- 
/tmp/libstorage-gHH6Jb/tmp-mount-Z4Ts24/test/sub1</stdout>
+    </Command>
+    <Command>
+      <name>/usr/bin/lsattr -d (device:/dev/sdb1 path:sub2)</name>
+      <stdout>------------------- 
/tmp/libstorage-gHH6Jb/tmp-mount-Z4Ts24/test/sub2</stdout>
     </Command>
     <Command>
       <name>/sbin/dmraid --sets=active -ccc</name>
@@ -949,6 +963,7 @@
       <content>UUID=353d5680-94ab-4ae0-b3e2-2a1f3fb37314  swap  swap  defaults 
       0  0</content>
       <content></content>
       <content>/dev/sdc1  /test  btrfs  defaults  0  0</content>
+      <content>/dev/sdc1  /test/sub1  btrfs  subvol=sub1  0  0</content>
     </File>
     <File>
       <name>/proc/mounts</name>
@@ -980,8 +995,9 @@
       <content>debugfs /sys/kernel/debug debugfs rw,relatime 0 0</content>
       <content>hugetlbfs /dev/hugepages hugetlbfs rw,relatime 0 0</content>
       <content>tmpfs /run/user/0 tmpfs 
rw,nosuid,nodev,relatime,size=203268k,mode=700 0 0</content>
-      <content>/dev/sdd1 /test btrfs 
rw,relatime,space_cache,subvolid=5,subvol=/ 0 0</content>
       <content>tracefs /sys/kernel/debug/tracing tracefs rw,relatime 0 
0</content>
+      <content>/dev/sdd1 /test btrfs 
rw,relatime,space_cache,subvolid=5,subvol=/ 0 0</content>
+      <content>/dev/sdd1 /test/sub1 btrfs 
rw,relatime,space_cache,subvolid=258,subvol=/sub1 0 0</content>
     </File>
     <File>
       <name>/proc/swaps</name>


Reply via email to