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 2023-01-03 15:04:37
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libstorage-ng (Old)
 and      /work/SRC/openSUSE:Factory/.libstorage-ng.new.1563 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libstorage-ng"

Tue Jan  3 15:04:37 2023 rev:192 rq:1046426 version:4.5.60

Changes:
--------
--- /work/SRC/openSUSE:Factory/libstorage-ng/libstorage-ng.changes      
2022-12-20 20:20:50.613995507 +0100
+++ /work/SRC/openSUSE:Factory/.libstorage-ng.new.1563/libstorage-ng.changes    
2023-01-03 15:04:47.174307056 +0100
@@ -1,0 +2,20 @@
+Tue Jan 3 07:59:29 UTC 2023 - aschn...@suse.com
+
+- merge gh#openSUSE/libstorage-ng#909
+- simplify code
+- 4.5.60
+
+--------------------------------------------------------------------
+Mon Jan 2 15:38:27 UTC 2023 - aschn...@suse.com
+
+- merge gh#openSUSE/libstorage-ng#908
+- use new json output of btrfs-progs if available
+- 4.5.59
+
+--------------------------------------------------------------------
+Mon Jan 2 03:32:25 UTC 2023 - aschn...@suse.com
+
+- Translated using Weblate (Indonesian) (bsc#1149754)
+- 4.5.58
+
+--------------------------------------------------------------------

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

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

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

Other differences:
------------------
++++++ libstorage-ng.spec ++++++
--- /var/tmp/diff_new_pack.QrbMGs/_old  2023-01-03 15:04:47.730310301 +0100
+++ /var/tmp/diff_new_pack.QrbMGs/_new  2023-01-03 15:04:47.730310301 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package libstorage-ng
 #
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
 
 %define libname %{name}1
 Name:           libstorage-ng
-Version:        4.5.57
+Version:        4.5.60
 Release:        0
 Summary:        Library for storage management
 License:        GPL-2.0-only

++++++ libstorage-ng-4.5.57.tar.xz -> libstorage-ng-4.5.60.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.57/VERSION 
new/libstorage-ng-4.5.60/VERSION
--- old/libstorage-ng-4.5.57/VERSION    2022-12-20 07:49:56.000000000 +0100
+++ new/libstorage-ng-4.5.60/VERSION    2023-01-03 08:59:29.000000000 +0100
@@ -1 +1 @@
-4.5.57
+4.5.60
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.57/po/id.po 
new/libstorage-ng-4.5.60/po/id.po
--- old/libstorage-ng-4.5.57/po/id.po   2022-12-20 07:49:56.000000000 +0100
+++ new/libstorage-ng-4.5.60/po/id.po   2023-01-03 08:59:29.000000000 +0100
@@ -10,10 +10,10 @@
 "Project-Id-Version: YaST (@memory@)\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2022-08-05 08:30+0200\n"
-"PO-Revision-Date: 2022-07-10 13:12+0000\n"
+"PO-Revision-Date: 2023-01-02 06:13+0000\n"
 "Last-Translator: Kukuh Syafaat <syafaatku...@gmail.com>\n"
-"Language-Team: Indonesian <https://l10n.opensuse.org/projects/libstorage/ng-";
-"master/id/>\n"
+"Language-Team: Indonesian <https://l10n.opensuse.org/projects/libstorage/";
+"ng-master/id/>\n"
 "Language: id\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -1908,7 +1908,7 @@
 #. TRANSLATORS: error message
 #, c-format
 msgid "Failed to find device %s"
-msgstr ""
+msgstr "Gagal menemukan perangkat %s"
 
 #. TRANSLATORS:
 #. %1$s is replaced with the md level (e.g. RAID1),
@@ -2223,47 +2223,47 @@
 
 #. TRANSLATORS: name of partition type
 msgid "Linux Root Partition (ARM 32-bit)"
-msgstr ""
+msgstr "Partisi Root Linux (ARM 32-bit)"
 
 #. TRANSLATORS: name of partition type
 msgid "Linux Root Partition (ARM 64-bit)"
-msgstr ""
+msgstr "Partisi Root Linux (ARM 64-bit)"
 
 #. TRANSLATORS: name of partition type
 msgid "Linux Root Partition (PPC 32-bit)"
-msgstr ""
+msgstr "Partisi Root Linux (PPC 32-bit)"
 
 #. TRANSLATORS: name of partition type
 msgid "Linux Root Partition (PPC 64-bit BE)"
-msgstr ""
+msgstr "Partisi Root Linux (PPC 64-bit BE)"
 
 #. TRANSLATORS: name of partition type
 msgid "Linux Root Partition (PPC 64-bit LE)"
-msgstr ""
+msgstr "Partisi Root Linux (PPC 64-bit LE)"
 
 #. TRANSLATORS: name of partition type
 msgid "Linux Root Partition (RISC-V 32-bit)"
-msgstr ""
+msgstr "Partisi Root Linux (RISC-V 32-bit)"
 
 #. TRANSLATORS: name of partition type
 msgid "Linux Root Partition (RISC-V 64-bit)"
-msgstr ""
+msgstr "Partisi Root Linux (RISC-V 64-bit)"
 
 #. TRANSLATORS: name of partition type
 msgid "Linux Root Partition (S/390 32-bit)"
-msgstr ""
+msgstr "Partisi Root Linux (S/390 32-bit)"
 
 #. TRANSLATORS: name of partition type
 msgid "Linux Root Partition (S/390 64-bit)"
-msgstr ""
+msgstr "Partisi Root Linux (S/390 64-bit)"
 
 #. TRANSLATORS: name of partition type
 msgid "Linux Root Partition (x86 32-bit)"
-msgstr ""
+msgstr "Partisi Root Linux (x86 32-bit)"
 
 #. TRANSLATORS: name of partition type
 msgid "Linux Root Partition (x86 64-bit)"
-msgstr ""
+msgstr "Partisi Root Linux (x86 64-bit)"
 
 #. TRANSLATORS: name of partition type
 msgid "Linux Server Data"
@@ -2275,47 +2275,47 @@
 
 #. TRANSLATORS: name of partition type
 msgid "Linux USR Partition (ARM 32-bit)"
-msgstr ""
+msgstr "Partisi USR Linux (ARM 32-bit)"
 
 #. TRANSLATORS: name of partition type
 msgid "Linux USR Partition (ARM 64-bit)"
-msgstr ""
+msgstr "Partisi USR Linux (ARM 64-bit)"
 
 #. TRANSLATORS: name of partition type
 msgid "Linux USR Partition (PPC 32-bit)"
-msgstr ""
+msgstr "Partisi USR Linux (PPC 32-bit)"
 
 #. TRANSLATORS: name of partition type
 msgid "Linux USR Partition (PPC 64-bit BE)"
-msgstr ""
+msgstr "Partisi USR Linux (PPC 64-bit BE)"
 
 #. TRANSLATORS: name of partition type
 msgid "Linux USR Partition (PPC 64-bit LE)"
-msgstr ""
+msgstr "Partisi USR Linux (PPC 64-bit LE)"
 
 #. TRANSLATORS: name of partition type
 msgid "Linux USR Partition (RISC-V 32-bit)"
-msgstr ""
+msgstr "Partisi USR Linux (RISC-V 32-bit)"
 
 #. TRANSLATORS: name of partition type
 msgid "Linux USR Partition (RISC-V 64-bit)"
-msgstr ""
+msgstr "Partisi USR Linux (RISC-V 64-bit)"
 
 #. TRANSLATORS: name of partition type
 msgid "Linux USR Partition (S/390 32-bit)"
-msgstr ""
+msgstr "Partisi USR Linux (S/390 32-bit)"
 
 #. TRANSLATORS: name of partition type
 msgid "Linux USR Partition (S/390 64-bit)"
-msgstr ""
+msgstr "Partisi USR Linux (S/390 64-bit)"
 
 #. TRANSLATORS: name of partition type
 msgid "Linux USR Partition (x86 32-bit)"
-msgstr ""
+msgstr "Partisi USR Linux (x86 32-bit)"
 
 #. TRANSLATORS: name of partition type
 msgid "Linux USR Partition (x86 64-bit)"
-msgstr ""
+msgstr "Partisi USR Linux (x86 64-bit)"
 
 #. TRANSLATORS: symbol for "mega" (best keep untranslated)
 msgid "M"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.57/storage/SystemInfo/CmdBtrfs.cc 
new/libstorage-ng-4.5.60/storage/SystemInfo/CmdBtrfs.cc
--- old/libstorage-ng-4.5.57/storage/SystemInfo/CmdBtrfs.cc     2022-12-20 
07:49:56.000000000 +0100
+++ new/libstorage-ng-4.5.60/storage/SystemInfo/CmdBtrfs.cc     2023-01-03 
08:59:29.000000000 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) [2004-2015] Novell, Inc.
- * Copyright (c) [2017-2022] SUSE LLC
+ * Copyright (c) [2017-2023] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -29,6 +29,7 @@
 #include "storage/Utils/LoggerImpl.h"
 #include "storage/Utils/StorageDefines.h"
 #include "storage/Utils/ExceptionImpl.h"
