Hello community, here is the log from the commit of package libstorage-ng for openSUSE:Factory checked in at 2019-02-15 09:53:41 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libstorage-ng (Old) and /work/SRC/openSUSE:Factory/.libstorage-ng.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libstorage-ng" Fri Feb 15 09:53:41 2019 rev:41 rq:674465 version:4.1.88 Changes: -------- --- /work/SRC/openSUSE:Factory/libstorage-ng/libstorage-ng.changes 2019-02-08 13:48:58.826768345 +0100 +++ /work/SRC/openSUSE:Factory/.libstorage-ng.new.28833/libstorage-ng.changes 2019-02-15 09:53:41.783792300 +0100 @@ -1,0 +2,22 @@ +Tue Feb 12 14:35:03 UTC 2019 - [email protected] + +- merge gh#openSUSE/libstorage-ng#614 +- detect DASDs using virtio-blk (bsc#1112037) +- added unit test +- avoid copying objects +- 4.1.88 + +-------------------------------------------------------------------- +Mon Feb 11 13:00:49 UTC 2019 - [email protected] + +- Translated using Weblate (Dutch) +- Translated using Weblate (Slovak) +- 4.1.87 + +-------------------------------------------------------------------- +Mon Feb 11 13:00:44 UTC 2019 - [email protected] + +- merge gh#openSUSE/libstorage-ng#612 +- Fix dead links to old libstorage in the documentation + +-------------------------------------------------------------------- Old: ---- libstorage-ng-4.1.86.tar.xz New: ---- libstorage-ng-4.1.88.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libstorage-ng.spec ++++++ --- /var/tmp/diff_new_pack.ZS9R3b/_old 2019-02-15 09:53:42.203792168 +0100 +++ /var/tmp/diff_new_pack.ZS9R3b/_new 2019-02-15 09:53:42.207792166 +0100 @@ -18,7 +18,7 @@ %define libname %{name}1 Name: libstorage-ng -Version: 4.1.86 +Version: 4.1.88 Release: 0 Summary: Library for storage management License: GPL-2.0-only ++++++ libstorage-ng-4.1.86.tar.xz -> libstorage-ng-4.1.88.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.1.86/LIBVERSION new/libstorage-ng-4.1.88/LIBVERSION --- old/libstorage-ng-4.1.86/LIBVERSION 2019-02-07 06:52:13.000000000 +0100 +++ new/libstorage-ng-4.1.88/LIBVERSION 2019-02-12 15:35:03.000000000 +0100 @@ -1 +1 @@ -1.8.0 +1.8.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.1.86/VERSION new/libstorage-ng-4.1.88/VERSION --- old/libstorage-ng-4.1.86/VERSION 2019-02-07 06:52:13.000000000 +0100 +++ new/libstorage-ng-4.1.88/VERSION 2019-02-12 15:35:03.000000000 +0100 @@ -1 +1 @@ -4.1.86 +4.1.88 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.1.86/doc/goals.md new/libstorage-ng-4.1.88/doc/goals.md --- old/libstorage-ng-4.1.86/doc/goals.md 2019-02-07 06:52:13.000000000 +0100 +++ new/libstorage-ng-4.1.88/doc/goals.md 2019-02-12 15:35:03.000000000 +0100 @@ -7,15 +7,15 @@ provide new features and at the same time improve robustness and testability. The shortcomings of the old code are documented at -https://github.com/openSUSE/libstorage/blob/master/doc/status-current-code.md. These -shortcomings should be removed. +https://github.com/openSUSE/libstorage/blob/SLE-12-SP4/doc/status-current-code.md. +These shortcomings should be removed. Features and Bugs ----------------- Some features and bugs blocked by the old code are listed at -https://github.com/openSUSE/libstorage/blob/master/doc/blocked-features-and-bugs.md. +https://github.com/openSUSE/libstorage/blob/SLE-12-SP4/doc/blocked-features-and-bugs.md. Additional some features have already been requests: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.1.86/doc/overview.md new/libstorage-ng-4.1.88/doc/overview.md --- old/libstorage-ng-4.1.86/doc/overview.md 2019-02-07 06:52:13.000000000 +0100 +++ new/libstorage-ng-4.1.88/doc/overview.md 2019-02-12 15:35:03.000000000 +0100 @@ -23,7 +23,7 @@ You might have seen the diagram above in YaST. But in libstorage-ng it is a direct dump of internal data structure instead of a [cumbersome -transformation](https://github.com/openSUSE/libstorage/blob/master/storage/Graph.cc). +transformation](https://github.com/openSUSE/libstorage/blob/SLE-12-SP4/storage/Graph.cc). The graph approach has several advantages compared to the list of list design of libstorage: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.1.86/po/nl.po new/libstorage-ng-4.1.88/po/nl.po --- old/libstorage-ng-4.1.86/po/nl.po 2019-02-07 06:52:13.000000000 +0100 +++ new/libstorage-ng-4.1.88/po/nl.po 2019-02-12 15:35:03.000000000 +0100 @@ -15,8 +15,8 @@ "Project-Id-Version: libstorage.nl\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-11-23 14:23+0100\n" -"PO-Revision-Date: 2019-02-02 12:52+0000\n" -"Last-Translator: Eva van Rein <[email protected]>\n" +"PO-Revision-Date: 2019-02-11 13:00+0000\n" +"Last-Translator: Freek de Kruijf <[email protected]>\n" "Language-Team: Dutch <https://l10n.opensuse.org/projects/libstorage/" "ng-master/nl/>\n" "Language: nl\n" @@ -1450,6 +1450,8 @@ "Detected a LUKS device next to a partition table on the\n" "device %1$s. The LUKS device will be ignored." msgstr "" +"Een LUKS apparaat gedetecteerd naast een partitietabel op het\n" +"apparaat %1$s. Het LUKS apparaat zal genegeerd worden." #. TRANSLATORS: Error message displayed during probing, #. %1$s is replaced by the device name (e.g. /dev/sda) @@ -1458,6 +1460,8 @@ "Detected a LVM logical volume next to a partition table on the\n" "device %1$s. The LVM logical volume will be ignored." msgstr "" +"Een LVM logisch volume gedetecteerd naast een partitietabel op het\n" +"apparaat %1$s. Het LVM logische volume zal genegeerd worden." #. TRANSLATORS: Error message displayed during probing, #. %1$s is replaced by the device name (e.g. /dev/sda) @@ -1466,6 +1470,8 @@ "Detected a file system next to a partition table on the\n" "device %1$s. The file system will be ignored." msgstr "" +"Een bestandssysteem gedetecteerd naast een partitietabel op het\n" +"apparaat %1$s. Het bestandssysteem zal genegeerd worden." #. TRANSLATORS: name of partition type msgid "Diagnostics Partition" @@ -2121,14 +2127,12 @@ msgstr "Aftasten Stray-blokapparaten is mislukt" #. TRANSLATORS: progress message -#, fuzzy msgid "Probing additional attributes" -msgstr "Aftasten partities is mislukt" +msgstr "Additionele attributen worden afgetast" #. TRANSLATORS: error message -#, fuzzy msgid "Probing additional attributes failed" -msgstr "Aftasten partities is mislukt" +msgstr "Aftasten van additionele attributen is mislukt" #. TRANSLATORS: progress message msgid "Probing bcache" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.1.86/po/sk.po new/libstorage-ng-4.1.88/po/sk.po --- old/libstorage-ng-4.1.86/po/sk.po 2019-02-07 06:52:13.000000000 +0100 +++ new/libstorage-ng-4.1.88/po/sk.po 2019-02-12 15:35:03.000000000 +0100 @@ -6,7 +6,7 @@ "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-02-01 10:19+0100\n" -"PO-Revision-Date: 2019-02-07 05:52+0000\n" +"PO-Revision-Date: 2019-02-11 13:00+0000\n" "Last-Translator: Ferdinand Galko <[email protected]>\n" "Language-Team: Slovak <https://l10n.opensuse.org/projects/libstorage/" "ng-master/sk/>\n" @@ -1450,6 +1450,8 @@ "Detected a LUKS device next to a partition table on the\n" "device %1$s. The LUKS device will be ignored." msgstr "" +"Zistené zariadenie LUKS vedľa tabuľky oddielov\n" +"na zariadení %1$s. Zariadenie LUKS bude ignorované." #. TRANSLATORS: Error message displayed during probing, #. %1$s is replaced by the device name (e.g. /dev/sda) @@ -1458,6 +1460,8 @@ "Detected a LVM logical volume next to a partition table on the\n" "device %1$s. The LVM logical volume will be ignored." msgstr "" +"Zistený logický zväzok LVM vedľa tabuľky oddielov\n" +"na zariadení %1$s. Logický zväzok LVM bude ignorovaný." #. TRANSLATORS: Error message displayed during probing, #. %1$s is replaced by the device name (e.g. /dev/sda) @@ -1466,6 +1470,8 @@ "Detected a file system next to a partition table on the\n" "device %1$s. The file system will be ignored." msgstr "" +"Zistený súborový systém vedľa tabuľky oddielov\n" +"na zariadení %1$s. Súborový systém bude ignorovaný." #. TRANSLATORS: name of partition type msgid "Diagnostics Partition" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.1.86/storage/Devices/BcacheCsetImpl.cc new/libstorage-ng-4.1.88/storage/Devices/BcacheCsetImpl.cc --- old/libstorage-ng-4.1.86/storage/Devices/BcacheCsetImpl.cc 2019-02-07 06:52:13.000000000 +0100 +++ new/libstorage-ng-4.1.88/storage/Devices/BcacheCsetImpl.cc 2019-02-12 15:35:03.000000000 +0100 @@ -139,7 +139,7 @@ { if (regex_match(name, cache_regex)) { - const File dev_file = prober.get_system_info().getFile(path + "/" + name + "/../dev"); + const File& dev_file = prober.get_system_info().getFile(path + "/" + name + "/../dev"); string dev = DEV_DIR "/block/" + dev_file.get<string>(); prober.add_holder(dev, get_non_impl(), [](Devicegraph* system, Device* a, Device* b) { @@ -149,7 +149,7 @@ if (regex_match(name, bdev_regex)) { - const File dev_file = prober.get_system_info().getFile(path + "/" + name + "/dev/dev"); + const File& dev_file = prober.get_system_info().getFile(path + "/" + name + "/dev/dev"); string dev = DEV_DIR "/block/" + dev_file.get<string>(); prober.add_holder(dev, get_non_impl(), [](Devicegraph* system, Device* a, Device* b) { @@ -159,7 +159,7 @@ if (regex_match(name, volume_regex)) { - const File dev_file = prober.get_system_info().getFile(path + "/" + name + "/../dev"); + const File& dev_file = prober.get_system_info().getFile(path + "/" + name + "/../dev"); string dev = DEV_DIR "/block/" + dev_file.get<string>(); prober.add_holder(dev, get_non_impl(), [](Devicegraph* system, Device* a, Device* b) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.1.86/storage/Devices/BcacheImpl.cc new/libstorage-ng-4.1.88/storage/Devices/BcacheImpl.cc --- old/libstorage-ng-4.1.86/storage/Devices/BcacheImpl.cc 2019-02-07 06:52:13.000000000 +0100 +++ new/libstorage-ng-4.1.88/storage/Devices/BcacheImpl.cc 2019-02-12 15:35:03.000000000 +0100 @@ -84,7 +84,7 @@ sequential_cutoff(0), type(BcacheType::BACKED), writeback_percent(0) { string tmp; - + if(getChildValue(node, "type", tmp)) type = toValueWithFallback(tmp, BcacheType::BACKED); @@ -197,11 +197,11 @@ is_backed(Prober& prober, const string& short_name) { string dev_path = SYSFS_DIR "/devices/virtual/block/" + short_name + "/dev"; - File dev_file = prober.get_system_info().getFile(dev_path); + const File& dev_file = prober.get_system_info().getFile(dev_path); string majorminor = dev_file.get<string>(); string backing_dev_path = SYSFS_DIR "/devices/virtual/block/" + short_name + "/bcache/../dev"; - File backing_dev_file = prober.get_system_info().getFile(backing_dev_path); + const File& backing_dev_file = prober.get_system_info().getFile(backing_dev_path); string backing_majorminor = backing_dev_file.get<string>(); return majorminor != backing_majorminor; @@ -233,7 +233,7 @@ static CacheMode - parse_mode(File cache_mode_file) + parse_mode(const File& cache_mode_file) { string modes = cache_mode_file.get<string>(); regex rgx("\\[(.*)\\]"); @@ -249,6 +249,7 @@ } } + // mapping between human string of libstorage-ng and bcache sysfs sizes static const map<std::string, unsigned long long> size_mapping = { { "k", KiB }, @@ -256,7 +257,9 @@ { "G", GiB } }; - static unsigned long long parse_size(File file) + + static unsigned long long + parse_size(const File& file) { string size_s = file.get<string>(); regex rgx("(\\d+\\.?\\d*)([kMG])?"); @@ -279,6 +282,7 @@ return result; } + void Bcache::Impl::probe_pass_1a(Prober& prober) { @@ -286,19 +290,19 @@ SystemInfo& system_info = prober.get_system_info(); - const File size_file = system_info.getFile(SYSFS_DIR + get_sysfs_path() + "/size"); + const File& size_file = system_info.getFile(SYSFS_DIR + get_sysfs_path() + "/size"); set_region(Region(0, size_file.get<unsigned long long>(), 512)); if(get_type() == BcacheType::BACKED) { - const File cache_mode_file = system_info.getFile(SYSFS_DIR + get_sysfs_path() + "/bcache/cache_mode"); + const File& cache_mode_file = system_info.getFile(SYSFS_DIR + get_sysfs_path() + "/bcache/cache_mode"); set_cache_mode(parse_mode(cache_mode_file)); - const File writeback_percent_file = system_info.getFile(SYSFS_DIR + get_sysfs_path() + "/bcache/writeback_percent"); + const File& writeback_percent_file = system_info.getFile(SYSFS_DIR + get_sysfs_path() + "/bcache/writeback_percent"); set_writeback_percent(writeback_percent_file.get<unsigned>()); - const File sequential_cutoff_file = system_info.getFile(SYSFS_DIR + get_sysfs_path() + "/bcache/sequential_cutoff"); + const File& sequential_cutoff_file = system_info.getFile(SYSFS_DIR + get_sysfs_path() + "/bcache/sequential_cutoff"); set_sequential_cutoff(parse_size(sequential_cutoff_file)); } } @@ -312,7 +316,7 @@ if(get_type() == BcacheType::BACKED) { // Creating relationship with its backing device - const File dev_file = prober.get_system_info().getFile(SYSFS_DIR + get_sysfs_path() + "/bcache/../dev"); + const File& dev_file = prober.get_system_info().getFile(SYSFS_DIR + get_sysfs_path() + "/bcache/../dev"); string dev = DEV_DIR "/block/" + dev_file.get<string>(); prober.add_holder(dev, get_non_impl(), [](Devicegraph* system, Device* a, Device* b) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.1.86/storage/Devices/BlkDeviceImpl.cc new/libstorage-ng-4.1.88/storage/Devices/BlkDeviceImpl.cc --- old/libstorage-ng-4.1.86/storage/Devices/BlkDeviceImpl.cc 2019-02-07 06:52:13.000000000 +0100 +++ new/libstorage-ng-4.1.88/storage/Devices/BlkDeviceImpl.cc 2019-02-12 15:35:03.000000000 +0100 @@ -131,9 +131,9 @@ void BlkDevice::Impl::probe_size(Prober& prober) { - const File size_file = prober.get_system_info().getFile(SYSFS_DIR + get_sysfs_path() + "/size"); - const File logical_block_size_file = prober.get_system_info().getFile(SYSFS_DIR + get_sysfs_path() + - "/queue/logical_block_size"); + const File& size_file = prober.get_system_info().getFile(SYSFS_DIR + get_sysfs_path() + "/size"); + const File& logical_block_size_file = prober.get_system_info().getFile(SYSFS_DIR + get_sysfs_path() + + "/queue/logical_block_size"); // size is always in 512 byte blocks unsigned long long a = size_file.get<unsigned long long>(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.1.86/storage/Devices/DasdImpl.cc new/libstorage-ng-4.1.88/storage/Devices/DasdImpl.cc --- old/libstorage-ng-4.1.86/storage/Devices/DasdImpl.cc 2019-02-07 06:52:13.000000000 +0100 +++ new/libstorage-ng-4.1.88/storage/Devices/DasdImpl.cc 2019-02-12 15:35:03.000000000 +0100 @@ -1,6 +1,6 @@ /* * Copyright (c) [2014-2015] Novell, Inc. - * Copyright (c) [2016-2018] SUSE LLC + * Copyright (c) [2016-2019] SUSE LLC * * All Rights Reserved. * @@ -203,11 +203,24 @@ { Partitionable::Impl::probe_pass_1a(prober); - const File rotational_file = prober.get_system_info().getFile(SYSFS_DIR + get_sysfs_path() + - "/queue/rotational"); + const File& rotational_file = prober.get_system_info().getFile(SYSFS_DIR + get_sysfs_path() + + "/queue/rotational"); rotational = rotational_file.get<bool>(); - const Dasdview dasdview = prober.get_system_info().getDasdview(get_name()); + // For DASDs using virtio-blk the dasdtool does not work. So + // it is assumed that those DASDs are CDL formatted ECKDs. See + // bsc #1112037. Might be fragile. + + if (boost::starts_with(get_name(), DEV_DIR "/vd")) + { + type = DasdType::ECKD; + + format = DasdFormat::CDL; + + return; + } + + const Dasdview& dasdview = prober.get_system_info().getDasdview(get_name()); bus_id = dasdview.get_bus_id(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.1.86/storage/Devices/DiskImpl.cc new/libstorage-ng-4.1.88/storage/Devices/DiskImpl.cc --- old/libstorage-ng-4.1.86/storage/Devices/DiskImpl.cc 2019-02-07 06:52:13.000000000 +0100 +++ new/libstorage-ng-4.1.88/storage/Devices/DiskImpl.cc 2019-02-12 15:35:03.000000000 +0100 @@ -124,8 +124,8 @@ SystemInfo& system_info = prober.get_system_info(); - const File rotational_file = system_info.getFile(SYSFS_DIR + get_sysfs_path() + - "/queue/rotational"); + const File& rotational_file = system_info.getFile(SYSFS_DIR + get_sysfs_path() + + "/queue/rotational"); rotational = rotational_file.get<bool>(); Lsscsi::Entry entry; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.1.86/storage/Devices/DmRaidImpl.cc new/libstorage-ng-4.1.88/storage/Devices/DmRaidImpl.cc --- old/libstorage-ng-4.1.86/storage/Devices/DmRaidImpl.cc 2019-02-07 06:52:13.000000000 +0100 +++ new/libstorage-ng-4.1.88/storage/Devices/DmRaidImpl.cc 2019-02-12 15:35:03.000000000 +0100 @@ -157,8 +157,8 @@ { Partitionable::Impl::probe_pass_1a(prober); - const File rotational_file = prober.get_system_info().getFile(SYSFS_DIR + get_sysfs_path() + - "/queue/rotational"); + const File& rotational_file = prober.get_system_info().getFile(SYSFS_DIR + get_sysfs_path() + + "/queue/rotational"); rotational = rotational_file.get<bool>(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.1.86/storage/Devices/LuksImpl.cc new/libstorage-ng-4.1.88/storage/Devices/LuksImpl.cc --- old/libstorage-ng-4.1.86/storage/Devices/LuksImpl.cc 2019-02-07 06:52:13.000000000 +0100 +++ new/libstorage-ng-4.1.88/storage/Devices/LuksImpl.cc 2019-02-12 15:35:03.000000000 +0100 @@ -362,7 +362,7 @@ if (is_active()) { - const File size_file = prober.get_system_info().getFile(SYSFS_DIR + get_sysfs_path() + "/size"); + const File& size_file = prober.get_system_info().getFile(SYSFS_DIR + get_sysfs_path() + "/size"); set_region(Region(0, size_file.get<unsigned long long>(), 512)); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.1.86/storage/Devices/MultipathImpl.cc new/libstorage-ng-4.1.88/storage/Devices/MultipathImpl.cc --- old/libstorage-ng-4.1.86/storage/Devices/MultipathImpl.cc 2019-02-07 06:52:13.000000000 +0100 +++ new/libstorage-ng-4.1.88/storage/Devices/MultipathImpl.cc 2019-02-12 15:35:03.000000000 +0100 @@ -195,8 +195,8 @@ { Partitionable::Impl::probe_pass_1a(prober); - const File rotational_file = prober.get_system_info().getFile(SYSFS_DIR + get_sysfs_path() + - "/queue/rotational"); + const File& rotational_file = prober.get_system_info().getFile(SYSFS_DIR + get_sysfs_path() + + "/queue/rotational"); rotational = rotational_file.get<bool>(); const CmdMultipath& cmd_multipath = prober.get_system_info().getCmdMultipath(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.1.86/storage/Devices/PartitionableImpl.cc new/libstorage-ng-4.1.88/storage/Devices/PartitionableImpl.cc --- old/libstorage-ng-4.1.86/storage/Devices/PartitionableImpl.cc 2019-02-07 06:52:13.000000000 +0100 +++ new/libstorage-ng-4.1.88/storage/Devices/PartitionableImpl.cc 2019-02-12 15:35:03.000000000 +0100 @@ -90,18 +90,18 @@ BlkDevice::Impl::probe_size(prober); - const File alignment_offset_file = prober.get_system_info().getFile(SYSFS_DIR + get_sysfs_path() + - "/alignment_offset"); + const File& alignment_offset_file = prober.get_system_info().getFile(SYSFS_DIR + get_sysfs_path() + + "/alignment_offset"); topology.set_alignment_offset(alignment_offset_file.get<int>()); - const File optimal_io_size_file = prober.get_system_info().getFile(SYSFS_DIR + get_sysfs_path() + - "/queue/optimal_io_size"); + const File& optimal_io_size_file = prober.get_system_info().getFile(SYSFS_DIR + get_sysfs_path() + + "/queue/optimal_io_size"); topology.set_optimal_io_size(optimal_io_size_file.get<int>()); if (get_dm_table_name().empty()) { - const File range_file = prober.get_system_info().getFile(SYSFS_DIR + get_sysfs_path() + - "/ext_range"); + const File& range_file = prober.get_system_info().getFile(SYSFS_DIR + get_sysfs_path() + + "/ext_range"); range = range_file.get<int>(); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.1.86/storage/Prober.cc new/libstorage-ng-4.1.88/storage/Prober.cc --- old/libstorage-ng-4.1.86/storage/Prober.cc 2019-02-07 06:52:13.000000000 +0100 +++ new/libstorage-ng-4.1.88/storage/Prober.cc 2019-02-12 15:35:03.000000000 +0100 @@ -54,6 +54,8 @@ SysBlockEntries probe_sys_block_entries(SystemInfo& system_info) { + const Arch& arch = system_info.getArch(); + SysBlockEntries sys_block_entries; for (const string& short_name : system_info.getDir(SYSFS_DIR "/block")) @@ -65,7 +67,7 @@ // skip devices without node in /dev (bsc #1076971) - check must // happen before 'udevadm info' call - const CmdStat cmd_stat = system_info.getCmdStat(name); + const CmdStat& cmd_stat = system_info.getCmdStat(name); if (!cmd_stat.is_blk()) continue; @@ -88,10 +90,10 @@ continue; } - const CmdUdevadmInfo udevadminfo = system_info.getCmdUdevadmInfo(name); + const CmdUdevadmInfo& udevadminfo = system_info.getCmdUdevadmInfo(name); - const File range_file = system_info.getFile(SYSFS_DIR + udevadminfo.get_path() + - "/ext_range"); + const File& range_file = system_info.getFile(SYSFS_DIR + udevadminfo.get_path() + + "/ext_range"); if (boost::starts_with(short_name, "dasd")) { @@ -113,6 +115,21 @@ continue; } + // On S/390 disks using virtio-blk (name /dev/vd*) and + // with a DASD partition table are considered DASDs. See + // bsc #1112037. Might be fragile. + + if (arch.is_s390() && boost::starts_with(short_name, "vd")) + { + const Parted& parted = system_info.getParted(name); + if (parted.get_label() == PtType::DASD) + { + sys_block_entries.dasds.push_back(short_name); + + continue; + } + } + if (true) // for disks all remaining names are allowed { if (range_file.get<int>() <= 1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.1.86/testsuite/probe/Makefile.am new/libstorage-ng-4.1.88/testsuite/probe/Makefile.am --- old/libstorage-ng-4.1.86/testsuite/probe/Makefile.am 2019-02-07 06:52:13.000000000 +0100 +++ new/libstorage-ng-4.1.88/testsuite/probe/Makefile.am 2019-02-12 15:35:03.000000000 +0100 @@ -11,7 +11,7 @@ disk.test multipath1.test multipath+luks1.test md1.test md2.test \ md3.test lvm1.test lvm2.test lvm-errors1.test luks+lvm1.test \ lvm+luks1.test luks1.test luks2.test \ - bcache1.test bcache2.test btrfs1.test dasd1.test dasd2.test \ + bcache1.test bcache2.test btrfs1.test dasd1.test dasd2.test dasd3.test \ external-journal.test \ dmraid1.test md-imsm1.test md-ddf1.test nfs1.test ntfs1.test xen1.test \ ambiguous1.test @@ -37,6 +37,7 @@ btrfs1-mockup.xml btrfs1-devicegraph.xml \ dasd1-mockup.xml dasd1-devicegraph.xml \ dasd2-mockup.xml dasd2-devicegraph.xml \ + dasd3-mockup.xml dasd3-devicegraph.xml \ md1-mockup.xml md1-devicegraph.xml \ md2-mockup.xml md2-devicegraph.xml \ md3-mockup.xml md3-devicegraph.xml \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.1.86/testsuite/probe/dasd3-devicegraph.xml new/libstorage-ng-4.1.88/testsuite/probe/dasd3-devicegraph.xml --- old/libstorage-ng-4.1.86/testsuite/probe/dasd3-devicegraph.xml 1970-01-01 01:00:00.000000000 +0100 +++ new/libstorage-ng-4.1.88/testsuite/probe/dasd3-devicegraph.xml 2019-02-12 15:35:03.000000000 +0100 @@ -0,0 +1,32 @@ +<?xml version="1.0"?> +<!-- written by hand --> +<Devicegraph> + <Devices> + <Dasd> + <sid>42</sid> + <name>/dev/vda</name> + <sysfs-name>vda</sysfs-name> + <sysfs-path>/devices/css0/0.0.0000/0.0.0000/virtio0/block/vda</sysfs-path> + <region> + <length>1803060</length> + <block-size>4096</block-size> + </region> + <udev-path>ccw-0.0.0000</udev-path> + <topology/> + <range>256</range> + <bus-id></bus-id> + <rotational>true</rotational> + <type>ECKD</type> + <format>CDL</format> + </Dasd> + <DasdPt> + <sid>43</sid> + </DasdPt> + </Devices> + <Holders> + <User> + <source-sid>42</source-sid> + <target-sid>43</target-sid> + </User> + </Holders> +</Devicegraph> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.1.86/testsuite/probe/dasd3-mockup.xml new/libstorage-ng-4.1.88/testsuite/probe/dasd3-mockup.xml --- old/libstorage-ng-4.1.86/testsuite/probe/dasd3-mockup.xml 1970-01-01 01:00:00.000000000 +0100 +++ new/libstorage-ng-4.1.88/testsuite/probe/dasd3-mockup.xml 2019-02-12 15:35:03.000000000 +0100 @@ -0,0 +1,121 @@ +<?xml version="1.0"?> +<!-- written by hand --> +<Mockup> + <Commands> + <Command> + <name>/bin/ls -1 --sort=none '/sys/block'</name> + <stdout>vda</stdout> + </Command> + <Command> + <name>/sbin/blkid -c '/dev/null'</name> + </Command> + <Command> + <name>/sbin/udevadm info '/dev/vda'</name> + <stdout>P: /devices/css0/0.0.0000/0.0.0000/virtio0/block/vda</stdout> + <stdout>N: vda</stdout> + <stdout>S: disk/by-path/ccw-0.0.0000</stdout> + <stdout>E: DEVLINKS=/dev/disk/by-path/ccw-0.0.0000</stdout> + <stdout>E: DEVNAME=/dev/vda</stdout> + <stdout>E: DEVPATH=/devices/css0/0.0.0000/0.0.0000/virtio0/block/vda</stdout> + <stdout>E: DEVTYPE=disk</stdout> + <stdout>E: ID_PATH=ccw-0.0.0000</stdout> + <stdout>E: ID_PATH_TAG=ccw-0_0_0000</stdout> + <stdout>E: MAJOR=254</stdout> + <stdout>E: MINOR=0</stdout> + <stdout>E: SUBSYSTEM=block</stdout> + <stdout>E: TAGS=:systemd:</stdout> + </Command> + <Command> + <name>/sbin/udevadm settle --timeout=20</name> + </Command> + <Command> + <name>/usr/bin/getconf PAGESIZE</name> + <stdout>4096</stdout> + </Command> + <Command> + <name>/usr/bin/test -d '/sys/firmware/efi/vars'</name> + <exit-code>1</exit-code> + </Command> + <Command> + <name>/usr/bin/uname -m</name> + <stdout>s390x</stdout> + </Command> + <Command> + <name>/usr/sbin/parted --script --machine '/dev/vda' unit s print</name> + <stdout>BYT;</stdout> + <stdout>/dev/vda:14424480s:dasd:512:4096:dasd:IBM S390 DASD drive:;</stdout> + </Command> + <Command> + <name>/sbin/multipath -d -v 2 -ll</name> + </Command> + <Command> + <name>/sbin/dmraid --sets=active -ccc</name> + <stdout>no raid disks</stdout> + <exit-code>1</exit-code> + </Command> + <Command> + <name>/usr/bin/stat --format '%f' '/dev/vda'</name> + <stdout>61b0</stdout> + </Command> + </Commands> + <Files> + <File> + <name>/etc/fstab</name> + </File> + <File> + <name>/proc/mounts</name> + <content>sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0</content> + <content>proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0</content> + <content>devtmpfs /dev devtmpfs rw,nosuid,size=1015244k,nr_inodes=253811,mode=755 0 0</content> + <content>securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0</content> + <content>tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0</content> + <content>devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0</content> + <content>tmpfs /run tmpfs rw,nosuid,nodev,mode=755 0 0</content> + <content>tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,mode=755 0 0</content> + <content>cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd 0 0</content> + <content>pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0</content> + <content>cgroup /sys/fs/cgroup/net_cls,net_prio cgroup rw,nosuid,nodev,noexec,relatime,net_cls,net_prio 0 0</content> + <content>cgroup /sys/fs/cgroup/pids cgroup rw,nosuid,nodev,noexec,relatime,pids 0 0</content> + <content>cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct 0 0</content> + <content>cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0</content> + <content>cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0</content> + <content>cgroup /sys/fs/cgroup/hugetlb cgroup rw,nosuid,nodev,noexec,relatime,hugetlb 0 0</content> + <content>cgroup /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event 0 0</content> + <content>cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0</content> + <content>cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0</content> + <content>cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0</content> + <content>systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=24,pgrp=1,timeout=0,minproto=5,maxproto=5,direct 0 0</content> + <content>mqueue /dev/mqueue mqueue rw,relatime 0 0</content> + <content>debugfs /sys/kernel/debug debugfs rw,relatime 0 0</content> + <content>tmpfs /run/user/0 tmpfs rw,nosuid,nodev,relatime,size=204436k,mode=700 0 0</content> + </File> + <File> + <name>/proc/swaps</name> + <content>Filename Type Size Used Priority</content> + </File> + <File> + <name>/sys/devices/css0/0.0.0000/0.0.0000/virtio0/block/vda/size</name> + <content>14424480</content> + </File> + <File> + <name>/sys/devices/css0/0.0.0000/0.0.0000/virtio0/block/vda/queue/logical_block_size</name> + <content>4096</content> + </File> + <File> + <name>/sys/devices/css0/0.0.0000/0.0.0000/virtio0/block/vda/alignment_offset</name> + <content>0</content> + </File> + <File> + <name>/sys/devices/css0/0.0.0000/0.0.0000/virtio0/block/vda/queue/optimal_io_size</name> + <content>0</content> + </File> + <File> + <name>/sys/devices/css0/0.0.0000/0.0.0000/virtio0/block/vda/queue/rotational</name> + <content>1</content> + </File> + <File> + <name>/sys/devices/css0/0.0.0000/0.0.0000/virtio0/block/vda/ext_range</name> + <content>256</content> + </File> + </Files> +</Mockup> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.1.86/testsuite/probe/dasd3.cc new/libstorage-ng-4.1.88/testsuite/probe/dasd3.cc --- old/libstorage-ng-4.1.86/testsuite/probe/dasd3.cc 1970-01-01 01:00:00.000000000 +0100 +++ new/libstorage-ng-4.1.88/testsuite/probe/dasd3.cc 2019-02-12 15:35:03.000000000 +0100 @@ -0,0 +1,41 @@ + +#define BOOST_TEST_DYN_LINK +#define BOOST_TEST_MODULE libstorage + +#include <iostream> +#include <boost/test/unit_test.hpp> + +#include "storage/Environment.h" +#include "storage/Storage.h" +#include "storage/DevicegraphImpl.h" +#include "storage/UsedFeatures.h" + +#include "testsuite/helpers/TsCmp.h" + + +using namespace std; +using namespace storage; + + +BOOST_AUTO_TEST_CASE(probe) +{ + set_logger(get_stdout_logger()); + + Environment environment(true, ProbeMode::READ_MOCKUP, TargetMode::DIRECT); + environment.set_mockup_filename("dasd3-mockup.xml"); + + Storage storage(environment); + storage.probe(); + + const Devicegraph* probed = storage.get_probed(); + probed->check(); + + Devicegraph* staging = storage.get_staging(); + staging->load("dasd3-devicegraph.xml"); + staging->check(); + + TsCmpDevicegraph cmp(*probed, *staging); + BOOST_CHECK_MESSAGE(cmp.ok(), cmp); + + BOOST_CHECK_BITWISE_EQUAL(probed->used_features(), (uint64_t)(UF_DASD)); +}