+#include "storage/Utils/JsonFile.h"
 #include "storage/SystemInfo/CmdBtrfs.h"
 #include "storage/Filesystems/BtrfsImpl.h"
 
@@ -48,10 +49,8 @@
        if ( cmd.retcode() == 0 && !cmd.stdout().empty() )
            parse( cmd.stdout() );
        else if ( ! cmd.stderr().empty() )
-       {
            ST_THROW( SystemCmdException( &cmd, "'btrfs filesystem show' 
complains: "
                                          + cmd.stderr().front() ) );
-       }
 
        // Intentionally not throwing an exception here if retcode != 0 since
        // this command might return 1 if no btrfs at all was found -- which is
@@ -161,16 +160,12 @@
 
     CmdBtrfsSubvolumeList::CmdBtrfsSubvolumeList(const key_t& key, const 
string& mount_point)
     {
-       SystemCmd::Options cmd_options(BTRFS_BIN " subvolume list -a -puq " + 
quote(mount_point),
-                                      SystemCmd::DoThrow);
-       cmd_options.mockup_key = BTRFS_BIN " subvolume list -a -puq (device:" + 
key + ")";
+       const string tmp = BTRFS_BIN " subvolume list -a -puq ";
+       SystemCmd::Options cmd_options(tmp + quote(mount_point), 
SystemCmd::DoThrow);
+       cmd_options.mockup_key = tmp + "(device:" + key + ")";
 
        SystemCmd cmd(cmd_options);
-       if (cmd.retcode() == 0)
-           parse(cmd.stdout());
-       else
-           ST_THROW(SystemCmdException(&cmd, "'btrfs subvolume list' failed, 
ret: " +
-                                       to_string(cmd.retcode())));
+       parse(cmd.stdout());
     }
 
 
@@ -261,11 +256,10 @@
 
 
     CmdBtrfsSubvolumeShow::CmdBtrfsSubvolumeShow(const key_t& key, const 
string& mount_point)
-       : uuid()
     {
-       SystemCmd::Options cmd_options(BTRFS_BIN " subvolume show " + 
quote(mount_point),
-                                      SystemCmd::DoThrow);
-       cmd_options.mockup_key = BTRFS_BIN " subvolume show (device:" + key + 
")";
+       const string tmp = BTRFS_BIN " subvolume show ";
+       SystemCmd::Options cmd_options(tmp + quote(mount_point), 
SystemCmd::DoThrow);
+       cmd_options.mockup_key = tmp + "(device:" + key + ")";
 
        SystemCmd cmd(cmd_options);
        parse(cmd.stdout());
@@ -318,16 +312,12 @@
 
     CmdBtrfsSubvolumeGetDefault::CmdBtrfsSubvolumeGetDefault(const key_t& key, 
const string& mount_point)
     {
-       SystemCmd::Options cmd_options(BTRFS_BIN " subvolume get-default " + 
quote(mount_point),
-                                      SystemCmd::DoThrow);
-       cmd_options.mockup_key = BTRFS_BIN " subvolume get-default (device:" + 
key + ")";
+       const string tmp = BTRFS_BIN " subvolume get-default ";
+       SystemCmd::Options cmd_options(tmp + quote(mount_point), 
SystemCmd::DoThrow);
+       cmd_options.mockup_key = tmp + "(device:" + key + ")";
 
        SystemCmd cmd(cmd_options);
-       if (cmd.retcode() == 0)
-           parse(cmd.stdout());
-       else
-           ST_THROW(SystemCmdException(&cmd, "'btrfs subvolume get-default' 
failed, ret: " +
-                                       to_string(cmd.retcode())));
+       parse(cmd.stdout());
     }
 
 
@@ -359,16 +349,17 @@
 
     CmdBtrfsFilesystemDf::CmdBtrfsFilesystemDf(const key_t& key, const string& 
mount_point)
     {
-       SystemCmd::Options cmd_options(BTRFS_BIN " filesystem df " + 
quote(mount_point),
-                                      SystemCmd::DoThrow);
-       cmd_options.mockup_key = BTRFS_BIN " filesystem df (device:" + key + 
")";
+       const bool json = 
BtrfsVersion::supports_json_option_for_filesystem_df();
+
+       const string tmp = BTRFS_BIN " " + string(json ? "--format json " : "") 
+ "filesystem df ";
+       SystemCmd::Options cmd_options(tmp + quote(mount_point), 
SystemCmd::DoThrow);
+       cmd_options.mockup_key = tmp + "(device:" + key + ")";
 
        SystemCmd cmd(cmd_options);
-       if (cmd.retcode() == 0)
-           parse(cmd.stdout());
+       if (json)
+           parse_json(cmd.stdout());
        else
-           ST_THROW(SystemCmdException(&cmd, "'btrfs filesystem df' failed, 
ret: " +
-                                       to_string(cmd.retcode())));
+           parse(cmd.stdout());
     }
 
 
@@ -406,6 +397,39 @@
     }
 
 
+    void
+    CmdBtrfsFilesystemDf::parse_json(const vector<string>& lines)
+    {
+       JsonFile json_file(lines);
+
+       vector<json_object*> tmp1;
+       if (!get_child_nodes(json_file.get_root(), "filesystem-df", tmp1))
+           ST_THROW(Exception("\"filesystem-df\" not found in json output of 
'btrfs filesystem df'"));
+
+       for (json_object* tmp2 : tmp1)
+       {
+           string tmp3, tmp4;
+
+           if (!get_child_value(tmp2, "bg-type", tmp3))
+               ST_THROW(Exception("\"bg-type\" not found"));
+
+           if (!get_child_value(tmp2, "bg-profile", tmp4))
+               ST_THROW(Exception("\"bg-profile\" not found"));
+
+           boost::to_upper(tmp4, locale::classic());
+
+           if (tmp3 == "Metadata")
+               metadata_raid_level = toValueWithFallback(tmp4, 
BtrfsRaidLevel::UNKNOWN);
+           else if (tmp3 == "Data")
+               data_raid_level = toValueWithFallback(tmp4, 
BtrfsRaidLevel::UNKNOWN);
+           else if (tmp3 == "Data+Metadata")
+               metadata_raid_level = data_raid_level = 
toValueWithFallback(tmp4, BtrfsRaidLevel::UNKNOWN);
+       }
+
+       y2mil(*this);
+    }
+
+
     std::ostream&
     operator<<(std::ostream& s, const CmdBtrfsFilesystemDf& 
cmd_btrfs_filesystem_df)
     {
@@ -421,16 +445,22 @@
        // There is no btrfs command line way to just query if quota is 
enabled. So we
        // assume it is enabled if 'btrfs qgroup show' does not report an error.
 
-       SystemCmd::Options cmd_options(BTRFS_BIN " qgroup show -rep --raw " + 
quote(mount_point),
-                                      SystemCmd::DoThrow);
-       cmd_options.mockup_key = BTRFS_BIN " qgroup show -rep --raw (device:" + 
key + ")";
+       const bool json = BtrfsVersion::supports_json_option_for_qgroup_show();
+
+       const string tmp = BTRFS_BIN " " + string(json ? "--format json " : "") 
+ "qgroup show -rep --raw ";
+       SystemCmd::Options cmd_options(tmp + quote(mount_point), 
SystemCmd::DoThrow);
+       cmd_options.mockup_key = tmp + "(device:" + key + ")";
        cmd_options.verify = [](int exit_code) { return exit_code == 0 || 
exit_code == 1; };
 
        SystemCmd cmd(cmd_options);
        if (cmd.retcode() == 0)
        {
            quota = true;
-           parse(cmd.stdout());
+
+           if (json)
+               parse_json(cmd.stdout());
+           else
+               parse(cmd.stdout());
        }
     }
 
@@ -438,7 +468,7 @@
     void
     CmdBtrfsQgroupShow::parse(const vector<string>& lines)
     {
-       // Output changed slightly between btrfsprogs 6.0.0 and 6.0.2. Handle 
both.
+       // Output changed slightly between btrfsprogs 6.0 and 6.0.2. Handle 
both.
 
        for (const string& line : lines)
        {
@@ -461,18 +491,10 @@
            columns[2] >> entry.exclusive;
 
            if (columns[3] != "none")
-           {
-               unsigned long long tmp;
-               columns[3] >> tmp;
-               entry.referenced_limit = tmp;
-           }
+               columns[3] >> entry.referenced_limit;
 
            if (columns[4] != "none")
-           {
-               unsigned long long tmp;
-               columns[4] >> tmp;
-               entry.exclusive_limit = tmp;
-           }
+               columns[4] >> entry.exclusive_limit;
 
            if (columns[5] != "---" && columns[5] != "-")
            {
@@ -490,6 +512,62 @@
     }
 
 
+    void
+    CmdBtrfsQgroupShow::parse_json(const vector<string>& lines)
+    {
+       JsonFile json_file(lines);
+
+       vector<json_object*> tmp1;
+       if (!get_child_nodes(json_file.get_root(), "qgroup-show", tmp1))
+           ST_THROW(Exception("\"qgroup-show\" not found in json output of 
'btrfs qgroup show'"));
+
+       for (json_object* tmp2 : tmp1)
+       {
+           Entry entry;
+
+           string tmp3;
+
+           if (!get_child_value(tmp2, "qgroupid", tmp3))
+               ST_THROW(Exception("\"qgroupid\" not found"));
+
+           entry.id = BtrfsQgroup::Impl::parse_id(tmp3);
+
+           if (!get_child_value(tmp2, "referenced", tmp3))
+               ST_THROW(Exception("\"referenced\" not found"));
+
+           tmp3 >> entry.referenced;
+
+           if (!get_child_value(tmp2, "exclusive", tmp3))
+               ST_THROW(Exception("\"exclusive\" not found"));
+
+           tmp3 >> entry.exclusive;
+
+           if (!get_child_value(tmp2, "max_referenced", tmp3))
+               ST_THROW(Exception("\"max_referenced\" not found"));
+
+           if (tmp3 != "none")
+               tmp3 >> entry.referenced_limit;
+
+           if (!get_child_value(tmp2, "max_exclusive", tmp3))
+               ST_THROW(Exception("\"max_exclusive\" not found"));
+
+           if (tmp3 != "none")
+               tmp3 >> entry.exclusive_limit;
+
+           vector<json_object*> tmp4;
+           if (!get_child_nodes(tmp2, "parents", tmp4))
+               ST_THROW(Exception("\"parents\" not found"));
+
+           for (json_object* tmp5 : tmp4)
+               
entry.parents_id.push_back(BtrfsQgroup::Impl::parse_id(json_object_get_string(tmp5)));
+
+           data.push_back(entry);
+       }
+
+       y2mil(*this);
+    }
+
+
     std::ostream&
     operator<<(std::ostream& s, const CmdBtrfsQgroupShow& 
cmd_btrfs_qgroups_show)
     {
@@ -530,4 +608,65 @@
        return s << '\n';
     }
 
+
+    void
+    BtrfsVersion::query_version()
+    {
+       if (did_set_version)
+           return;
+
+       SystemCmd cmd(BTRFS_BIN " --version", SystemCmd::DoThrow);
+       if (cmd.stdout().empty())
+           ST_THROW(SystemCmdException(&cmd, "failed to query btrfs version"));
+
+       parse_version(cmd.stdout()[0]);
+    }
+
+
+    void
+    BtrfsVersion::parse_version(const string& version)
+    {
+       // example versions: "6.0", "6.0.2"
+       const regex version_rx("btrfs-progs 
v([0-9]+)\\.([0-9]+)(\\.([0-9]+)?)?", regex::extended);
+
+       smatch match;
+
+       if (!regex_match(version, match, version_rx))
+           ST_THROW(Exception("failed to parse btrfs version"));
+
+       major = stoi(match[1]);
+       minor = stoi(match[2]);
+       patchlevel = match[4].length() == 0 ? 0 : stoi(match[4]);
+
+       y2mil("major:" << major << " minor:" << minor << " patchlevel:" << 
patchlevel);
+
+       did_set_version = true;
+    }
+
+
+    bool
+    BtrfsVersion::supports_json_option_for_filesystem_df()
+    {
+       query_version();
+
+       return major >= 7 || (major == 6 && minor >= 1);
+    }
+
+
+    bool
+    BtrfsVersion::supports_json_option_for_qgroup_show()
+    {
+       query_version();
+
+       // buggy in 6.1, reported, assume fixed in 6.1.1 (2023-01-02)
+       return major >= 7 || (major == 6 && minor >= 2) || (major == 6 && minor 
== 1 && patchlevel >= 1);
+    }
+
+
+    bool BtrfsVersion::did_set_version = false;
+
+    int BtrfsVersion::major = 0;
+    int BtrfsVersion::minor = 0;
+    int BtrfsVersion::patchlevel = 0;
+
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.57/storage/SystemInfo/CmdBtrfs.h 
new/libstorage-ng-4.5.60/storage/SystemInfo/CmdBtrfs.h
--- old/libstorage-ng-4.5.57/storage/SystemInfo/CmdBtrfs.h      2022-12-20 
07:49:56.000000000 +0100
+++ new/libstorage-ng-4.5.60/storage/SystemInfo/CmdBtrfs.h      2023-01-03 
08:59:29.000000000 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) [2004-2015] Novell, Inc.
- * Copyright (c) [2017-2022] SUSE LLC
+ * Copyright (c) [2017-2023] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -225,6 +225,7 @@
     private:
 
        void parse(const vector<string>& lines);
+       void parse_json(const vector<string>& lines);
 
        BtrfsRaidLevel metadata_raid_level = BtrfsRaidLevel::UNKNOWN;
        BtrfsRaidLevel data_raid_level = BtrfsRaidLevel::UNKNOWN;
@@ -270,6 +271,7 @@
     private:
 
        void parse(const vector<string>& lines);
+       void parse_json(const vector<string>& lines);
 
        bool quota = false;
 
@@ -277,6 +279,27 @@
 
     };
 
+
+    class BtrfsVersion
+    {
+    public:
+
+       static void query_version();
+       static void parse_version(const string& version);
+
+       static bool supports_json_option_for_filesystem_df();
+       static bool supports_json_option_for_qgroup_show();
+
+    private:
+
+       static bool did_set_version;
+
+       static int major;
+       static int minor;
+       static int patchlevel;
+
+    };
+
 }
 
 #endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.57/storage/SystemInfo/CmdParted.cc 
new/libstorage-ng-4.5.60/storage/SystemInfo/CmdParted.cc
--- old/libstorage-ng-4.5.57/storage/SystemInfo/CmdParted.cc    2022-12-20 
07:49:56.000000000 +0100
+++ new/libstorage-ng-4.5.60/storage/SystemInfo/CmdParted.cc    2023-01-03 
08:59:29.000000000 +0100
@@ -44,11 +44,12 @@
     Parted::Parted(const string& device)
        : device(device)
     {
-       SystemCmd::Options options(PARTED_BIN " --script " +
-                                  string(PartedVersion::supports_json_option() 
? "--json " : "--machine ") +
-                                  quote(device) + " unit s print", 
SystemCmd::DoThrow);
+       const bool json = PartedVersion::supports_json_option();
+
+       SystemCmd::Options options(PARTED_BIN " --script " + string(json ? 
"--json " : "--machine ") + quote(device) +
+                                  " unit s print", SystemCmd::DoThrow);
        options.verify = [](int) { return true; };
-       if (!PartedVersion::supports_json_option())
+       if (!json)
            options.env.push_back("PARTED_PRINT_NUMBER_OF_PARTITION_SLOTS=1");
 
        SystemCmd cmd(options);
@@ -101,7 +102,7 @@
 
            json_object* tmp1;
            if (!get_child_node(json_file.get_root(), "disk", tmp1))
-               ST_THROW(Exception("\"disk\" not found in json output of 
parted"));
+               ST_THROW(Exception("\"disk\" not found in json output of 
'parted'"));
 
            scan_device(tmp1);
 
@@ -109,7 +110,7 @@
            {
                vector<json_object*> tmp2;
                if (!get_child_nodes(tmp1, "partitions", tmp2))
-                   ST_THROW(Exception("\"partitions\" not found in json output 
of parted"));
+                   ST_THROW(Exception("\"partitions\" not found in json output 
of 'parted'"));
 
                for (json_object* tmp3 : tmp2)
                    scan_entry(tmp3);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.5.57/testsuite/SystemInfo/Makefile.am 
new/libstorage-ng-4.5.60/testsuite/SystemInfo/Makefile.am
--- old/libstorage-ng-4.5.57/testsuite/SystemInfo/Makefile.am   2022-12-20 
07:49:56.000000000 +0100
+++ new/libstorage-ng-4.5.60/testsuite/SystemInfo/Makefile.am   2023-01-03 
08:59:29.000000000 +0100
@@ -7,9 +7,12 @@
 LDADD = ../../storage/libstorage-ng.la -lboost_unit_test_framework
 
 check_PROGRAMS =                                                               
\
-       blkid.test btrfs-filesystem-df.test btrfs-filesystem-show.test          
\
+       blkid.test btrfs-filesystem-df-60.test btrfs-filesystem-df-61.test      
\
+       btrfs-filesystem-show.test                                              
\
        btrfs-subvolume-get-default.test btrfs-subvolume-list.test              
\
-       btrfs-subvolume-show.test btrfs-qgroup-show.test cryptsetup-status.test 
\
+       btrfs-subvolume-show.test btrfs-qgroup-show-60.test                     
\
+       btrfs-qgroup-show-602.test btrfs-qgroup-show-611.test                   
\
+       cryptsetup-status.test                                                  
\
        cryptsetup-bitlk-dump.test cryptsetup-luks-dump.test dasdview.test      
\
        dir.test dmraid.test dumpe2fs.test resize2fs.test ntfsresize.test       
\
        dmsetup-info.test dmsetup-table.test lsattr.test lsscsi.test lvs.test   
\
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.5.57/testsuite/SystemInfo/btrfs-filesystem-df-60.cc 
new/libstorage-ng-4.5.60/testsuite/SystemInfo/btrfs-filesystem-df-60.cc
--- old/libstorage-ng-4.5.57/testsuite/SystemInfo/btrfs-filesystem-df-60.cc     
1970-01-01 01:00:00.000000000 +0100
+++ new/libstorage-ng-4.5.60/testsuite/SystemInfo/btrfs-filesystem-df-60.cc     
2023-01-03 08:59:29.000000000 +0100
@@ -0,0 +1,100 @@
+
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_MODULE libstorage
+
+#include <boost/test/unit_test.hpp>
+#include <boost/algorithm/string.hpp>
+
+#include "storage/SystemInfo/CmdBtrfs.h"
+#include "storage/Utils/Mockup.h"
+#include "storage/Utils/SystemCmd.h"
+#include "storage/Utils/StorageDefines.h"
+
+
+using namespace std;
+using namespace storage;
+
+
+void
+check(const vector<string>& input, const vector<string>& output)
+{
+    Mockup::set_mode(Mockup::Mode::PLAYBACK);
+    Mockup::set_command(BTRFS_BIN " --version", RemoteCommand({ "btrfs-progs 
v6.0" }, {}, 0));
+    Mockup::set_command(BTRFS_BIN " filesystem df (device:/dev/system/btrfs)", 
input);
+
+    CmdBtrfsFilesystemDf cmd_btrfs_filesystem_get_default(
+       CmdBtrfsFilesystemDf::key_t("/dev/system/btrfs"), "/btrfs"
+    );
+
+    ostringstream parsed;
+    parsed.setf(std::ios::boolalpha);
+    parsed << cmd_btrfs_filesystem_get_default;
+
+    string lhs = parsed.str();
+    string rhs;
+
+    if (!output.empty())
+       rhs = boost::join(output, "\n");
+
+    BOOST_CHECK_EQUAL(lhs, rhs);
+}
+
+
+BOOST_AUTO_TEST_CASE(parse1)
+{
+    vector<string> input = {
+       "Data, single: total=8.00MiB, used=64.00KiB",
+       "System, DUP: total=8.00MiB, used=16.00KiB",
+       "Metadata, DUP: total=102.25MiB, used=112.00KiB",
+       "GlobalReserve, single: total=16.00MiB, used=0.00B"
+    };
+
+    vector<string> output = {
+       "metadata-raid-level:DUP data-raid-level:SINGLE"
+    };
+
+    check(input, output);
+}
+
+
+/*
+ * In mixed mode metadata and data are identical and reported together.
+ */
+BOOST_AUTO_TEST_CASE(parse2)
+{
+    vector<string> input = {
+       "System, single: total=4.00MiB, used=4.00KiB",
+       "Data+Metadata, single: total=840.00MiB, used=220.00KiB",
+       "GlobalReserve, single: total=16.00MiB, used=0.00B"
+    };
+
+    vector<string> output = {
+       "metadata-raid-level:SINGLE data-raid-level:SINGLE"
+    };
+
+    check(input, output);
+}
+
+
+/*
+ * During a balance job to convert the RAID level several RAID levels can be
+ * reported. Since this is only an interim state it is not handle in all its
+ * beauty. Instead just the last reported RAID level is used.
+ */
+BOOST_AUTO_TEST_CASE(parse3)
+{
+    vector<string> input = {
+       "Data, RAID10: total=4.00GiB, used=3.35GiB",
+       "Data, RAID5: total=3.00GiB, used=509.71MiB",
+       "System, RAID10: total=64.00MiB, used=16.00KiB",
+       "Metadata, RAID10: total=512.00MiB, used=247.55MiB",
+       "Metadata, RAID5: total=288.00MiB, used=5.56MiB",
+       "GlobalReserve, single: total=23.91MiB, used=0.00B"
+    };
+
+    vector<string> output = {
+       "metadata-raid-level:RAID5 data-raid-level:RAID5"
+    };
+
+    check(input, output);
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.5.57/testsuite/SystemInfo/btrfs-filesystem-df-61.cc 
new/libstorage-ng-4.5.60/testsuite/SystemInfo/btrfs-filesystem-df-61.cc
--- old/libstorage-ng-4.5.57/testsuite/SystemInfo/btrfs-filesystem-df-61.cc     
1970-01-01 01:00:00.000000000 +0100
+++ new/libstorage-ng-4.5.60/testsuite/SystemInfo/btrfs-filesystem-df-61.cc     
2023-01-03 08:59:29.000000000 +0100
@@ -0,0 +1,197 @@
+
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_MODULE libstorage
+
+#include <boost/test/unit_test.hpp>
+#include <boost/algorithm/string.hpp>
+
+#include "storage/SystemInfo/CmdBtrfs.h"
+#include "storage/Utils/Mockup.h"
+#include "storage/Utils/SystemCmd.h"
+#include "storage/Utils/StorageDefines.h"
+
+
+using namespace std;
+using namespace storage;
+
+
+void
+check(const vector<string>& input, const vector<string>& output)
+{
+    Mockup::set_mode(Mockup::Mode::PLAYBACK);
+    Mockup::set_command(BTRFS_BIN " --version", RemoteCommand({ "btrfs-progs 
v6.1" }, {}, 0));
+    Mockup::set_command(BTRFS_BIN " --format json filesystem df 
(device:/dev/system/btrfs)", input);
+
+    CmdBtrfsFilesystemDf cmd_btrfs_filesystem_get_default(
+       CmdBtrfsFilesystemDf::key_t("/dev/system/btrfs"), "/btrfs"
+    );
+
+    ostringstream parsed;
+    parsed.setf(std::ios::boolalpha);
+    parsed << cmd_btrfs_filesystem_get_default;
+
+    string lhs = parsed.str();
+    string rhs;
+
+    if (!output.empty())
+       rhs = boost::join(output, "\n");
+
+    BOOST_CHECK_EQUAL(lhs, rhs);
+}
+
+
+BOOST_AUTO_TEST_CASE(parse1)
+{
+    vector<string> input = {
+       "{",
+       "  \"__header\": {",
+       "    \"version\": \"1\"",
+       "  },",
+       "  \"filesystem-df\": [",
+       "    {",
+       "      \"bg-type\": \"Data\",",
+       "      \"bg-profile\": \"single\",",
+       "      \"total\": \"8388608\",",
+       "      \"used\": \"0\"",
+       "    },",
+       "    {",
+       "      \"bg-type\": \"System\",",
+       "      \"bg-profile\": \"DUP\",",
+       "      \"total\": \"8388608\",",
+       "      \"used\": \"16384\"",
+       "    },",
+       "    {",
+       "      \"bg-type\": \"Metadata\",",
+       "      \"bg-profile\": \"DUP\",",
+       "      \"total\": \"268435456\",",
+       "      \"used\": \"196608\"",
+       "    },",
+       "    {",
+       "      \"bg-type\": \"GlobalReserve\",",
+       "      \"bg-profile\": \"single\",",
+       "      \"total\": \"3670016\",",
+       "      \"used\": \"0\"",
+       "    }",
+       "  ]",
+       "}"
+    };
+
+    vector<string> output = {
+       "metadata-raid-level:DUP data-raid-level:SINGLE"
+    };
+
+    check(input, output);
+}
+
+
+/*
+ * In mixed mode metadata and data are identical and reported together.
+ *
+ * 'barrel create btrfs --size 1g /dev/sdd --mkfs-options --mixed --path /test'
+ */
+BOOST_AUTO_TEST_CASE(parse2)
+{
+    vector<string> input = {
+       "{",
+       "  \"__header\": {",
+       "    \"version\": \"1\"",
+       "  },",
+       "  \"filesystem-df\": [",
+       "    {",
+       "      \"bg-type\": \"System\",",
+       "      \"bg-profile\": \"single\",",
+       "      \"total\": \"4194304\",",
+       "      \"used\": \"4096\"",
+       "    },",
+       "    {",
+       "      \"bg-type\": \"Data+Metadata\",",
+       "      \"bg-profile\": \"single\",",
+       "      \"total\": \"8388608\",",
+       "      \"used\": \"32768\"",
+       "    },",
+       "    {",
+       "      \"bg-type\": \"GlobalReserve\",",
+       "      \"bg-profile\": \"single\",",
+       "      \"total\": \"917504\",",
+       "      \"used\": \"0\"",
+       "    }",
+       "  ]",
+       "}"
+    };
+
+    vector<string> output = {
+       "metadata-raid-level:SINGLE data-raid-level:SINGLE"
+    };
+
+    check(input, output);
+}
+
+
+/*
+ * During a balance job to convert the RAID level several RAID levels can be
+ * reported. Since this is only an interim state it is not handle in all its
+ * beauty. Instead just the last reported RAID level is used.
+ *
+ * 'barrel create btrfs --pool-name "HDDs (512 B)" --size 50g --devices 4 
--profiles raid10 --path /test'
+ * 'btrfs balance start -dconvert=raid5 -mconvert=raid5 /test'
+ */
+BOOST_AUTO_TEST_CASE(parse3)
+{
+    vector<string> input = {
+       "{",
+       "  \"__header\": {",
+       "    \"version\": \"1\"",
+       "  },",
+       "  \"filesystem-df\": [",
+       "    {",
+       "      \"bg-type\": \"Data\",",
+       "      \"bg-profile\": \"RAID10\",",
+       "      \"total\": \"4294967296\",",
+       "      \"used\": \"4197752832\"",
+       "    },",
+       "    {",
+       "      \"bg-type\": \"Data\",",
+       "      \"bg-profile\": \"RAID5\",",
+       "      \"total\": \"6442450944\",",
+       "      \"used\": \"97214464\"",
+       "    },",
+       "    {",
+       "      \"bg-type\": \"System\",",
+       "      \"bg-profile\": \"RAID10\",",
+       "      \"total\": \"33554432\",",
+       "      \"used\": \"0\"",
+       "    },",
+       "    {",
+       "      \"bg-type\": \"System\",",
+       "      \"bg-profile\": \"RAID5\",",
+       "      \"total\": \"50331648\",",
+       "      \"used\": \"16384\"",
+       "    },",
+       "    {",
+       "      \"bg-type\": \"Metadata\",",
+       "      \"bg-profile\": \"RAID10\",",
+       "      \"total\": \"1073741824\",",
+       "      \"used\": \"4521984\"",
+       "    },",
+       "    {",
+       "      \"bg-type\": \"Metadata\",",
+       "      \"bg-profile\": \"RAID5\",",
+       "      \"total\": \"2214592512\",",
+       "      \"used\": \"262144\"",
+       "    },",
+       "    {",
+       "      \"bg-type\": \"GlobalReserve\",",
+       "      \"bg-profile\": \"single\",",
+       "      \"total\": \"4702208\",",
+       "      \"used\": \"0\"",
+       "    }",
+       "  ]",
+       "}"
+    };
+
+    vector<string> output = {
+       "metadata-raid-level:RAID5 data-raid-level:RAID5"
+    };
+
+    check(input, output);
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.5.57/testsuite/SystemInfo/btrfs-filesystem-df.cc 
new/libstorage-ng-4.5.60/testsuite/SystemInfo/btrfs-filesystem-df.cc
--- old/libstorage-ng-4.5.57/testsuite/SystemInfo/btrfs-filesystem-df.cc        
2022-12-20 07:49:56.000000000 +0100
+++ new/libstorage-ng-4.5.60/testsuite/SystemInfo/btrfs-filesystem-df.cc        
1970-01-01 01:00:00.000000000 +0100
@@ -1,101 +0,0 @@
-
-#define BOOST_TEST_DYN_LINK
-#define BOOST_TEST_MODULE libstorage
-
-#include <boost/test/unit_test.hpp>
-#include <boost/algorithm/string.hpp>
-
-#include "storage/SystemInfo/CmdBtrfs.h"
-#include "storage/Utils/Mockup.h"
-#include "storage/Utils/SystemCmd.h"
-#include "storage/Utils/StorageDefines.h"
-
-
-using namespace std;
-using namespace storage;
-
-
-void
-check(const vector<string>& input, const vector<string>& output)
-{
-    Mockup::set_mode(Mockup::Mode::PLAYBACK);
-    Mockup::set_command(BTRFS_BIN " filesystem df (device:/dev/system/btrfs)", 
input);
-
-    CmdBtrfsFilesystemDf cmd_btrfs_filesystem_get_default(
-       CmdBtrfsFilesystemDf::key_t("/dev/system/btrfs"), "/btrfs"
-    );
-
-    ostringstream parsed;
-    parsed.setf(std::ios::boolalpha);
-    parsed << cmd_btrfs_filesystem_get_default;
-
-    string lhs = parsed.str();
-    string rhs;
-
-    if (!output.empty())
-       rhs = boost::join(output, "\n");
-
-    BOOST_CHECK_EQUAL(lhs, rhs);
-}
-
-
-BOOST_AUTO_TEST_CASE(parse1)
-{
-    vector<string> input = {
-       "Data, single: total=8.00MiB, used=64.00KiB",
-       "System, DUP: total=8.00MiB, used=16.00KiB",
-       "Metadata, DUP: total=102.25MiB, used=112.00KiB",
-       "GlobalReserve, single: total=16.00MiB, used=0.00B"
-    };
-
-    vector<string> output = {
-       "metadata-raid-level:DUP data-raid-level:SINGLE"
-    };
-
-    check(input, output);
-}
-
-
-/*
- * In mixed mode metadata and data are identical and reported
- * together.
- */
-BOOST_AUTO_TEST_CASE(parse2)
-{
-    vector<string> input = {
-       "System, single: total=4.00MiB, used=4.00KiB",
-       "Data+Metadata, single: total=840.00MiB, used=220.00KiB",
-       "GlobalReserve, single: total=16.00MiB, used=0.00B"
-    };
-
-    vector<string> output = {
-       "metadata-raid-level:SINGLE data-raid-level:SINGLE"
-    };
-
-    check(input, output);
-}
-
-
-/*
- * During a balance job to convert the RAID level several RAID levels
- * can be reported. Since this is only an interim state is not handle
- * it all its beauty. Instead just the last reported RAID level is
- * used.
- */
-BOOST_AUTO_TEST_CASE(parse3)
-{
-    vector<string> input = {
-       "Data, RAID10: total=4.00GiB, used=3.35GiB",
-       "Data, RAID5: total=3.00GiB, used=509.71MiB",
-       "System, RAID10: total=64.00MiB, used=16.00KiB",
-       "Metadata, RAID10: total=512.00MiB, used=247.55MiB",
-       "Metadata, RAID5: total=288.00MiB, used=5.56MiB",
-       "GlobalReserve, single: total=23.91MiB, used=0.00B"
-    };
-
-    vector<string> output = {
-       "metadata-raid-level:RAID5 data-raid-level:RAID5"
-    };
-
-    check(input, output);
-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.5.57/testsuite/SystemInfo/btrfs-qgroup-show-60.cc 
new/libstorage-ng-4.5.60/testsuite/SystemInfo/btrfs-qgroup-show-60.cc
--- old/libstorage-ng-4.5.57/testsuite/SystemInfo/btrfs-qgroup-show-60.cc       
1970-01-01 01:00:00.000000000 +0100
+++ new/libstorage-ng-4.5.60/testsuite/SystemInfo/btrfs-qgroup-show-60.cc       
2023-01-03 08:59:29.000000000 +0100
@@ -0,0 +1,64 @@
+
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_MODULE libstorage
+
+#include <numeric>
+#include <boost/test/unit_test.hpp>
+
+#include "storage/SystemInfo/CmdBtrfs.h"
+#include "storage/Utils/Mockup.h"
+#include "storage/Utils/SystemCmd.h"
+#include "storage/Utils/StorageDefines.h"
+
+
+using namespace std;
+using namespace storage;
+
+
+void
+check(const vector<string>& input, const vector<string>& output)
+{
+    Mockup::set_mode(Mockup::Mode::PLAYBACK);
+    Mockup::set_command(BTRFS_BIN " --version", RemoteCommand({ "btrfs-progs 
v6.0" }, {}, 0));
+    Mockup::set_command(BTRFS_BIN " qgroup show -rep --raw 
(device:/dev/system/btrfs)", input);
+
+    CmdBtrfsQgroupShow cmd_btrfs_qgroup_show(
+       CmdBtrfsQgroupShow::key_t("/dev/system/btrfs"), "/btrfs"
+    );
+
+    ostringstream parsed;
+    parsed.setf(std::ios::boolalpha);
+    parsed << cmd_btrfs_qgroup_show;
+
+    string lhs = parsed.str();
+    string rhs = accumulate(output.begin(), output.end(), ""s,
+                           [](auto a, auto b) { return a + b + "\n"; });
+
+    BOOST_CHECK_EQUAL(lhs, rhs);
+}
+
+
+BOOST_AUTO_TEST_CASE(parse)
+{
+    set_logger(get_stdout_logger());
+
+    vector<string> input = {
+       "qgroupid         rfer         excl     max_rfer     max_excl parent  ",
+       "--------         ----         ----     --------     -------- ------  ",
+       "0/5             16384        16384         none         none ---     ",
+       "0/256           16384        16384         none         none 1/0     ",
+       "0/257           16384        16384         none         none ---     ",
+       "1/0             32768        32768         none   2147483648 ---     ",
+       "2/0                 0            0   1073741824         none ---     "
+    };
+
+    vector<string> output = {
+       "id:0/5 referenced:16384 exclusive:16384",
+       "id:0/256 referenced:16384 exclusive:16384 parents:1/0",
+       "id:0/257 referenced:16384 exclusive:16384",
+       "id:1/0 referenced:32768 exclusive:32768 exclusive-limit:2147483648",
+       "id:2/0 referenced:0 exclusive:0 referenced-limit:1073741824"
+    };
+
+    check(input, output);
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.5.57/testsuite/SystemInfo/btrfs-qgroup-show-602.cc 
new/libstorage-ng-4.5.60/testsuite/SystemInfo/btrfs-qgroup-show-602.cc
--- old/libstorage-ng-4.5.57/testsuite/SystemInfo/btrfs-qgroup-show-602.cc      
1970-01-01 01:00:00.000000000 +0100
+++ new/libstorage-ng-4.5.60/testsuite/SystemInfo/btrfs-qgroup-show-602.cc      
2023-01-03 08:59:29.000000000 +0100
@@ -0,0 +1,64 @@
+
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_MODULE libstorage
+
+#include <numeric>
+#include <boost/test/unit_test.hpp>
+
+#include "storage/SystemInfo/CmdBtrfs.h"
+#include "storage/Utils/Mockup.h"
+#include "storage/Utils/SystemCmd.h"
+#include "storage/Utils/StorageDefines.h"
+
+
+using namespace std;
+using namespace storage;
+
+
+void
+check(const vector<string>& input, const vector<string>& output)
+{
+    Mockup::set_mode(Mockup::Mode::PLAYBACK);
+    Mockup::set_command(BTRFS_BIN " --version", RemoteCommand({ "btrfs-progs 
v6.0.2" }, {}, 0));
+    Mockup::set_command(BTRFS_BIN " qgroup show -rep --raw 
(device:/dev/system/btrfs)", input);
+
+    CmdBtrfsQgroupShow cmd_btrfs_qgroup_show(
+       CmdBtrfsQgroupShow::key_t("/dev/system/btrfs"), "/btrfs"
+    );
+
+    ostringstream parsed;
+    parsed.setf(std::ios::boolalpha);
+    parsed << cmd_btrfs_qgroup_show;
+
+    string lhs = parsed.str();
+    string rhs = accumulate(output.begin(), output.end(), ""s,
+                           [](auto a, auto b) { return a + b + "\n"; });
+
+    BOOST_CHECK_EQUAL(lhs, rhs);
+}
+
+
+BOOST_AUTO_TEST_CASE(parse)
+{
+    set_logger(get_stdout_logger());
+
+    vector<string> input = {
+       "Qgroupid    Referenced    Exclusive  Max referenced  Max exclusive 
Parent     Path ",
+       "--------    ----------    ---------  --------------  ------------- 
------     ---- ",
+       "0/5              16384        16384            none           none -   
       <toplevel>",
+       "0/256            16384        16384            none           none 1/0 
       a",
+       "0/257            16384        16384            none           none -   
       b",
+       "1/0              32768        32768            none     2147483648 -   
       <0 member qgroups>",
+       "2/0                  0            0      1073741824           none -   
       <0 member qgroups>"
+    };
+
+    vector<string> output = {
+       "id:0/5 referenced:16384 exclusive:16384",
+       "id:0/256 referenced:16384 exclusive:16384 parents:1/0",
+       "id:0/257 referenced:16384 exclusive:16384",
+       "id:1/0 referenced:32768 exclusive:32768 exclusive-limit:2147483648",
+       "id:2/0 referenced:0 exclusive:0 referenced-limit:1073741824"
+    };
+
+    check(input, output);
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.5.57/testsuite/SystemInfo/btrfs-qgroup-show-611.cc 
new/libstorage-ng-4.5.60/testsuite/SystemInfo/btrfs-qgroup-show-611.cc
--- old/libstorage-ng-4.5.57/testsuite/SystemInfo/btrfs-qgroup-show-611.cc      
1970-01-01 01:00:00.000000000 +0100
+++ new/libstorage-ng-4.5.60/testsuite/SystemInfo/btrfs-qgroup-show-611.cc      
2023-01-03 08:59:29.000000000 +0100
@@ -0,0 +1,127 @@
+
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_MODULE libstorage
+
+#include <numeric>
+#include <boost/test/unit_test.hpp>
+
+#include "storage/SystemInfo/CmdBtrfs.h"
+#include "storage/Utils/Mockup.h"
+#include "storage/Utils/SystemCmd.h"
+#include "storage/Utils/StorageDefines.h"
+
+
+using namespace std;
+using namespace storage;
+
+
+void
+check(const vector<string>& input, const vector<string>& output)
+{
+    Mockup::set_mode(Mockup::Mode::PLAYBACK);
+    Mockup::set_command(BTRFS_BIN " --version", RemoteCommand({ "btrfs-progs 
v6.1.1" }, {}, 0));
+    Mockup::set_command(BTRFS_BIN " --format json qgroup show -rep --raw 
(device:/dev/system/btrfs)", input);
+
+    CmdBtrfsQgroupShow cmd_btrfs_qgroup_show(
+       CmdBtrfsQgroupShow::key_t("/dev/system/btrfs"), "/btrfs"
+    );
+
+    ostringstream parsed;
+    parsed.setf(std::ios::boolalpha);
+    parsed << cmd_btrfs_qgroup_show;
+
+    string lhs = parsed.str();
+    string rhs = accumulate(output.begin(), output.end(), ""s,
+                           [](auto a, auto b) { return a + b + "\n"; });
+
+    BOOST_CHECK_EQUAL(lhs, rhs);
+}
+
+
+BOOST_AUTO_TEST_CASE(parse)
+{
+    set_logger(get_stdout_logger());
+
+    vector<string> input = {
+       "{",
+       "  \"__header\": {",
+       "    \"version\": \"1\"",
+       "  },",
+       "  \"qgroup-show\": [",
+       "    {",
+       "      \"qgroupid\": \"0/5\",",
+       "      \"referenced\": \"16384\",",
+       "      \"max_referenced\": \"none\",",
+       "      \"exclusive\": \"16384\",",
+       "      \"max_exclusive\": \"none\",",
+       "      \"path\": \"\",",
+       "      \"parents\": [",
+       "      ],",
+       "      \"children\": [",
+       "      ]",
+       "    },",
+       "    {",
+       "      \"qgroupid\": \"0/256\",",
+       "      \"referenced\": \"16384\",",
+       "      \"max_referenced\": \"none\",",
+       "      \"exclusive\": \"16384\",",
+       "      \"max_exclusive\": \"none\",",
+       "      \"path\": \"a\",",
+       "      \"parents\": [",
+       "        \"1/0\"",
+       "      ],",
+       "      \"children\": [",
+       "      ]",
+       "    },",
+       "    {",
+       "      \"qgroupid\": \"0/257\",",
+       "      \"referenced\": \"16384\",",
+       "      \"max_referenced\": \"none\",",
+       "      \"exclusive\": \"16384\",",
+       "      \"max_exclusive\": \"none\",",
+       "      \"path\": \"b\",",
+       "      \"parents\": [",
+       "      ],",
+       "      \"children\": [",
+       "      ]",
+       "    },",
+       "    {",
+       "      \"qgroupid\": \"1/0\",",
+       "      \"referenced\": \"32768\",",
+       "      \"max_referenced\": \"none\",",
+       "      \"exclusive\": \"32768\",",
+       "      \"max_exclusive\": \"2147483648\",",
+       "      \"path\": \"\",",
+       "      \"parents\": [",
+       "      ],",
+       "      \"children\": [",
+       "        \"0/256\",",
+       "        \"0/257\"",
+       "      ]",
+       "    },",
+       "    {",
+       "      \"qgroupid\": \"2/0\",",
+       "      \"referenced\": \"0\",",
+       "      \"max_referenced\": \"1073741824\",",
+       "      \"exclusive\": \"0\",",
+       "      \"max_exclusive\": \"none\",",
+       "      \"path\": \"\",",
+       "      \"parents\": [",
+       "      ],",
+       "      \"children\": [",
+       "      ]",
+       "    }",
+       "  ]",
+       "}"
+    };
+
+    vector<string> output = {
+       "id:0/5 referenced:16384 exclusive:16384",
+       "id:0/256 referenced:16384 exclusive:16384 parents:1/0",
+       "id:0/257 referenced:16384 exclusive:16384",
+       "id:1/0 referenced:32768 exclusive:32768 exclusive-limit:2147483648",
+       "id:2/0 referenced:0 exclusive:0 referenced-limit:1073741824"
+    };
+
+    check(input, output);
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.5.57/testsuite/SystemInfo/btrfs-qgroup-show.cc 
new/libstorage-ng-4.5.60/testsuite/SystemInfo/btrfs-qgroup-show.cc
--- old/libstorage-ng-4.5.57/testsuite/SystemInfo/btrfs-qgroup-show.cc  
2022-12-20 07:49:56.000000000 +0100
+++ new/libstorage-ng-4.5.60/testsuite/SystemInfo/btrfs-qgroup-show.cc  
1970-01-01 01:00:00.000000000 +0100
@@ -1,85 +0,0 @@
-
-#define BOOST_TEST_DYN_LINK
-#define BOOST_TEST_MODULE libstorage
-
-#include <numeric>
-#include <boost/test/unit_test.hpp>
-
-#include "storage/SystemInfo/CmdBtrfs.h"
-#include "storage/Utils/Mockup.h"
-#include "storage/Utils/SystemCmd.h"
-#include "storage/Utils/StorageDefines.h"
-
-
-using namespace std;
-using namespace storage;
-
-
-void
-check(const vector<string>& input, const vector<string>& output)
-{
-    Mockup::set_mode(Mockup::Mode::PLAYBACK);
-    Mockup::set_command(BTRFS_BIN " qgroup show -rep --raw 
(device:/dev/system/btrfs)", input);
-
-    CmdBtrfsQgroupShow cmd_btrfs_qgroup_show(
-       CmdBtrfsQgroupShow::key_t("/dev/system/btrfs"), "/btrfs"
-    );
-
-    ostringstream parsed;
-    parsed.setf(std::ios::boolalpha);
-    parsed << cmd_btrfs_qgroup_show;
-
-    string lhs = parsed.str();
-    string rhs = accumulate(output.begin(), output.end(), ""s,
-                           [](auto a, auto b) { return a + b + "\n"; });
-
-    BOOST_CHECK_EQUAL(lhs, rhs);
-}
-
-
-BOOST_AUTO_TEST_CASE(parse_btrfsprogs_6_0_0)
-{
-    vector<string> input = {
-       "qgroupid         rfer         excl     max_rfer     max_excl parent  ",
-       "--------         ----         ----     --------     -------- ------  ",
-       "0/5             16384        16384         none         none ---     ",
-       "0/256           16384        16384         none         none 1/0     ",
-       "0/257           16384        16384         none         none ---     ",
-       "1/0             32768        32768         none   2147483648 ---     ",
-       "2/0                 0            0   1073741824         none ---     "
-    };
-
-    vector<string> output = {
-       "id:0/5 referenced:16384 exclusive:16384",
-       "id:0/256 referenced:16384 exclusive:16384 parents:1/0",
-       "id:0/257 referenced:16384 exclusive:16384",
-       "id:1/0 referenced:32768 exclusive:32768 exclusive-limit:2147483648",
-       "id:2/0 referenced:0 exclusive:0 referenced-limit:1073741824"
-    };
-
-    check(input, output);
-}
-
-
-BOOST_AUTO_TEST_CASE(parse_btrfsprogs_6_0_2)
-{
-    vector<string> input = {
-       "Qgroupid    Referenced    Exclusive  Max referenced  Max exclusive 
Parent     Path ",
-       "--------    ----------    ---------  --------------  ------------- 
------     ---- ",
-       "0/5              16384        16384            none           none -   
       <toplevel>",
-       "0/256            16384        16384            none           none 1/0 
       a",
-       "0/257            16384        16384            none           none -   
       b",
-       "1/0              32768        32768            none     2147483648 -   
       <0 member qgroups>",
-       "2/0                  0            0      1073741824           none -   
       <0 member qgroups>"
-    };
-
-    vector<string> output = {
-       "id:0/5 referenced:16384 exclusive:16384",
-       "id:0/256 referenced:16384 exclusive:16384 parents:1/0",
-       "id:0/257 referenced:16384 exclusive:16384",
-       "id:1/0 referenced:32768 exclusive:32768 exclusive-limit:2147483648",
-       "id:2/0 referenced:0 exclusive:0 referenced-limit:1073741824"
-    };
-
-    check(input, output);
-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.5.57/testsuite/probe/ambiguous1-mockup.xml 
new/libstorage-ng-4.5.60/testsuite/probe/ambiguous1-mockup.xml
--- old/libstorage-ng-4.5.57/testsuite/probe/ambiguous1-mockup.xml      
2022-12-20 07:49:56.000000000 +0100
+++ new/libstorage-ng-4.5.60/testsuite/probe/ambiguous1-mockup.xml      
2023-01-03 08:59:29.000000000 +0100
@@ -11,6 +11,11 @@
       <stdout>/dev/sdc: UUID="d090269c-1a57-4bd3-a182-5a300b818a72" 
UUID_SUB="ac4735ad-3176-4f88-a9d8-7744f9c56548" BLOCK_SIZE="4096" TYPE="btrfs" 
PTUUID="401f8ba4" PTTYPE="dos"</stdout>
     </Command>
     <Command>
+      <!-- output faked -->
+      <name>/sbin/btrfs --version</name>
+      <stdout>btrfs-progs v6.0</stdout>
+    </Command>
+    <Command>
       <name>/sbin/btrfs filesystem df (device:/dev/sdc)</name>
       <stdout>Data, single: total=8.00MiB, used=0.00B</stdout>
       <stdout>System, DUP: total=8.00MiB, used=16.00KiB</stdout>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.5.57/testsuite/probe/btrfs1-mockup.xml 
new/libstorage-ng-4.5.60/testsuite/probe/btrfs1-mockup.xml
--- old/libstorage-ng-4.5.57/testsuite/probe/btrfs1-mockup.xml  2022-12-20 
07:49:56.000000000 +0100
+++ new/libstorage-ng-4.5.60/testsuite/probe/btrfs1-mockup.xml  2023-01-03 
08:59:29.000000000 +0100
@@ -16,6 +16,11 @@
       <stdout>/dev/sr0: BLOCK_SIZE="2048" UUID="2020-05-04-12-32-55-98" 
LABEL="openSUSE-Tumbleweed-DVD-x86_6422" TYPE="iso9660" PTUUID="0af58e48" 
PTTYPE="dos"</stdout>
     </Command>
     <Command>
+      <!-- output faked -->
+      <name>/sbin/btrfs --version</name>
+      <stdout>btrfs-progs v6.0</stdout>
+    </Command>
+    <Command>
       <name>/sbin/btrfs filesystem df (device:/dev/sda2)</name>
       <stdout>Data, single: total=3.01GiB, used=2.89GiB</stdout>
       <stdout>System, DUP: total=8.00MiB, used=16.00KiB</stdout>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.5.57/testsuite/probe/btrfs2-mockup.xml 
new/libstorage-ng-4.5.60/testsuite/probe/btrfs2-mockup.xml
--- old/libstorage-ng-4.5.57/testsuite/probe/btrfs2-mockup.xml  2022-12-20 
07:49:56.000000000 +0100
+++ new/libstorage-ng-4.5.60/testsuite/probe/btrfs2-mockup.xml  2023-01-03 
08:59:29.000000000 +0100
@@ -22,6 +22,11 @@
       <stdout>/dev/sr0: UUID="2019-03-14-20-45-41-74" 
LABEL="SLE-15-SP1-Installer-DVD-x86.001" TYPE="iso9660" PTUUID="196d0a60" 
PTTYPE="dos"</stdout>
     </Command>
     <Command>
+      <!-- output faked -->
+      <name>/sbin/btrfs --version</name>
+      <stdout>btrfs-progs v6.0</stdout>
+    </Command>
+    <Command>
       <name>/sbin/btrfs filesystem df (device:/dev/sdb1)</name>
       <stdout>Data, RAID0: total=818.25MiB, used=256.00KiB</stdout>
       <stdout>System, RAID1: total=8.00MiB, used=16.00KiB</stdout>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.5.57/testsuite/probe/btrfs3-mockup.xml 
new/libstorage-ng-4.5.60/testsuite/probe/btrfs3-mockup.xml
--- old/libstorage-ng-4.5.57/testsuite/probe/btrfs3-mockup.xml  2022-12-20 
07:49:56.000000000 +0100
+++ new/libstorage-ng-4.5.60/testsuite/probe/btrfs3-mockup.xml  2023-01-03 
08:59:29.000000000 +0100
@@ -10,6 +10,11 @@
       <stdout>/dev/sdc1: UUID="e5d4d2c5-090a-46b3-9c77-b3176ce00a94" 
UUID_SUB="82a5a0b7-3cf1-409d-8aca-0fd490f4be2b" TYPE="btrfs" 
PARTUUID="c1413aab-aba8-471e-819a-06c56cc55a83"</stdout>
     </Command>
     <Command>
+      <!-- output faked -->
+      <name>/sbin/btrfs --version</name>
+      <stdout>btrfs-progs v6.0</stdout>
+    </Command>
+    <Command>
       <name>/sbin/btrfs filesystem df (device:/dev/sdc1)</name>
       <stdout>Data, single: total=8.00MiB, used=64.00KiB</stdout>
       <stdout>System, DUP: total=8.00MiB, used=16.00KiB</stdout>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.5.57/testsuite/probe/btrfs4-mockup.xml 
new/libstorage-ng-4.5.60/testsuite/probe/btrfs4-mockup.xml
--- old/libstorage-ng-4.5.57/testsuite/probe/btrfs4-mockup.xml  2022-12-20 
07:49:56.000000000 +0100
+++ new/libstorage-ng-4.5.60/testsuite/probe/btrfs4-mockup.xml  2023-01-03 
08:59:29.000000000 +0100
@@ -11,6 +11,11 @@
       <stdout>/dev/sdd1: UUID="048815b8-5bea-423d-a739-51c81c3eba2c" 
UUID_SUB="87592a17-fcab-4ebb-8e29-22b29480a75d" TYPE="btrfs" 
PARTUUID="db35c54e-4869-4976-90aa-f91eb380fc6d"</stdout>
     </Command>
     <Command>
+      <!-- output faked -->
+      <name>/sbin/btrfs --version</name>
+      <stdout>btrfs-progs v6.0</stdout>
+    </Command>
+    <Command>
       <name>/sbin/btrfs filesystem df (device:/dev/sdd1)</name>
       <stdout>Data, single: total=8.00MiB, used=64.00KiB</stdout>
       <stdout>System, DUP: total=8.00MiB, used=16.00KiB</stdout>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.5.57/testsuite/probe/btrfs5-mockup.xml 
new/libstorage-ng-4.5.60/testsuite/probe/btrfs5-mockup.xml
--- old/libstorage-ng-4.5.57/testsuite/probe/btrfs5-mockup.xml  2022-12-20 
07:49:56.000000000 +0100
+++ new/libstorage-ng-4.5.60/testsuite/probe/btrfs5-mockup.xml  2023-01-03 
08:59:29.000000000 +0100
@@ -11,6 +11,11 @@
       <stdout>/dev/sdb1: UUID="d7c6297b-c069-4ab5-983e-e599c607e9b8" 
UUID_SUB="b7ff0f47-5efc-476c-8edb-d39f944aa3ab" BLOCK_SIZE="4096" TYPE="btrfs" 
PARTUUID="1ebc0646-6f26-4f95-9462-265c97508c9c"</stdout>
     </Command>
     <Command>
+      <!-- output faked -->
+      <name>/sbin/btrfs --version</name>
+      <stdout>btrfs-progs v6.0</stdout>
+    </Command>
+    <Command>
       <name>/sbin/btrfs filesystem df (device:/dev/sdb1)</name>
       <stdout>Data, single: total=8.00MiB, used=0.00B</stdout>
       <stdout>System, single: total=4.00MiB, used=16.00KiB</stdout>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.5.57/testsuite/probe/integrity-mockup.xml 
new/libstorage-ng-4.5.60/testsuite/probe/integrity-mockup.xml
--- old/libstorage-ng-4.5.57/testsuite/probe/integrity-mockup.xml       
2022-12-20 07:49:56.000000000 +0100
+++ new/libstorage-ng-4.5.60/testsuite/probe/integrity-mockup.xml       
2023-01-03 08:59:29.000000000 +0100
@@ -34,6 +34,11 @@
       <stdout>/dev/mapper/crypto: UUID="737d1600-e45a-4084-883d-a0b239399e8e" 
UUID_SUB="b5ad0172-3a45-403e-a71e-7bf79ad17028" BLOCK_SIZE="4096" 
TYPE="btrfs"</stdout>
     </Command>
     <Command>
+      <!-- output faked -->
+      <name>/sbin/btrfs --version</name>
+      <stdout>btrfs-progs v6.0</stdout>
+    </Command>
+    <Command>
       <name>/sbin/btrfs filesystem df (device:/dev/mapper/crypto)</name>
       <stdout>Data, single: total=8.00MiB, used=0.00B</stdout>
       <stdout>System, DUP: total=8.00MiB, used=16.00KiB</stdout>

Reply via email to