From 5de20e21592d2763b5d8709dd8508e9228f17a17 Mon Sep 17 00:00:00 2001 From: James Antill Date: Thu, 26 May 2022 10:13:41 -0400 Subject: [PATCH] Auto sync2gitlab import of libblockdev-2.24-8.el8.src.rpm --- .gitignore | 1 + ...ec-Fix-setting-locale-for-util-calls.patch | 119 + 0002-exec-polling-fixes.patch | 792 +++++++ 0003-LVM-thin-metadata-calculation-fix.patch | 914 ++++++++ ...default-key-size-for-non-XTS-ciphers.patch | 97 + ...workarounds-for-some-LVM-test-issues.patch | 157 ++ 0006-Fix-vdo-stats-calculation.patch | 27 + EMPTY | 1 - libblockdev.spec | 2068 +++++++++++++++++ sources | 1 + 10 files changed, 4176 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 0001-exec-Fix-setting-locale-for-util-calls.patch create mode 100644 0002-exec-polling-fixes.patch create mode 100644 0003-LVM-thin-metadata-calculation-fix.patch create mode 100644 0004-Fix-default-key-size-for-non-XTS-ciphers.patch create mode 100644 0005-Add-workarounds-for-some-LVM-test-issues.patch create mode 100644 0006-Fix-vdo-stats-calculation.patch delete mode 100644 EMPTY create mode 100644 libblockdev.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d5d4253 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/libblockdev-2.24.tar.gz diff --git a/0001-exec-Fix-setting-locale-for-util-calls.patch b/0001-exec-Fix-setting-locale-for-util-calls.patch new file mode 100644 index 0000000..159fa91 --- /dev/null +++ b/0001-exec-Fix-setting-locale-for-util-calls.patch @@ -0,0 +1,119 @@ +From d9571c2f1cf612ce0d479e428f7b1ae24944d140 Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +Date: Wed, 10 Jun 2020 17:03:28 +0200 +Subject: [PATCH] exec: Fix setting locale for util calls + +This actually fixes two issue. The _utils_exec_and_report_progress +function didn't set the LC_ALL=C environment variable to make sure +we get output in English. And also we shouldn't use setenv in the +GSpawnChildSetupFunc, it's actually example of what not to do in +g_spawn_async documentation. This fix uses g_environ_setenv and +passes the new environment to the g_spawn call. +--- + src/utils/exec.c | 26 +++++++++++++++++--------- + tests/utils_test.py | 7 +++++++ + 2 files changed, 24 insertions(+), 9 deletions(-) + +diff --git a/src/utils/exec.c b/src/utils/exec.c +index 9293930..37bd960 100644 +--- a/src/utils/exec.c ++++ b/src/utils/exec.c +@@ -140,11 +140,6 @@ static void log_done (guint64 task_id, gint exit_code) { + return; + } + +-static void set_c_locale(gpointer user_data __attribute__((unused))) { +- if (setenv ("LC_ALL", "C", 1) != 0) +- g_warning ("Failed to set LC_ALL=C for a child process!"); +-} +- + /** + * bd_utils_exec_and_report_error: + * @argv: (array zero-terminated=1): the argv array for the call +@@ -194,6 +189,8 @@ gboolean bd_utils_exec_and_report_status_error (const gchar **argv, const BDExtr + const BDExtraArg **extra_p = NULL; + gint exit_status = 0; + guint i = 0; ++ gchar **old_env = NULL; ++ gchar **new_env = NULL; + + if (extra) { + args_len = g_strv_length ((gchar **) argv); +@@ -219,16 +216,20 @@ gboolean bd_utils_exec_and_report_status_error (const gchar **argv, const BDExtr + args[i] = NULL; + } + ++ old_env = g_get_environ (); ++ new_env = g_environ_setenv (old_env, "LC_ALL", "C", TRUE); ++ + task_id = log_running (args ? args : argv); +- success = g_spawn_sync (NULL, args ? (gchar **) args : (gchar **) argv, NULL, G_SPAWN_SEARCH_PATH, +- (GSpawnChildSetupFunc) set_c_locale, NULL, +- &stdout_data, &stderr_data, &exit_status, error); ++ success = g_spawn_sync (NULL, args ? (gchar **) args : (gchar **) argv, new_env, G_SPAWN_SEARCH_PATH, ++ NULL, NULL, &stdout_data, &stderr_data, &exit_status, error); + if (!success) { + /* error is already populated from the call */ ++ g_strfreev (new_env); + g_free (stdout_data); + g_free (stderr_data); + return FALSE; + } ++ g_strfreev (new_env); + + /* g_spawn_sync set the status in the same way waitpid() does, we need + to get the process exit code manually (this is similar to calling +@@ -297,6 +298,8 @@ static gboolean _utils_exec_and_report_progress (const gchar **argv, const BDExt + gboolean err_done = FALSE; + GString *stdout_data = g_string_new (NULL); + GString *stderr_data = g_string_new (NULL); ++ gchar **old_env = NULL; ++ gchar **new_env = NULL; + + /* TODO: share this code between functions */ + if (extra) { +@@ -325,7 +328,10 @@ static gboolean _utils_exec_and_report_progress (const gchar **argv, const BDExt + + task_id = log_running (args ? args : argv); + +- ret = g_spawn_async_with_pipes (NULL, args ? (gchar**) args : (gchar**) argv, NULL, ++ old_env = g_get_environ (); ++ new_env = g_environ_setenv (old_env, "LC_ALL", "C", TRUE); ++ ++ ret = g_spawn_async_with_pipes (NULL, args ? (gchar**) args : (gchar**) argv, new_env, + G_SPAWN_DEFAULT|G_SPAWN_SEARCH_PATH|G_SPAWN_DO_NOT_REAP_CHILD, + NULL, NULL, &pid, NULL, &out_fd, &err_fd, error); + +@@ -333,9 +339,11 @@ static gboolean _utils_exec_and_report_progress (const gchar **argv, const BDExt + /* error is already populated */ + g_string_free (stdout_data, TRUE); + g_string_free (stderr_data, TRUE); ++ g_strfreev (new_env); + g_free (args); + return FALSE; + } ++ g_strfreev (new_env); + + args_str = g_strjoinv (" ", args ? (gchar **) args : (gchar **) argv); + msg = g_strdup_printf ("Started '%s'", args_str); +diff --git a/tests/utils_test.py b/tests/utils_test.py +index 4bec3db..2bec5ed 100644 +--- a/tests/utils_test.py ++++ b/tests/utils_test.py +@@ -170,6 +170,13 @@ class UtilsExecLoggingTest(UtilsTestCase): + # exit code != 0 + self.assertTrue(BlockDev.utils_check_util_version("libblockdev-fake-util-fail", "1.1", "version", "Version:\\s(.*)")) + ++ @tag_test(TestTags.NOSTORAGE, TestTags.CORE) ++ def test_exec_locale(self): ++ """Verify that setting locale for exec functions works as expected""" ++ ++ succ, out = BlockDev.utils_exec_and_capture_output(["locale"]) ++ self.assertTrue(succ) ++ self.assertIn("LC_ALL=C", out) + + class UtilsDevUtilsTestCase(UtilsTestCase): + @tag_test(TestTags.NOSTORAGE, TestTags.CORE) +-- +2.26.2 + diff --git a/0002-exec-polling-fixes.patch b/0002-exec-polling-fixes.patch new file mode 100644 index 0000000..5982f21 --- /dev/null +++ b/0002-exec-polling-fixes.patch @@ -0,0 +1,792 @@ +From 592820b7a4300cfdc4f85ecd9548f7c2321689fc Mon Sep 17 00:00:00 2001 +From: Tomas Bzatek +Date: Wed, 16 Sep 2020 17:45:07 +0200 +Subject: [PATCH 1/5] exec: Fix polling for stdout and stderr + +The condition of having both the stdout and the stderr fds ready +may never be satisfied in the case of a full stdout buffer waiting +to be read with no output on stderr yet while both fds being still +open. In such case the old code got stuck in an endless loop and +the spawned process being stuck on writing to stdout/stderr. Let's +read data from any fd once available and only react on EOF/HUP. + +This change also makes use of POSIX poll() instead of g_poll() +as it's more clear what the return values mean - Glib docs are +vague in this regard and one can only guess. +--- + src/utils/exec.c | 32 ++++++++++++++++++-------------- + 1 file changed, 18 insertions(+), 14 deletions(-) + +diff --git a/src/utils/exec.c b/src/utils/exec.c +index 37bd960..ebbcaf2 100644 +--- a/src/utils/exec.c ++++ b/src/utils/exec.c +@@ -22,6 +22,7 @@ + #include "extra_arg.h" + #include + #include ++#include + #include + #include + #include +@@ -293,7 +294,7 @@ static gboolean _utils_exec_and_report_progress (const gchar **argv, const BDExt + gint poll_status = 0; + guint i = 0; + guint8 completion = 0; +- GPollFD fds[2] = {ZERO_INIT, ZERO_INIT}; ++ struct pollfd fds[2] = { ZERO_INIT, ZERO_INIT }; + gboolean out_done = FALSE; + gboolean err_done = FALSE; + GString *stdout_data = g_string_new (NULL); +@@ -360,13 +361,16 @@ static gboolean _utils_exec_and_report_progress (const gchar **argv, const BDExt + + fds[0].fd = out_fd; + fds[1].fd = err_fd; +- fds[0].events = G_IO_IN | G_IO_HUP | G_IO_ERR; +- fds[1].events = G_IO_IN | G_IO_HUP | G_IO_ERR; ++ fds[0].events = POLLIN | POLLHUP | POLLERR; ++ fds[1].events = POLLIN | POLLHUP | POLLERR; + while (!out_done || !err_done) { +- poll_status = g_poll (fds, 2, -1); ++ poll_status = poll (fds, 2, -1); ++ g_warn_if_fail (poll_status != 0); /* no timeout specified, zero should never be returned */ + if (poll_status < 0) { ++ if (errno == EAGAIN || errno == EINTR) ++ continue; + g_set_error (error, BD_UTILS_EXEC_ERROR, BD_UTILS_EXEC_ERROR_FAILED, +- "Failed to poll output FDs."); ++ "Failed to poll output FDs: %m"); + bd_utils_report_finished (progress_id, (*error)->message); + g_io_channel_shutdown (out_pipe, FALSE, NULL); + g_io_channel_unref (out_pipe); +@@ -375,12 +379,9 @@ static gboolean _utils_exec_and_report_progress (const gchar **argv, const BDExt + g_string_free (stdout_data, TRUE); + g_string_free (stderr_data, TRUE); + return FALSE; +- } else if (poll_status != 2) +- /* both revents fields were not filled yet */ +- continue; +- if (!(fds[0].revents & G_IO_IN)) +- out_done = TRUE; +- while (!out_done) { ++ } ++ ++ while (!out_done && (fds[0].revents & POLLIN)) { + io_status = g_io_channel_read_line (out_pipe, &line, NULL, NULL, error); + if (io_status == G_IO_STATUS_NORMAL) { + if (prog_extract && prog_extract (line, &completion)) +@@ -401,9 +402,10 @@ static gboolean _utils_exec_and_report_progress (const gchar **argv, const BDExt + return FALSE; + } + } +- if (!(fds[1].revents & G_IO_IN)) +- err_done = TRUE; +- while (!err_done) { ++ if (fds[0].revents & POLLHUP || fds[0].revents & POLLERR || fds[0].revents & POLLNVAL) ++ out_done = TRUE; ++ ++ while (!err_done && (fds[1].revents & POLLIN)) { + io_status = g_io_channel_read_line (err_pipe, &line, NULL, NULL, error); + if (io_status == G_IO_STATUS_NORMAL) { + g_string_append (stderr_data, line); +@@ -421,6 +423,8 @@ static gboolean _utils_exec_and_report_progress (const gchar **argv, const BDExt + return FALSE; + } + } ++ if (fds[1].revents & POLLHUP || fds[1].revents & POLLERR || fds[1].revents & POLLNVAL) ++ err_done = TRUE; + } + + child_ret = waitpid (pid, &status, 0); +-- +2.26.2 + + +From 3025deda9ab670a454bfe373166e49f2acd1c151 Mon Sep 17 00:00:00 2001 +From: Tomas Bzatek +Date: Fri, 25 Sep 2020 18:19:46 +0200 +Subject: [PATCH 2/5] exec: Use non-blocking read and process the buffer + manually + +Waiting for data or a newline character on one fd may create a deadlock +while the other fd is being filled with data, exhausting the pipe buffer. +Setting both stdout and stderr fds non-blocking allows us to get indication +of an empty pipe, continuing with the read cycle over remaining watched fds. + +This also gets rid of GIOChannel as no extended functionality like GSource +notifications were used, degrading GIOChannel in a simple GObject wrapper +over an fd with just a convenience read_line method that we had to get rid of +anyway. Let's use standard POSIX calls and split the read buffer manually +by matching the newline character. NULL bytes should be handled gracefully +however the stack higher up is not ready for that anyway. +--- + src/utils/exec.c | 277 +++++++++++++++++++++++++++-------------------- + 1 file changed, 159 insertions(+), 118 deletions(-) + +diff --git a/src/utils/exec.c b/src/utils/exec.c +index ebbcaf2..317fb55 100644 +--- a/src/utils/exec.c ++++ b/src/utils/exec.c +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -272,6 +273,87 @@ gboolean bd_utils_exec_and_report_status_error (const gchar **argv, const BDExtr + return TRUE; + } + ++/* buffer size in bytes used to read from stdout and stderr */ ++#define _EXEC_BUF_SIZE 64*1024 ++ ++/* similar to g_strstr_len() yet treats 'null' byte as @needle. */ ++static gchar *bd_strchr_len_null (const gchar *haystack, gssize haystack_len, const gchar needle) { ++ gchar *ret; ++ gchar *ret_null; ++ ++ ret = memchr (haystack, needle, haystack_len); ++ ret_null = memchr (haystack, 0, haystack_len); ++ if (ret && ret_null) ++ return MIN (ret, ret_null); ++ else ++ return MAX (ret, ret_null); ++} ++ ++static gboolean ++_process_fd_event (gint fd, struct pollfd *poll_fd, GString *read_buffer, GString *filtered_buffer, gsize *read_buffer_pos, gboolean *done, ++ guint64 progress_id, guint8 *progress, BDUtilsProgExtract prog_extract, GError **error) { ++ gchar buf[_EXEC_BUF_SIZE] = { 0 }; ++ ssize_t num_read; ++ gchar *line; ++ gchar *newline_pos; ++ int errno_saved; ++ gboolean eof = FALSE; ++ ++ if (! *done && (poll_fd->revents & POLLIN)) { ++ /* read until we get EOF (0) or error (-1), expecting EAGAIN */ ++ while ((num_read = read (fd, buf, _EXEC_BUF_SIZE)) > 0) ++ g_string_append_len (read_buffer, buf, num_read); ++ errno_saved = errno; ++ ++ /* process the fresh data by lines */ ++ if (read_buffer->len > *read_buffer_pos) { ++ gchar *buf_ptr; ++ gsize buf_len; ++ ++ while ((buf_ptr = read_buffer->str + *read_buffer_pos, ++ buf_len = read_buffer->len - *read_buffer_pos, ++ newline_pos = bd_strchr_len_null (buf_ptr, buf_len, '\n'))) { ++ line = g_strndup (buf_ptr, newline_pos - buf_ptr + 1); ++ if (prog_extract && prog_extract (line, progress)) ++ bd_utils_report_progress (progress_id, *progress, NULL); ++ else ++ g_string_append (filtered_buffer, line); ++ g_free (line); ++ *read_buffer_pos = newline_pos - read_buffer->str + 1; ++ } ++ } ++ ++ /* read error */ ++ if (num_read < 0 && errno_saved != EAGAIN && errno_saved != EINTR) { ++ g_set_error (error, BD_UTILS_EXEC_ERROR, BD_UTILS_EXEC_ERROR_FAILED, ++ "Error reading from pipe: %s", g_strerror (errno_saved)); ++ return FALSE; ++ } ++ ++ /* EOF */ ++ if (num_read == 0) ++ eof = TRUE; ++ } ++ ++ if (poll_fd->revents & POLLHUP || poll_fd->revents & POLLERR || poll_fd->revents & POLLNVAL) ++ eof = TRUE; ++ ++ if (eof) { ++ *done = TRUE; ++ /* process the remaining buffer */ ++ line = read_buffer->str + *read_buffer_pos; ++ /* GString guarantees the buffer is always NULL-terminated. */ ++ if (strlen (line) > 0) { ++ if (prog_extract && prog_extract (line, progress)) ++ bd_utils_report_progress (progress_id, *progress, NULL); ++ else ++ g_string_append (filtered_buffer, line); ++ } ++ } ++ ++ return TRUE; ++} ++ + static gboolean _utils_exec_and_report_progress (const gchar **argv, const BDExtraArg **extra, BDUtilsProgExtract prog_extract, gint *proc_status, gchar **stdout, gchar **stderr, GError **error) { + const gchar **args = NULL; + guint args_len = 0; +@@ -283,24 +365,26 @@ static gboolean _utils_exec_and_report_progress (const gchar **argv, const BDExt + gchar *msg = NULL; + GPid pid = 0; + gint out_fd = 0; +- GIOChannel *out_pipe = NULL; + gint err_fd = 0; +- GIOChannel *err_pipe = NULL; +- gchar *line = NULL; + gint child_ret = -1; + gint status = 0; + gboolean ret = FALSE; +- GIOStatus io_status = G_IO_STATUS_NORMAL; + gint poll_status = 0; + guint i = 0; + guint8 completion = 0; + struct pollfd fds[2] = { ZERO_INIT, ZERO_INIT }; ++ int flags; + gboolean out_done = FALSE; + gboolean err_done = FALSE; +- GString *stdout_data = g_string_new (NULL); +- GString *stderr_data = g_string_new (NULL); ++ GString *stdout_data; ++ GString *stdout_buffer; ++ GString *stderr_data; ++ GString *stderr_buffer; ++ gsize stdout_buffer_pos = 0; ++ gsize stderr_buffer_pos = 0; + gchar **old_env = NULL; + gchar **new_env = NULL; ++ gboolean success = TRUE; + + /* TODO: share this code between functions */ + if (extra) { +@@ -336,15 +420,13 @@ static gboolean _utils_exec_and_report_progress (const gchar **argv, const BDExt + G_SPAWN_DEFAULT|G_SPAWN_SEARCH_PATH|G_SPAWN_DO_NOT_REAP_CHILD, + NULL, NULL, &pid, NULL, &out_fd, &err_fd, error); + ++ g_strfreev (new_env); ++ + if (!ret) { + /* error is already populated */ +- g_string_free (stdout_data, TRUE); +- g_string_free (stderr_data, TRUE); +- g_strfreev (new_env); + g_free (args); + return FALSE; + } +- g_strfreev (new_env); + + args_str = g_strjoinv (" ", args ? (gchar **) args : (gchar **) argv); + msg = g_strdup_printf ("Started '%s'", args_str); +@@ -353,18 +435,25 @@ static gboolean _utils_exec_and_report_progress (const gchar **argv, const BDExt + g_free (args); + g_free (msg); + +- out_pipe = g_io_channel_unix_new (out_fd); +- err_pipe = g_io_channel_unix_new (err_fd); ++ /* set both fds for non-blocking read */ ++ flags = fcntl (out_fd, F_GETFL, 0); ++ if (fcntl (out_fd, F_SETFL, flags | O_NONBLOCK)) ++ g_warning ("_utils_exec_and_report_progress: Failed to set out_fd non-blocking: %m"); ++ flags = fcntl (err_fd, F_GETFL, 0); ++ if (fcntl (err_fd, F_SETFL, flags | O_NONBLOCK)) ++ g_warning ("_utils_exec_and_report_progress: Failed to set err_fd non-blocking: %m"); + +- g_io_channel_set_encoding (out_pipe, NULL, NULL); +- g_io_channel_set_encoding (err_pipe, NULL, NULL); ++ stdout_data = g_string_new (NULL); ++ stdout_buffer = g_string_new (NULL); ++ stderr_data = g_string_new (NULL); ++ stderr_buffer = g_string_new (NULL); + + fds[0].fd = out_fd; + fds[1].fd = err_fd; + fds[0].events = POLLIN | POLLHUP | POLLERR; + fds[1].events = POLLIN | POLLHUP | POLLERR; +- while (!out_done || !err_done) { +- poll_status = poll (fds, 2, -1); ++ while (! (out_done && err_done)) { ++ poll_status = poll (fds, 2, -1 /* timeout */); + g_warn_if_fail (poll_status != 0); /* no timeout specified, zero should never be returned */ + if (poll_status < 0) { + if (errno == EAGAIN || errno == EINTR) +@@ -372,140 +461,90 @@ static gboolean _utils_exec_and_report_progress (const gchar **argv, const BDExt + g_set_error (error, BD_UTILS_EXEC_ERROR, BD_UTILS_EXEC_ERROR_FAILED, + "Failed to poll output FDs: %m"); + bd_utils_report_finished (progress_id, (*error)->message); +- g_io_channel_shutdown (out_pipe, FALSE, NULL); +- g_io_channel_unref (out_pipe); +- g_io_channel_shutdown (err_pipe, FALSE, NULL); +- g_io_channel_unref (err_pipe); +- g_string_free (stdout_data, TRUE); +- g_string_free (stderr_data, TRUE); +- return FALSE; ++ success = FALSE; ++ break; + } + +- while (!out_done && (fds[0].revents & POLLIN)) { +- io_status = g_io_channel_read_line (out_pipe, &line, NULL, NULL, error); +- if (io_status == G_IO_STATUS_NORMAL) { +- if (prog_extract && prog_extract (line, &completion)) +- bd_utils_report_progress (progress_id, completion, NULL); +- else +- g_string_append (stdout_data, line); +- g_free (line); +- } else if (io_status == G_IO_STATUS_EOF) { +- out_done = TRUE; +- } else if (error && (*error)) { ++ if (!out_done) { ++ if (! _process_fd_event (out_fd, &fds[0], stdout_buffer, stdout_data, &stdout_buffer_pos, &out_done, progress_id, &completion, prog_extract, error)) { + bd_utils_report_finished (progress_id, (*error)->message); +- g_io_channel_shutdown (out_pipe, FALSE, NULL); +- g_io_channel_unref (out_pipe); +- g_io_channel_shutdown (err_pipe, FALSE, NULL); +- g_io_channel_unref (err_pipe); +- g_string_free (stdout_data, TRUE); +- g_string_free (stderr_data, TRUE); +- return FALSE; ++ success = FALSE; ++ break; + } + } +- if (fds[0].revents & POLLHUP || fds[0].revents & POLLERR || fds[0].revents & POLLNVAL) +- out_done = TRUE; + +- while (!err_done && (fds[1].revents & POLLIN)) { +- io_status = g_io_channel_read_line (err_pipe, &line, NULL, NULL, error); +- if (io_status == G_IO_STATUS_NORMAL) { +- g_string_append (stderr_data, line); +- g_free (line); +- } else if (io_status == G_IO_STATUS_EOF) { +- err_done = TRUE; +- } else if (error && (*error)) { ++ if (!err_done) { ++ if (! _process_fd_event (err_fd, &fds[1], stderr_buffer, stderr_data, &stderr_buffer_pos, &err_done, progress_id, &completion, prog_extract, error)) { + bd_utils_report_finished (progress_id, (*error)->message); +- g_io_channel_shutdown (out_pipe, FALSE, NULL); +- g_io_channel_unref (out_pipe); +- g_io_channel_shutdown (err_pipe, FALSE, NULL); +- g_io_channel_unref (err_pipe); +- g_string_free (stdout_data, TRUE); +- g_string_free (stderr_data, TRUE); +- return FALSE; ++ success = FALSE; ++ break; + } + } +- if (fds[1].revents & POLLHUP || fds[1].revents & POLLERR || fds[1].revents & POLLNVAL) +- err_done = TRUE; + } + ++ g_string_free (stdout_buffer, TRUE); ++ g_string_free (stderr_buffer, TRUE); ++ close (out_fd); ++ close (err_fd); ++ + child_ret = waitpid (pid, &status, 0); +- *proc_status = WEXITSTATUS(status); +- if (child_ret > 0) { +- if (*proc_status != 0) { +- if (stderr_data->str && (g_strcmp0 ("", stderr_data->str) != 0)) +- msg = stderr_data->str; +- else +- msg = stdout_data->str; +- g_set_error (error, BD_UTILS_EXEC_ERROR, BD_UTILS_EXEC_ERROR_FAILED, +- "Process reported exit code %d: %s", *proc_status, msg); +- bd_utils_report_finished (progress_id, (*error)->message); +- g_io_channel_shutdown (out_pipe, FALSE, NULL); +- g_io_channel_unref (out_pipe); +- g_io_channel_shutdown (err_pipe, FALSE, NULL); +- g_io_channel_unref (err_pipe); +- g_string_free (stdout_data, TRUE); +- g_string_free (stderr_data, TRUE); +- return FALSE; +- } +- if (WIFSIGNALED(status)) { +- g_set_error (error, BD_UTILS_EXEC_ERROR, BD_UTILS_EXEC_ERROR_FAILED, +- "Process killed with a signal"); +- bd_utils_report_finished (progress_id, (*error)->message); +- g_io_channel_shutdown (out_pipe, FALSE, NULL); +- g_io_channel_unref (out_pipe); +- g_io_channel_shutdown (err_pipe, FALSE, NULL); +- g_io_channel_unref (err_pipe); +- g_string_free (stdout_data, TRUE); +- g_string_free (stderr_data, TRUE); +- return FALSE; +- } +- } else if (child_ret == -1) { +- if (errno != ECHILD) { +- errno = 0; +- g_set_error (error, BD_UTILS_EXEC_ERROR, BD_UTILS_EXEC_ERROR_FAILED, +- "Failed to wait for the process"); +- bd_utils_report_finished (progress_id, (*error)->message); +- g_io_channel_shutdown (out_pipe, FALSE, NULL); +- g_io_channel_unref (out_pipe); +- g_io_channel_shutdown (err_pipe, FALSE, NULL); +- g_io_channel_unref (err_pipe); +- g_string_free (stdout_data, TRUE); +- g_string_free (stderr_data, TRUE); +- return FALSE; ++ *proc_status = WEXITSTATUS (status); ++ if (success) { ++ if (child_ret > 0) { ++ if (*proc_status != 0) { ++ msg = stderr_data->len > 0 ? stderr_data->str : stdout_data->str; ++ g_set_error (error, BD_UTILS_EXEC_ERROR, BD_UTILS_EXEC_ERROR_FAILED, ++ "Process reported exit code %d: %s", *proc_status, msg); ++ bd_utils_report_finished (progress_id, (*error)->message); ++ success = FALSE; ++ } else if (WIFSIGNALED (status)) { ++ g_set_error (error, BD_UTILS_EXEC_ERROR, BD_UTILS_EXEC_ERROR_FAILED, ++ "Process killed with a signal"); ++ bd_utils_report_finished (progress_id, (*error)->message); ++ success = FALSE; ++ } ++ } else if (child_ret == -1) { ++ if (errno != ECHILD) { ++ errno = 0; ++ g_set_error (error, BD_UTILS_EXEC_ERROR, BD_UTILS_EXEC_ERROR_FAILED, ++ "Failed to wait for the process"); ++ bd_utils_report_finished (progress_id, (*error)->message); ++ success = FALSE; ++ } else { ++ /* no such process (the child exited before we tried to wait for it) */ ++ errno = 0; ++ } + } +- /* no such process (the child exited before we tried to wait for it) */ +- errno = 0; ++ if (success) ++ bd_utils_report_finished (progress_id, "Completed"); + } +- +- bd_utils_report_finished (progress_id, "Completed"); + log_out (task_id, stdout_data->str, stderr_data->str); + log_done (task_id, *proc_status); + +- /* we don't care about the status here */ +- g_io_channel_shutdown (out_pipe, FALSE, error); +- g_io_channel_unref (out_pipe); +- g_io_channel_shutdown (err_pipe, FALSE, error); +- g_io_channel_unref (err_pipe); +- +- if (stdout) ++ if (success && stdout) + *stdout = g_string_free (stdout_data, FALSE); + else + g_string_free (stdout_data, TRUE); +- if (stderr) ++ if (success && stderr) + *stderr = g_string_free (stderr_data, FALSE); + else + g_string_free (stderr_data, TRUE); + +- return TRUE; ++ return success; + } + + /** + * bd_utils_exec_and_report_progress: + * @argv: (array zero-terminated=1): the argv array for the call + * @extra: (allow-none) (array zero-terminated=1): extra arguments +- * @prog_extract: (scope notified): function for extracting progress information ++ * @prog_extract: (scope notified) (nullable): function for extracting progress information + * @proc_status: (out): place to store the process exit status + * @error: (out): place to store error (if any) + * ++ * Note that any NULL bytes read from standard output and standard error ++ * output are treated as separators similar to newlines and @prog_extract ++ * will be called with the respective chunk. ++ * + * Returns: whether the @argv was successfully executed (no error and exit code 0) or not + */ + gboolean bd_utils_exec_and_report_progress (const gchar **argv, const BDExtraArg **extra, BDUtilsProgExtract prog_extract, gint *proc_status, GError **error) { +@@ -519,6 +558,9 @@ gboolean bd_utils_exec_and_report_progress (const gchar **argv, const BDExtraArg + * @output: (out): variable to store output to + * @error: (out): place to store error (if any) + * ++ * Note that any NULL bytes read from standard output and standard error ++ * output will be discarded. ++ * + * Returns: whether the @argv was successfully executed capturing the output or not + */ + gboolean bd_utils_exec_and_capture_output (const gchar **argv, const BDExtraArg **extra, gchar **output, GError **error) { +@@ -549,7 +591,6 @@ gboolean bd_utils_exec_and_capture_output (const gchar **argv, const BDExtraArg + g_free (stderr); + return TRUE; + } +- + } + + /** +-- +2.26.2 + + +From f5eb61c91ffc6b0d1fd709076a9579105655ff17 Mon Sep 17 00:00:00 2001 +From: Tomas Bzatek +Date: Fri, 25 Sep 2020 18:27:02 +0200 +Subject: [PATCH 3/5] exec: Clarify the BDUtilsProgExtract callback + documentation + +--- + src/utils/exec.h | 24 ++++++++++++++++++++++-- + 1 file changed, 22 insertions(+), 2 deletions(-) + +diff --git a/src/utils/exec.h b/src/utils/exec.h +index ad169e4..0e262a2 100644 +--- a/src/utils/exec.h ++++ b/src/utils/exec.h +@@ -31,10 +31,30 @@ typedef void (*BDUtilsProgFunc) (guint64 task_id, BDUtilsProgStatus status, guin + + /** + * BDUtilsProgExtract: +- * @line: line from extract progress from ++ * @line: line to extract progress from + * @completion: (out): percentage of completion + * +- * Returns: whether the line was a progress reporting line or not ++ * Callback function used to process a line captured from spawned command's standard ++ * output and standard error output. Typically used to extract completion percentage ++ * of a long-running job. ++ * ++ * Note that both outputs are read simultaneously with no guarantees of message order ++ * this function is called with. ++ * ++ * The value the @completion points to may contain value previously returned from ++ * this callback or zero when called for the first time. This is useful for extractors ++ * where only some kind of a tick mark is printed out as a progress and previous value ++ * is needed to compute an incremented value. It's important to keep in mind that this ++ * function is only called over lines, i.e. progress reporting printing out tick marks ++ * (e.g. dots) without a newline character might not work properly. ++ * ++ * The @line string usually contains trailing newline character, which may be absent ++ * however in case the spawned command exits without printing one. It's guaranteed ++ * this function is called over remaining buffer no matter what the trailing ++ * character is. ++ * ++ * Returns: whether the line was a progress reporting line and should be excluded ++ * from the collected standard output string or not. + */ + typedef gboolean (*BDUtilsProgExtract) (const gchar *line, guint8 *completion); + +-- +2.26.2 + + +From 8a7f0de5f63099a3e8bcaca005c4de04df959113 Mon Sep 17 00:00:00 2001 +From: Tomas Bzatek +Date: Fri, 25 Sep 2020 18:27:41 +0200 +Subject: [PATCH 4/5] tests: Add bufferbloat exec tests + +This should test pipe buffer exhaustion as well as potential pipe +read starvation while filling the other fd. +--- + tests/utils_test.py | 105 +++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 104 insertions(+), 1 deletion(-) + +diff --git a/tests/utils_test.py b/tests/utils_test.py +index 2bec5ed..ed13611 100644 +--- a/tests/utils_test.py ++++ b/tests/utils_test.py +@@ -1,8 +1,9 @@ + import unittest + import re + import os ++import six + import overrides_hack +-from utils import fake_utils, create_sparse_tempfile, create_lio_device, delete_lio_device, run_command, TestTags, tag_test ++from utils import fake_utils, create_sparse_tempfile, create_lio_device, delete_lio_device, run_command, TestTags, tag_test, read_file + + from gi.repository import BlockDev, GLib + +@@ -65,6 +66,9 @@ class UtilsExecLoggingTest(UtilsTestCase): + succ = BlockDev.utils_exec_and_report_error(["true"]) + self.assertTrue(succ) + ++ with six.assertRaisesRegex(self, GLib.GError, r"Process reported exit code 1"): ++ succ = BlockDev.utils_exec_and_report_error(["/bin/false"]) ++ + succ, out = BlockDev.utils_exec_and_capture_output(["echo", "hi"]) + self.assertTrue(succ) + self.assertEqual(out, "hi\n") +@@ -178,6 +182,105 @@ class UtilsExecLoggingTest(UtilsTestCase): + self.assertTrue(succ) + self.assertIn("LC_ALL=C", out) + ++ @tag_test(TestTags.NOSTORAGE, TestTags.CORE) ++ def test_exec_buffer_bloat(self): ++ """Verify that very large output from a command is handled properly""" ++ ++ # easy 64kB of data ++ cnt = 65536 ++ succ, out = BlockDev.utils_exec_and_capture_output(["bash", "-c", "for i in {1..%d}; do echo -n .; done" % cnt]) ++ self.assertTrue(succ) ++ self.assertEquals(len(out), cnt) ++ ++ succ, out = BlockDev.utils_exec_and_capture_output(["bash", "-c", "for i in {1..%d}; do echo -n .; echo -n \# >&2; done" % cnt]) ++ self.assertTrue(succ) ++ self.assertEquals(len(out), cnt) ++ ++ # now exceed the system pipe buffer size ++ # pipe(7): The maximum size (in bytes) of individual pipes that can be set by users without the CAP_SYS_RESOURCE capability. ++ cnt = int(read_file("/proc/sys/fs/pipe-max-size")) + 100 ++ self.assertGreater(cnt, 0) ++ ++ succ, out = BlockDev.utils_exec_and_capture_output(["bash", "-c", "for i in {1..%d}; do echo -n .; done" % cnt]) ++ self.assertTrue(succ) ++ self.assertEquals(len(out), cnt) ++ ++ succ, out = BlockDev.utils_exec_and_capture_output(["bash", "-c", "for i in {1..%d}; do echo -n .; echo -n \# >&2; done" % cnt]) ++ self.assertTrue(succ) ++ self.assertEquals(len(out), cnt) ++ ++ # make use of some newlines ++ succ, out = BlockDev.utils_exec_and_capture_output(["bash", "-c", "for i in {1..%d}; do echo -n .; if [ $(($i%%500)) -eq 0 ]; then echo ''; fi; done" % cnt]) ++ self.assertTrue(succ) ++ self.assertGreater(len(out), cnt) ++ ++ succ, out = BlockDev.utils_exec_and_capture_output(["bash", "-c", "for i in {1..%d}; do echo -n .; echo -n \# >&2; if [ $(($i%%500)) -eq 0 ]; then echo ''; echo '' >&2; fi; done" % cnt]) ++ self.assertTrue(succ) ++ self.assertGreater(len(out), cnt) ++ ++ ++ EXEC_PROGRESS_MSG = "Aloha, I'm the progress line you should match." ++ ++ def my_exec_progress_func_concat(self, line): ++ """Expect an concatenated string""" ++ s = "" ++ for i in range(10): ++ s += self.EXEC_PROGRESS_MSG ++ self.assertEqual(line, s) ++ self.num_matches += 1 ++ return 0 ++ ++ def my_exec_progress_func(self, line): ++ self.assertTrue(re.match(r".*%s.*" % self.EXEC_PROGRESS_MSG, line)) ++ self.num_matches += 1 ++ return 0 ++ ++ def test_exec_buffer_bloat_progress(self): ++ """Verify that progress reporting can handle large output""" ++ ++ # no newlines, should match just a single occurrence on EOF ++ cnt = 10 ++ self.num_matches = 0 ++ status = BlockDev.utils_exec_and_report_progress(["bash", "-c", "for i in {1..10}; do echo -n \"%s\"; done" % self.EXEC_PROGRESS_MSG], None, self.my_exec_progress_func_concat) ++ self.assertTrue(status) ++ self.assertEqual(self.num_matches, 1) ++ ++ # ten matches ++ self.num_matches = 0 ++ status = BlockDev.utils_exec_and_report_progress(["bash", "-c", "for i in {1..%d}; do echo \"%s\"; done" % (cnt, self.EXEC_PROGRESS_MSG)], None, self.my_exec_progress_func) ++ self.assertTrue(status) ++ self.assertEqual(self.num_matches, cnt) ++ ++ # 100k matches ++ cnt = 100000 ++ self.num_matches = 0 ++ status = BlockDev.utils_exec_and_report_progress(["bash", "-c", "for i in {1..%d}; do echo \"%s\"; done" % (cnt, self.EXEC_PROGRESS_MSG)], None, self.my_exec_progress_func) ++ self.assertTrue(status) ++ self.assertEqual(self.num_matches, cnt) ++ ++ # 100k matches on stderr ++ self.num_matches = 0 ++ status = BlockDev.utils_exec_and_report_progress(["bash", "-c", "for i in {1..%d}; do echo \"%s\" >&2; done" % (cnt, self.EXEC_PROGRESS_MSG)], None, self.my_exec_progress_func) ++ self.assertTrue(status) ++ self.assertEqual(self.num_matches, cnt) ++ ++ # 100k matches on stderr and stdout ++ self.num_matches = 0 ++ status = BlockDev.utils_exec_and_report_progress(["bash", "-c", "for i in {1..%d}; do echo \"%s\"; echo \"%s\" >&2; done" % (cnt, self.EXEC_PROGRESS_MSG, self.EXEC_PROGRESS_MSG)], None, self.my_exec_progress_func) ++ self.assertTrue(status) ++ self.assertEqual(self.num_matches, cnt * 2) ++ ++ # stdout and stderr output, non-zero return from the command and very long exception message ++ self.num_matches = 0 ++ with six.assertRaisesRegex(self, GLib.GError, r"Process reported exit code 66"): ++ status = BlockDev.utils_exec_and_report_progress(["bash", "-c", "for i in {1..%d}; do echo \"%s\"; echo \"%s\" >&2; done; exit 66" % (cnt, self.EXEC_PROGRESS_MSG, self.EXEC_PROGRESS_MSG)], None, self.my_exec_progress_func) ++ self.assertEqual(self.num_matches, cnt * 2) ++ ++ # no progress reporting callback given, tests slightly different code path ++ status = BlockDev.utils_exec_and_report_progress(["bash", "-c", "for i in {1..%d}; do echo \"%s\"; echo \"%s\" >&2; done" % (cnt, self.EXEC_PROGRESS_MSG, self.EXEC_PROGRESS_MSG)], None, None) ++ self.assertTrue(status) ++ ++ + class UtilsDevUtilsTestCase(UtilsTestCase): + @tag_test(TestTags.NOSTORAGE, TestTags.CORE) + def test_resolve_device(self): +-- +2.26.2 + + +From 7a3fd3d32dd325fb5188bcba74966e414e33c343 Mon Sep 17 00:00:00 2001 +From: Tomas Bzatek +Date: Wed, 30 Sep 2020 14:52:27 +0200 +Subject: [PATCH 5/5] tests: Add null-byte exec tests + +Some commands may print out NULL bytes in the middle of their output, +make sure everything works correctly. +--- + tests/utils_test.py | 48 +++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 48 insertions(+) + +diff --git a/tests/utils_test.py b/tests/utils_test.py +index ed13611..1235be3 100644 +--- a/tests/utils_test.py ++++ b/tests/utils_test.py +@@ -280,6 +280,54 @@ class UtilsExecLoggingTest(UtilsTestCase): + status = BlockDev.utils_exec_and_report_progress(["bash", "-c", "for i in {1..%d}; do echo \"%s\"; echo \"%s\" >&2; done" % (cnt, self.EXEC_PROGRESS_MSG, self.EXEC_PROGRESS_MSG)], None, None) + self.assertTrue(status) + ++ def test_exec_null_bytes(self): ++ """Verify that null bytes in the output are processed properly""" ++ ++ TEST_DATA = ["First line", "Second line", "Third line"] ++ ++ status, out = BlockDev.utils_exec_and_capture_output(["bash", "-c", "echo -e \"%s\\0%s\\n%s\"" % (TEST_DATA[0], TEST_DATA[1], TEST_DATA[2])]) ++ self.assertTrue(status) ++ self.assertTrue(TEST_DATA[0] in out) ++ self.assertTrue(TEST_DATA[1] in out) ++ self.assertTrue(TEST_DATA[2] in out) ++ self.assertFalse("kuku!" in out) ++ ++ # ten matches ++ cnt = 10 ++ self.num_matches = 0 ++ status = BlockDev.utils_exec_and_report_progress(["bash", "-c", "for i in {1..%d}; do echo -e \"%s\\0%s\"; done" % (cnt, self.EXEC_PROGRESS_MSG, self.EXEC_PROGRESS_MSG)], None, self.my_exec_progress_func) ++ self.assertTrue(status) ++ self.assertEqual(self.num_matches, cnt * 2) ++ ++ # 100k matches ++ cnt = 100000 ++ self.num_matches = 0 ++ status = BlockDev.utils_exec_and_report_progress(["bash", "-c", "for i in {1..%d}; do echo -e \"%s\\0%s\"; done" % (cnt, self.EXEC_PROGRESS_MSG, self.EXEC_PROGRESS_MSG)], None, self.my_exec_progress_func) ++ self.assertTrue(status) ++ self.assertEqual(self.num_matches, cnt * 2) ++ ++ # 100k matches on stderr ++ self.num_matches = 0 ++ status = BlockDev.utils_exec_and_report_progress(["bash", "-c", "for i in {1..%d}; do echo -e \"%s\\0%s\" >&2; done" % (cnt, self.EXEC_PROGRESS_MSG, self.EXEC_PROGRESS_MSG)], None, self.my_exec_progress_func) ++ self.assertTrue(status) ++ self.assertEqual(self.num_matches, cnt * 2) ++ ++ # 100k matches on stderr and stdout ++ self.num_matches = 0 ++ status = BlockDev.utils_exec_and_report_progress(["bash", "-c", "for i in {1..%d}; do echo -e \"%s\\0%s\"; echo -e \"%s\\0%s\" >&2; done" % (cnt, self.EXEC_PROGRESS_MSG, self.EXEC_PROGRESS_MSG, self.EXEC_PROGRESS_MSG, self.EXEC_PROGRESS_MSG)], None, self.my_exec_progress_func) ++ self.assertTrue(status) ++ self.assertEqual(self.num_matches, cnt * 4) ++ ++ # stdout and stderr output, non-zero return from the command and very long exception message ++ self.num_matches = 0 ++ with six.assertRaisesRegex(self, GLib.GError, r"Process reported exit code 66"): ++ status = BlockDev.utils_exec_and_report_progress(["bash", "-c", "for i in {1..%d}; do echo -e \"%s\\0%s\"; echo -e \"%s\\0%s\" >&2; done; exit 66" % (cnt, self.EXEC_PROGRESS_MSG, self.EXEC_PROGRESS_MSG, self.EXEC_PROGRESS_MSG, self.EXEC_PROGRESS_MSG)], None, self.my_exec_progress_func) ++ self.assertEqual(self.num_matches, cnt * 4) ++ ++ # no progress reporting callback given, tests slightly different code path ++ status = BlockDev.utils_exec_and_report_progress(["bash", "-c", "for i in {1..%d}; do echo -e \"%s\\0%s\"; echo -e \"%s\\0%s\" >&2; done" % (cnt, self.EXEC_PROGRESS_MSG, self.EXEC_PROGRESS_MSG, self.EXEC_PROGRESS_MSG, self.EXEC_PROGRESS_MSG)], None, None) ++ self.assertTrue(status) ++ + + class UtilsDevUtilsTestCase(UtilsTestCase): + @tag_test(TestTags.NOSTORAGE, TestTags.CORE) +-- +2.26.2 + diff --git a/0003-LVM-thin-metadata-calculation-fix.patch b/0003-LVM-thin-metadata-calculation-fix.patch new file mode 100644 index 0000000..3eca9ae --- /dev/null +++ b/0003-LVM-thin-metadata-calculation-fix.patch @@ -0,0 +1,914 @@ +From 2bb371937c7ef73f26717e57a5eb78cafe90a9f7 Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +Date: Fri, 20 Sep 2019 09:58:01 +0200 +Subject: [PATCH 1/5] Mark all GIR file constants as guint64 + +See 9676585e65f69ec1c309f45ba139035408d59b8e for more information. +--- + src/lib/plugin_apis/btrfs.api | 2 +- + src/lib/plugin_apis/crypto.api | 2 +- + src/lib/plugin_apis/lvm.api | 20 ++++++++++---------- + src/lib/plugin_apis/mdraid.api | 4 ++-- + 4 files changed, 14 insertions(+), 14 deletions(-) + +diff --git a/src/lib/plugin_apis/btrfs.api b/src/lib/plugin_apis/btrfs.api +index b52fb4ce..ef0f6c28 100644 +--- a/src/lib/plugin_apis/btrfs.api ++++ b/src/lib/plugin_apis/btrfs.api +@@ -3,7 +3,7 @@ + #include + + #define BD_BTRFS_MAIN_VOLUME_ID 5 +-#define BD_BTRFS_MIN_MEMBER_SIZE (128 MiB) ++#define BD_BTRFS_MIN_MEMBER_SIZE G_GUINT64_CONSTANT (134217728ULL) // 128 MiB + + GQuark bd_btrfs_error_quark (void) { + return g_quark_from_static_string ("g-bd-btrfs-error-quark"); +diff --git a/src/lib/plugin_apis/crypto.api b/src/lib/plugin_apis/crypto.api +index e3d69986..ef0217fe 100644 +--- a/src/lib/plugin_apis/crypto.api ++++ b/src/lib/plugin_apis/crypto.api +@@ -1,7 +1,7 @@ + #include + #include + +-#define BD_CRYPTO_LUKS_METADATA_SIZE (2 MiB) ++#define BD_CRYPTO_LUKS_METADATA_SIZE G_GUINT64_CONSTANT (2097152ULL) // 2 MiB + + GQuark bd_crypto_error_quark (void) { + return g_quark_from_static_string ("g-bd-crypto-error-quark"); +diff --git a/src/lib/plugin_apis/lvm.api b/src/lib/plugin_apis/lvm.api +index 21c8f74d..ea52263b 100644 +--- a/src/lib/plugin_apis/lvm.api ++++ b/src/lib/plugin_apis/lvm.api +@@ -15,18 +15,18 @@ + #define BD_LVM_MAX_LV_SIZE G_GUINT64_CONSTANT (9223372036854775808ULL) + + +-#define BD_LVM_DEFAULT_PE_START (1 MiB) +-#define BD_LVM_DEFAULT_PE_SIZE (4 MiB) +-#define BD_LVM_MIN_PE_SIZE (1 KiB) +-#define BD_LVM_MAX_PE_SIZE (16 GiB) +-#define BD_LVM_MIN_THPOOL_MD_SIZE (2 MiB) +-#define BD_LVM_MAX_THPOOL_MD_SIZE (16 GiB) +-#define BD_LVM_MIN_THPOOL_CHUNK_SIZE (64 KiB) +-#define BD_LVM_MAX_THPOOL_CHUNK_SIZE (1 GiB) +-#define BD_LVM_DEFAULT_CHUNK_SIZE (64 KiB) ++#define BD_LVM_DEFAULT_PE_START G_GUINT64_CONSTANT (1048576ULL) // 1 MiB ++#define BD_LVM_DEFAULT_PE_SIZE G_GUINT64_CONSTANT (4194304ULL) // 4 MiB ++#define BD_LVM_MIN_PE_SIZE G_GUINT64_CONSTANT (1024ULL) // 1 KiB ++#define BD_LVM_MAX_PE_SIZE G_GUINT64_CONSTANT (17179869184ULL) // 16 GiB ++#define BD_LVM_MIN_THPOOL_MD_SIZE G_GUINT64_CONSTANT (2097152ULL) // 2 MiB ++#define BD_LVM_MAX_THPOOL_MD_SIZE G_GUINT64_CONSTANT (17179869184ULL) // 16 GiB ++#define BD_LVM_MIN_THPOOL_CHUNK_SIZE G_GUINT64_CONSTANT (65536ULL) // 64 KiB ++#define BD_LVM_MAX_THPOOL_CHUNK_SIZE G_GUINT64_CONSTANT (1073741824ULL) // 1 GiB ++#define BD_LVM_DEFAULT_CHUNK_SIZE G_GUINT64_CONSTANT (65536ULL) // 64 KiB + + /* according to lvmcache (7) */ +-#define BD_LVM_MIN_CACHE_MD_SIZE (8 MiB) ++#define BD_LVM_MIN_CACHE_MD_SIZE (8388608ULL) // 8 MiB + + GQuark bd_lvm_error_quark (void) { + return g_quark_from_static_string ("g-bd-lvm-error-quark"); +diff --git a/src/lib/plugin_apis/mdraid.api b/src/lib/plugin_apis/mdraid.api +index 3bd9eaf2..02ca9530 100644 +--- a/src/lib/plugin_apis/mdraid.api ++++ b/src/lib/plugin_apis/mdraid.api +@@ -7,8 +7,8 @@ + + /* taken from blivet */ + // these defaults were determined empirically +-#define BD_MD_SUPERBLOCK_SIZE (2 MiB) +-#define BD_MD_CHUNK_SIZE (512 KiB) ++#define BD_MD_SUPERBLOCK_SIZE G_GUINT64_CONSTANT (2097152ULL) // 2 MiB ++#define BD_MD_CHUNK_SIZE G_GUINT64_CONSTANT (524288ULL) // 512 KiB + + GQuark bd_md_error_quark (void) { + return g_quark_from_static_string ("g-bd-md-error-quark"); + +From aeedce3bcaa8182c9878cc51d3f85a6c6eb6a01f Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +Date: Thu, 3 Dec 2020 14:41:25 +0100 +Subject: [PATCH 2/5] lvm: Set thin metadata limits to match limits LVM uses in + lvcreate + +--- + src/lib/plugin_apis/lvm.api | 4 ++-- + src/plugins/lvm.h | 9 +++++++-- + tests/lvm_dbus_tests.py | 7 ++++--- + tests/lvm_test.py | 7 ++++--- + 4 files changed, 17 insertions(+), 10 deletions(-) + +diff --git a/src/lib/plugin_apis/lvm.api b/src/lib/plugin_apis/lvm.api +index ea52263b..e843c916 100644 +--- a/src/lib/plugin_apis/lvm.api ++++ b/src/lib/plugin_apis/lvm.api +@@ -19,8 +19,8 @@ + #define BD_LVM_DEFAULT_PE_SIZE G_GUINT64_CONSTANT (4194304ULL) // 4 MiB + #define BD_LVM_MIN_PE_SIZE G_GUINT64_CONSTANT (1024ULL) // 1 KiB + #define BD_LVM_MAX_PE_SIZE G_GUINT64_CONSTANT (17179869184ULL) // 16 GiB +-#define BD_LVM_MIN_THPOOL_MD_SIZE G_GUINT64_CONSTANT (2097152ULL) // 2 MiB +-#define BD_LVM_MAX_THPOOL_MD_SIZE G_GUINT64_CONSTANT (17179869184ULL) // 16 GiB ++#define BD_LVM_MIN_THPOOL_MD_SIZE G_GUINT64_CONSTANT (4194304ULL) // 4 MiB ++#define BD_LVM_MAX_THPOOL_MD_SIZE G_GUINT64_CONSTANT (33957085184ULL) // 31.62 GiB + #define BD_LVM_MIN_THPOOL_CHUNK_SIZE G_GUINT64_CONSTANT (65536ULL) // 64 KiB + #define BD_LVM_MAX_THPOOL_CHUNK_SIZE G_GUINT64_CONSTANT (1073741824ULL) // 1 GiB + #define BD_LVM_DEFAULT_CHUNK_SIZE G_GUINT64_CONSTANT (65536ULL) // 64 KiB +diff --git a/src/plugins/lvm.h b/src/plugins/lvm.h +index 4b970f2e..01c06ca4 100644 +--- a/src/plugins/lvm.h ++++ b/src/plugins/lvm.h +@@ -1,5 +1,6 @@ + #include + #include ++#include + + #ifndef BD_LVM + #define BD_LVM +@@ -21,8 +22,12 @@ + #define USE_DEFAULT_PE_SIZE 0 + #define RESOLVE_PE_SIZE(size) ((size) == USE_DEFAULT_PE_SIZE ? BD_LVM_DEFAULT_PE_SIZE : (size)) + +-#define BD_LVM_MIN_THPOOL_MD_SIZE (2 MiB) +-#define BD_LVM_MAX_THPOOL_MD_SIZE (16 GiB) ++/* lvm constants for thin pool metadata size are actually half of these ++ but when they calculate the actual metadata size they double the limits ++ so lets just double the limits here too */ ++#define BD_LVM_MIN_THPOOL_MD_SIZE (4 MiB) ++#define BD_LVM_MAX_THPOOL_MD_SIZE (DM_THIN_MAX_METADATA_SIZE KiB) ++ + #define BD_LVM_MIN_THPOOL_CHUNK_SIZE (64 KiB) + #define BD_LVM_MAX_THPOOL_CHUNK_SIZE (1 GiB) + #define BD_LVM_DEFAULT_CHUNK_SIZE (64 KiB) +diff --git a/tests/lvm_dbus_tests.py b/tests/lvm_dbus_tests.py +index 47402fc3..b517aae9 100644 +--- a/tests/lvm_dbus_tests.py ++++ b/tests/lvm_dbus_tests.py +@@ -160,12 +160,13 @@ def test_get_thpool_meta_size(self): + def test_is_valid_thpool_md_size(self): + """Verify that is_valid_thpool_md_size works as expected""" + +- self.assertTrue(BlockDev.lvm_is_valid_thpool_md_size(2 * 1024**2)) +- self.assertTrue(BlockDev.lvm_is_valid_thpool_md_size(3 * 1024**2)) ++ self.assertTrue(BlockDev.lvm_is_valid_thpool_md_size(4 * 1024**2)) ++ self.assertTrue(BlockDev.lvm_is_valid_thpool_md_size(5 * 1024**2)) + self.assertTrue(BlockDev.lvm_is_valid_thpool_md_size(16 * 1024**3)) + + self.assertFalse(BlockDev.lvm_is_valid_thpool_md_size(1 * 1024**2)) +- self.assertFalse(BlockDev.lvm_is_valid_thpool_md_size(17 * 1024**3)) ++ self.assertFalse(BlockDev.lvm_is_valid_thpool_md_size(3 * 1024**2)) ++ self.assertFalse(BlockDev.lvm_is_valid_thpool_md_size(32 * 1024**3)) + + @tag_test(TestTags.NOSTORAGE) + def test_is_valid_thpool_chunk_size(self): +diff --git a/tests/lvm_test.py b/tests/lvm_test.py +index 149cf54a..d0085651 100644 +--- a/tests/lvm_test.py ++++ b/tests/lvm_test.py +@@ -153,12 +153,13 @@ def test_get_thpool_meta_size(self): + def test_is_valid_thpool_md_size(self): + """Verify that is_valid_thpool_md_size works as expected""" + +- self.assertTrue(BlockDev.lvm_is_valid_thpool_md_size(2 * 1024**2)) +- self.assertTrue(BlockDev.lvm_is_valid_thpool_md_size(3 * 1024**2)) ++ self.assertTrue(BlockDev.lvm_is_valid_thpool_md_size(4 * 1024**2)) ++ self.assertTrue(BlockDev.lvm_is_valid_thpool_md_size(5 * 1024**2)) + self.assertTrue(BlockDev.lvm_is_valid_thpool_md_size(16 * 1024**3)) + + self.assertFalse(BlockDev.lvm_is_valid_thpool_md_size(1 * 1024**2)) +- self.assertFalse(BlockDev.lvm_is_valid_thpool_md_size(17 * 1024**3)) ++ self.assertFalse(BlockDev.lvm_is_valid_thpool_md_size(3 * 1024**2)) ++ self.assertFalse(BlockDev.lvm_is_valid_thpool_md_size(32 * 1024**3)) + + @tag_test(TestTags.NOSTORAGE) + def test_is_valid_thpool_chunk_size(self): + +From 15fcf1bb62865083a3483fc51f45e11cdc2d7386 Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +Date: Thu, 3 Dec 2020 14:46:00 +0100 +Subject: [PATCH 3/5] lvm: Do not use thin_metadata_size to recommend thin + metadata size + +thin_metadata_size calculates the metadata size differently and +recommends smaller metadata than lvcreate so we should use the +lvcreate formula instead. + +Resolves: rhbz#1898668 +--- + dist/libblockdev.spec.in | 4 -- + src/lib/plugin_apis/lvm.api | 8 +-- + src/plugins/lvm-dbus.c | 78 ++++++----------------------- + src/plugins/lvm.c | 66 +++++++----------------- + src/python/gi/overrides/BlockDev.py | 6 +++ + tests/library_test.py | 6 +-- + tests/lvm_dbus_tests.py | 20 ++++---- + tests/lvm_test.py | 15 ++---- + tests/utils.py | 2 +- + 9 files changed, 61 insertions(+), 144 deletions(-) + +diff --git a/dist/libblockdev.spec.in b/dist/libblockdev.spec.in +index 7c775174..3e0a53c6 100644 +--- a/dist/libblockdev.spec.in ++++ b/dist/libblockdev.spec.in +@@ -387,8 +387,6 @@ BuildRequires: device-mapper-devel + Summary: The LVM plugin for the libblockdev library + Requires: %{name}-utils%{?_isa} >= 0.11 + Requires: lvm2 +-# for thin_metadata_size +-Requires: device-mapper-persistent-data + + %description lvm + The libblockdev library plugin (and in the same time a standalone library) +@@ -411,8 +409,6 @@ BuildRequires: device-mapper-devel + Summary: The LVM plugin for the libblockdev library + Requires: %{name}-utils%{?_isa} >= 1.4 + Requires: lvm2-dbusd >= 2.02.156 +-# for thin_metadata_size +-Requires: device-mapper-persistent-data + + %description lvm-dbus + The libblockdev library plugin (and in the same time a standalone library) +diff --git a/src/lib/plugin_apis/lvm.api b/src/lib/plugin_apis/lvm.api +index e843c916..9f25c1ed 100644 +--- a/src/lib/plugin_apis/lvm.api ++++ b/src/lib/plugin_apis/lvm.api +@@ -704,11 +704,13 @@ guint64 bd_lvm_get_thpool_padding (guint64 size, guint64 pe_size, gboolean inclu + * bd_lvm_get_thpool_meta_size: + * @size: size of the thin pool + * @chunk_size: chunk size of the thin pool or 0 to use the default (%BD_LVM_DEFAULT_CHUNK_SIZE) +- * @n_snapshots: number of snapshots that will be created in the pool ++ * @n_snapshots: ignored + * @error: (out): place to store error (if any) + * +- * Returns: recommended size of the metadata space for the specified pool or 0 +- * in case of error ++ * Note: This function will be changed in 3.0: the @n_snapshots parameter ++ * is currently not used and will be removed. ++ * ++ * Returns: recommended size of the metadata space for the specified pool + * + * Tech category: %BD_LVM_TECH_THIN_CALCS no mode (it is ignored) + */ +diff --git a/src/plugins/lvm-dbus.c b/src/plugins/lvm-dbus.c +index 9f821a99..24d54426 100644 +--- a/src/plugins/lvm-dbus.c ++++ b/src/plugins/lvm-dbus.c +@@ -20,7 +20,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -248,14 +247,6 @@ static volatile guint avail_features = 0; + static volatile guint avail_module_deps = 0; + static GMutex deps_check_lock; + +-#define DEPS_THMS 0 +-#define DEPS_THMS_MASK (1 << DEPS_THMS) +-#define DEPS_LAST 1 +- +-static const UtilDep deps[DEPS_LAST] = { +- {"thin_metadata_size", NULL, NULL, NULL}, +-}; +- + #define DBUS_DEPS_LVMDBUSD 0 + #define DBUS_DEPS_LVMDBUSD_MASK (1 << DBUS_DEPS_LVMDBUSD) + #define DBUS_DEPS_LAST 1 +@@ -301,17 +292,6 @@ gboolean bd_lvm_check_deps (void) { + check_ret = check_ret && success; + } + +- for (i=0; i < DEPS_LAST; i++) { +- success = bd_utils_check_util_version (deps[i].name, deps[i].version, +- deps[i].ver_arg, deps[i].ver_regexp, &error); +- if (!success) +- g_warning ("%s", error->message); +- else +- g_atomic_int_or (&avail_deps, 1 << i); +- g_clear_error (&error); +- check_ret = check_ret && success; +- } +- + if (!check_ret) + g_warning("Cannot load the LVM plugin"); + +@@ -386,10 +366,7 @@ gboolean bd_lvm_is_tech_avail (BDLVMTech tech, guint64 mode, GError **error) { + g_set_error (error, BD_LVM_ERROR, BD_LVM_ERROR_TECH_UNAVAIL, + "Only 'query' supported for thin calculations"); + return FALSE; +- } else if ((mode & BD_LVM_TECH_MODE_QUERY) && +- !check_deps (&avail_deps, DEPS_THMS_MASK, deps, DEPS_LAST, &deps_check_lock, error)) +- return FALSE; +- else ++ } else + return TRUE; + case BD_LVM_TECH_CALCS: + if (mode & ~BD_LVM_TECH_MODE_QUERY) { +@@ -1303,53 +1280,28 @@ guint64 bd_lvm_get_thpool_padding (guint64 size, guint64 pe_size, gboolean inclu + * bd_lvm_get_thpool_meta_size: + * @size: size of the thin pool + * @chunk_size: chunk size of the thin pool or 0 to use the default (%BD_LVM_DEFAULT_CHUNK_SIZE) +- * @n_snapshots: number of snapshots that will be created in the pool ++ * @n_snapshots: ignored + * @error: (out): place to store error (if any) + * +- * Returns: recommended size of the metadata space for the specified pool or 0 +- * in case of error ++ * Note: This function will be changed in 3.0: the @n_snapshots parameter ++ * is currently not used and will be removed. ++ * ++ * Returns: recommended size of the metadata space for the specified pool + * + * Tech category: %BD_LVM_TECH_THIN_CALCS no mode (it is ignored) + */ +-guint64 bd_lvm_get_thpool_meta_size (guint64 size, guint64 chunk_size, guint64 n_snapshots, GError **error) { +- /* ub - output in bytes, n - output just the number */ +- const gchar* args[7] = {"thin_metadata_size", "-ub", "-n", NULL, NULL, NULL, NULL}; +- gchar *output = NULL; +- gboolean success = FALSE; +- guint64 ret = 0; +- +- if (!check_deps (&avail_deps, DEPS_THMS_MASK, deps, DEPS_LAST, &deps_check_lock, error)) +- return 0; ++guint64 bd_lvm_get_thpool_meta_size (guint64 size, guint64 chunk_size, guint64 n_snapshots UNUSED, GError **error UNUSED) { ++ guint64 md_size = 0; + +- /* s - total size, b - chunk size, m - number of snapshots */ +- args[3] = g_strdup_printf ("-s%"G_GUINT64_FORMAT, size); +- args[4] = g_strdup_printf ("-b%"G_GUINT64_FORMAT, +- chunk_size != 0 ? chunk_size : (guint64) BD_LVM_DEFAULT_CHUNK_SIZE); +- args[5] = g_strdup_printf ("-m%"G_GUINT64_FORMAT, n_snapshots); +- +- success = bd_utils_exec_and_capture_output (args, NULL, &output, error); +- g_free ((gchar*) args[3]); +- g_free ((gchar*) args[4]); +- g_free ((gchar*) args[5]); +- +- if (!success) { +- /* error is already set */ +- g_free (output); +- return 0; +- } +- +- ret = g_ascii_strtoull (output, NULL, 0); +- if (ret == 0) { +- g_set_error (error, BD_LVM_ERROR, BD_LVM_ERROR_PARSE, +- "Failed to parse number from thin_metadata_size's output: '%s'", +- output); +- g_free (output); +- return 0; +- } ++ /* based on lvcreate metadata size calculation */ ++ md_size = UINT64_C(64) * size / (chunk_size ? chunk_size : BD_LVM_DEFAULT_CHUNK_SIZE); + +- g_free (output); ++ if (md_size > BD_LVM_MAX_THPOOL_MD_SIZE) ++ md_size = BD_LVM_MAX_THPOOL_MD_SIZE; ++ else if (md_size < BD_LVM_MIN_THPOOL_MD_SIZE) ++ md_size = BD_LVM_MIN_THPOOL_MD_SIZE; + +- return MAX (ret, BD_LVM_MIN_THPOOL_MD_SIZE); ++ return md_size; + } + + /** +diff --git a/src/plugins/lvm.c b/src/plugins/lvm.c +index 6bfaa338..74493feb 100644 +--- a/src/plugins/lvm.c ++++ b/src/plugins/lvm.c +@@ -20,7 +20,6 @@ + #include + #include + #include +-#include + #include + #include + +@@ -213,13 +212,10 @@ static GMutex deps_check_lock; + + #define DEPS_LVM 0 + #define DEPS_LVM_MASK (1 << DEPS_LVM) +-#define DEPS_THMS 1 +-#define DEPS_THMS_MASK (1 << DEPS_THMS) +-#define DEPS_LAST 2 ++#define DEPS_LAST 1 + + static const UtilDep deps[DEPS_LAST] = { + {"lvm", LVM_MIN_VERSION, "version", "LVM version:\\s+([\\d\\.]+)"}, +- {"thin_metadata_size", NULL, NULL, NULL}, + }; + + #define FEATURES_VDO 0 +@@ -236,6 +232,8 @@ static const UtilFeatureDep features[FEATURES_LAST] = { + + static const gchar*const module_deps[MODULE_DEPS_LAST] = { "kvdo" }; + ++#define UNUSED __attribute__((unused)) ++ + /** + * bd_lvm_check_deps: + * +@@ -317,10 +315,7 @@ gboolean bd_lvm_is_tech_avail (BDLVMTech tech, guint64 mode, GError **error) { + g_set_error (error, BD_LVM_ERROR, BD_LVM_ERROR_TECH_UNAVAIL, + "Only 'query' supported for thin calculations"); + return FALSE; +- } else if ((mode & BD_LVM_TECH_MODE_QUERY) && +- !check_deps (&avail_deps, DEPS_THMS_MASK, deps, DEPS_LAST, &deps_check_lock, error)) +- return FALSE; +- else ++ } else + return TRUE; + case BD_LVM_TECH_CALCS: + if (mode & ~BD_LVM_TECH_MODE_QUERY) { +@@ -820,53 +815,28 @@ guint64 bd_lvm_get_thpool_padding (guint64 size, guint64 pe_size, gboolean inclu + * bd_lvm_get_thpool_meta_size: + * @size: size of the thin pool + * @chunk_size: chunk size of the thin pool or 0 to use the default (%BD_LVM_DEFAULT_CHUNK_SIZE) +- * @n_snapshots: number of snapshots that will be created in the pool ++ * @n_snapshots: ignored + * @error: (out): place to store error (if any) + * +- * Returns: recommended size of the metadata space for the specified pool or 0 +- * in case of error ++ * Note: This function will be changed in 3.0: the @n_snapshots parameter ++ * is currently not used and will be removed. ++ * ++ * Returns: recommended size of the metadata space for the specified pool + * + * Tech category: %BD_LVM_TECH_THIN_CALCS no mode (it is ignored) + */ +-guint64 bd_lvm_get_thpool_meta_size (guint64 size, guint64 chunk_size, guint64 n_snapshots, GError **error) { +- /* ub - output in bytes, n - output just the number */ +- const gchar* args[7] = {"thin_metadata_size", "-ub", "-n", NULL, NULL, NULL, NULL}; +- gchar *output = NULL; +- gboolean success = FALSE; +- guint64 ret = 0; +- +- if (!check_deps (&avail_deps, DEPS_THMS_MASK, deps, DEPS_LAST, &deps_check_lock, error)) +- return 0; ++guint64 bd_lvm_get_thpool_meta_size (guint64 size, guint64 chunk_size, guint64 n_snapshots UNUSED, GError **error UNUSED) { ++ guint64 md_size = 0; + +- /* s - total size, b - chunk size, m - number of snapshots */ +- args[3] = g_strdup_printf ("-s%"G_GUINT64_FORMAT, size); +- args[4] = g_strdup_printf ("-b%"G_GUINT64_FORMAT, +- chunk_size != 0 ? chunk_size : (guint64) BD_LVM_DEFAULT_CHUNK_SIZE); +- args[5] = g_strdup_printf ("-m%"G_GUINT64_FORMAT, n_snapshots); ++ /* based on lvcreate metadata size calculation */ ++ md_size = UINT64_C(64) * size / (chunk_size ? chunk_size : BD_LVM_DEFAULT_CHUNK_SIZE); + +- success = bd_utils_exec_and_capture_output (args, NULL, &output, error); +- g_free ((gchar*) args[3]); +- g_free ((gchar*) args[4]); +- g_free ((gchar*) args[5]); +- +- if (!success) { +- /* error is already set */ +- g_free (output); +- return 0; +- } +- +- ret = g_ascii_strtoull (output, NULL, 0); +- if (ret == 0) { +- g_set_error (error, BD_LVM_ERROR, BD_LVM_ERROR_PARSE, +- "Failed to parse number from thin_metadata_size's output: '%s'", +- output); +- g_free (output); +- return 0; +- } +- +- g_free (output); ++ if (md_size > BD_LVM_MAX_THPOOL_MD_SIZE) ++ md_size = BD_LVM_MAX_THPOOL_MD_SIZE; ++ else if (md_size < BD_LVM_MIN_THPOOL_MD_SIZE) ++ md_size = BD_LVM_MIN_THPOOL_MD_SIZE; + +- return MAX (ret, BD_LVM_MIN_THPOOL_MD_SIZE); ++ return md_size; + } + + /** +diff --git a/src/python/gi/overrides/BlockDev.py b/src/python/gi/overrides/BlockDev.py +index d78bfaab..f768c8bd 100644 +--- a/src/python/gi/overrides/BlockDev.py ++++ b/src/python/gi/overrides/BlockDev.py +@@ -462,6 +462,12 @@ def lvm_get_thpool_padding(size, pe_size=0, included=False): + return _lvm_get_thpool_padding(size, pe_size, included) + __all__.append("lvm_get_thpool_padding") + ++_lvm_get_thpool_meta_size = BlockDev.lvm_get_thpool_meta_size ++@override(BlockDev.lvm_get_thpool_meta_size) ++def lvm_get_thpool_meta_size(size, chunk_size=0, n_snapshots=0): ++ return _lvm_get_thpool_meta_size(size, chunk_size, n_snapshots) ++__all__.append("lvm_get_thpool_meta_size") ++ + _lvm_pvcreate = BlockDev.lvm_pvcreate + @override(BlockDev.lvm_pvcreate) + def lvm_pvcreate(device, data_alignment=0, metadata_size=0, extra=None, **kwargs): +diff --git a/tests/library_test.py b/tests/library_test.py +index e8bb175a..08e44fdc 100644 +--- a/tests/library_test.py ++++ b/tests/library_test.py +@@ -349,8 +349,7 @@ def test_try_reinit(self): + + # try reinitializing with only some utilities being available and thus + # only some plugins able to load +- with fake_path("tests/lib_missing_utils", keep_utils=["swapon", "swapoff", "mkswap", "lvm", +- "thin_metadata_size", "swaplabel"]): ++ with fake_path("tests/lib_missing_utils", keep_utils=["swapon", "swapoff", "mkswap", "lvm", "swaplabel"]): + succ, loaded = BlockDev.try_reinit(self.requested_plugins, True, None) + self.assertFalse(succ) + for plug_name in ("swap", "lvm", "crypto"): +@@ -361,8 +360,7 @@ def test_try_reinit(self): + + # now the same with a subset of plugins requested + plugins = BlockDev.plugin_specs_from_names(["lvm", "swap", "crypto"]) +- with fake_path("tests/lib_missing_utils", keep_utils=["swapon", "swapoff", "mkswap", "lvm", +- "thin_metadata_size", "swaplabel"]): ++ with fake_path("tests/lib_missing_utils", keep_utils=["swapon", "swapoff", "mkswap", "lvm","swaplabel"]): + succ, loaded = BlockDev.try_reinit(plugins, True, None) + self.assertTrue(succ) + self.assertEqual(set(loaded), set(["swap", "lvm", "crypto"])) +diff --git a/tests/lvm_dbus_tests.py b/tests/lvm_dbus_tests.py +index b517aae9..c06a480c 100644 +--- a/tests/lvm_dbus_tests.py ++++ b/tests/lvm_dbus_tests.py +@@ -141,21 +141,19 @@ def test_get_thpool_padding(self): + def test_get_thpool_meta_size(self): + """Verify that getting recommended thin pool metadata size works as expected""" + +- # no idea how thin_metadata_size works, but let's at least check that +- # the function works and returns what thin_metadata_size says +- out1 = subprocess.check_output(["thin_metadata_size", "-ub", "-n", "-b64k", "-s1t", "-m100"]) +- self.assertEqual(int(out1), BlockDev.lvm_get_thpool_meta_size (1 * 1024**4, 64 * 1024, 100)) ++ # metadata size is calculated as 64 * pool_size / chunk_size ++ self.assertEqual(BlockDev.lvm_get_thpool_meta_size(1 * 1024**4, 64 * 1024), 1 * 1024**3) + +- out2 = subprocess.check_output(["thin_metadata_size", "-ub", "-n", "-b128k", "-s1t", "-m100"]) +- self.assertEqual(int(out2), BlockDev.lvm_get_thpool_meta_size (1 * 1024**4, 128 * 1024, 100)) ++ self.assertEqual(BlockDev.lvm_get_thpool_meta_size(1 * 1024**4, 128 * 1024), 512 * 1024**2) + +- # twice the chunk_size -> roughly half the metadata needed +- self.assertAlmostEqual(float(out1) / float(out2), 2, places=2) +- +- # unless thin_metadata_size gives a value that is not valid (too small) +- self.assertEqual(BlockDev.lvm_get_thpool_meta_size (100 * 1024**2, 128 * 1024, 100), ++ # lower limit is 4 MiB ++ self.assertEqual(BlockDev.lvm_get_thpool_meta_size(100 * 1024**2, 128 * 1024), + BlockDev.LVM_MIN_THPOOL_MD_SIZE) + ++ # upper limit is 31.62 GiB ++ self.assertEqual(BlockDev.lvm_get_thpool_meta_size(100 * 1024**4, 64 * 1024), ++ BlockDev.LVM_MAX_THPOOL_MD_SIZE) ++ + @tag_test(TestTags.NOSTORAGE) + def test_is_valid_thpool_md_size(self): + """Verify that is_valid_thpool_md_size works as expected""" +diff --git a/tests/lvm_test.py b/tests/lvm_test.py +index d0085651..b84adece 100644 +--- a/tests/lvm_test.py ++++ b/tests/lvm_test.py +@@ -134,19 +134,14 @@ def test_get_thpool_padding(self): + def test_get_thpool_meta_size(self): + """Verify that getting recommended thin pool metadata size works as expected""" + +- # no idea how thin_metadata_size works, but let's at least check that +- # the function works and returns what thin_metadata_size says +- out1 = subprocess.check_output(["thin_metadata_size", "-ub", "-n", "-b64k", "-s1t", "-m100"]) +- self.assertEqual(int(out1), BlockDev.lvm_get_thpool_meta_size (1 * 1024**4, 64 * 1024, 100)) + +- out2 = subprocess.check_output(["thin_metadata_size", "-ub", "-n", "-b128k", "-s1t", "-m100"]) +- self.assertEqual(int(out2), BlockDev.lvm_get_thpool_meta_size (1 * 1024**4, 128 * 1024, 100)) ++ self.assertEqual(BlockDev.lvm_get_thpool_meta_size(1 * 1024**4, 64 * 1024), ++ 1 * 1024**3) + +- # twice the chunk_size -> roughly half the metadata needed +- self.assertAlmostEqual(float(out1) / float(out2), 2, places=2) ++ self.assertEqual(BlockDev.lvm_get_thpool_meta_size(1 * 1024**4, 128 * 1024), ++ 512 * 1024**2) + +- # unless thin_metadata_size gives a value that is not valid (too small) +- self.assertEqual(BlockDev.lvm_get_thpool_meta_size (100 * 1024**2, 128 * 1024, 100), ++ self.assertEqual(BlockDev.lvm_get_thpool_meta_size(100 * 1024**2, 128 * 1024), + BlockDev.LVM_MIN_THPOOL_MD_SIZE) + + @tag_test(TestTags.NOSTORAGE) +diff --git a/tests/utils.py b/tests/utils.py +index 182eda6a..584fde5c 100644 +--- a/tests/utils.py ++++ b/tests/utils.py +@@ -70,7 +70,7 @@ def fake_utils(path="."): + finally: + os.environ["PATH"] = old_path + +-ALL_UTILS = {"lvm", "thin_metadata_size", "btrfs", "mkswap", "swaplabel", "multipath", "mpathconf", "dmsetup", "mdadm", "make-bcache", "sgdisk", "sfdisk"} ++ALL_UTILS = {"lvm", "btrfs", "mkswap", "swaplabel", "multipath", "mpathconf", "dmsetup", "mdadm", "make-bcache", "sgdisk", "sfdisk"} + + @contextmanager + def fake_path(path=None, keep_utils=None, all_but=None): + +From 27961a3fcb205ea51f40668d68765dd8d388777b Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +Date: Thu, 3 Dec 2020 14:48:08 +0100 +Subject: [PATCH 4/5] lvm: Use the UNUSED macro instead of + __attribute__((unused)) + +for unused attributes. It makes the function definition a little +bit more readable. +--- + src/plugins/lvm-dbus.c | 24 ++++++++++++------------ + src/plugins/lvm.c | 20 ++++++++++---------- + 2 files changed, 22 insertions(+), 22 deletions(-) + +diff --git a/src/plugins/lvm-dbus.c b/src/plugins/lvm-dbus.c +index 24d54426..b7b4480e 100644 +--- a/src/plugins/lvm-dbus.c ++++ b/src/plugins/lvm-dbus.c +@@ -959,7 +959,7 @@ static BDLVMPVdata* get_pv_data_from_props (GVariant *props, GError **error) { + return data; + } + +-static BDLVMVGdata* get_vg_data_from_props (GVariant *props, GError **error __attribute__((unused))) { ++static BDLVMVGdata* get_vg_data_from_props (GVariant *props, GError **error UNUSED) { + BDLVMVGdata *data = g_new0 (BDLVMVGdata, 1); + GVariantDict dict; + +@@ -1061,7 +1061,7 @@ static BDLVMLVdata* get_lv_data_from_props (GVariant *props, GError **error) { + return data; + } + +-static BDLVMVDOPooldata* get_vdo_data_from_props (GVariant *props, GError **error __attribute__((unused))) { ++static BDLVMVDOPooldata* get_vdo_data_from_props (GVariant *props, GError **error UNUSED) { + BDLVMVDOPooldata *data = g_new0 (BDLVMVDOPooldata, 1); + GVariantDict dict; + gchar *value = NULL; +@@ -1165,7 +1165,7 @@ static GVariant* create_size_str_param (guint64 size, const gchar *unit) { + * + * Tech category: %BD_LVM_TECH_CALCS no mode (it is ignored) + */ +-gboolean bd_lvm_is_supported_pe_size (guint64 size, GError **error __attribute__((unused))) { ++gboolean bd_lvm_is_supported_pe_size (guint64 size, GError **error UNUSED) { + return (((size % 2) == 0) && (size >= (BD_LVM_MIN_PE_SIZE)) && (size <= (BD_LVM_MAX_PE_SIZE))); + } + +@@ -1177,7 +1177,7 @@ gboolean bd_lvm_is_supported_pe_size (guint64 size, GError **error __attribute__ + * + * Tech category: %BD_LVM_TECH_CALCS no mode (it is ignored) + */ +-guint64 *bd_lvm_get_supported_pe_sizes (GError **error __attribute__((unused))) { ++guint64 *bd_lvm_get_supported_pe_sizes (GError **error UNUSED) { + guint8 i; + guint64 val = BD_LVM_MIN_PE_SIZE; + guint8 num_items = ((guint8) round (log2 ((double) BD_LVM_MAX_PE_SIZE))) - ((guint8) round (log2 ((double) BD_LVM_MIN_PE_SIZE))) + 2; +@@ -1199,7 +1199,7 @@ guint64 *bd_lvm_get_supported_pe_sizes (GError **error __attribute__((unused))) + * + * Tech category: %BD_LVM_TECH_CALCS no mode (it is ignored) + */ +-guint64 bd_lvm_get_max_lv_size (GError **error __attribute__((unused))) { ++guint64 bd_lvm_get_max_lv_size (GError **error UNUSED) { + return BD_LVM_MAX_LV_SIZE; + } + +@@ -1219,7 +1219,7 @@ guint64 bd_lvm_get_max_lv_size (GError **error __attribute__((unused))) { + * + * Tech category: %BD_LVM_TECH_CALCS no mode (it is ignored) + */ +-guint64 bd_lvm_round_size_to_pe (guint64 size, guint64 pe_size, gboolean roundup, GError **error __attribute__((unused))) { ++guint64 bd_lvm_round_size_to_pe (guint64 size, guint64 pe_size, gboolean roundup, GError **error UNUSED) { + pe_size = RESOLVE_PE_SIZE(pe_size); + guint64 delta = size % pe_size; + if (delta == 0) +@@ -1313,7 +1313,7 @@ guint64 bd_lvm_get_thpool_meta_size (guint64 size, guint64 chunk_size, guint64 n + * + * Tech category: %BD_LVM_TECH_THIN_CALCS no mode (it is ignored) + */ +-gboolean bd_lvm_is_valid_thpool_md_size (guint64 size, GError **error __attribute__((unused))) { ++gboolean bd_lvm_is_valid_thpool_md_size (guint64 size, GError **error UNUSED) { + return ((BD_LVM_MIN_THPOOL_MD_SIZE <= size) && (size <= BD_LVM_MAX_THPOOL_MD_SIZE)); + } + +@@ -1327,7 +1327,7 @@ gboolean bd_lvm_is_valid_thpool_md_size (guint64 size, GError **error __attribut + * + * Tech category: %BD_LVM_TECH_THIN_CALCS no mode (it is ignored) + */ +-gboolean bd_lvm_is_valid_thpool_chunk_size (guint64 size, gboolean discard, GError **error __attribute__((unused))) { ++gboolean bd_lvm_is_valid_thpool_chunk_size (guint64 size, gboolean discard, GError **error UNUSED) { + gdouble size_log2 = 0.0; + + if ((size < BD_LVM_MIN_THPOOL_CHUNK_SIZE) || (size > BD_LVM_MAX_THPOOL_CHUNK_SIZE)) +@@ -2616,7 +2616,7 @@ gboolean bd_lvm_thsnapshotcreate (const gchar *vg_name, const gchar *origin_name + * + * Tech category: %BD_LVM_TECH_GLOB_CONF no mode (it is ignored) + */ +-gboolean bd_lvm_set_global_config (const gchar *new_config, GError **error __attribute__((unused))) { ++gboolean bd_lvm_set_global_config (const gchar *new_config, GError **error UNUSED) { + /* XXX: the error attribute will likely be used in the future when + some validation comes into the game */ + +@@ -2641,7 +2641,7 @@ gboolean bd_lvm_set_global_config (const gchar *new_config, GError **error __att + * + * Tech category: %BD_LVM_TECH_GLOB_CONF no mode (it is ignored) + */ +-gchar* bd_lvm_get_global_config (GError **error __attribute__((unused))) { ++gchar* bd_lvm_get_global_config (GError **error UNUSED) { + gchar *ret = NULL; + + g_mutex_lock (&global_config_lock); +@@ -2660,7 +2660,7 @@ gchar* bd_lvm_get_global_config (GError **error __attribute__((unused))) { + * + * Tech category: %BD_LVM_TECH_CACHE_CALCS no mode (it is ignored) + */ +-guint64 bd_lvm_cache_get_default_md_size (guint64 cache_size, GError **error __attribute__((unused))) { ++guint64 bd_lvm_cache_get_default_md_size (guint64 cache_size, GError **error UNUSED) { + return MAX ((guint64) cache_size / 1000, BD_LVM_MIN_CACHE_MD_SIZE); + } + +@@ -2670,7 +2670,7 @@ guint64 bd_lvm_cache_get_default_md_size (guint64 cache_size, GError **error __a + * + * Get LV type string from flags. + */ +-static const gchar* get_lv_type_from_flags (BDLVMCachePoolFlags flags, gboolean meta, GError **error __attribute__((unused))) { ++static const gchar* get_lv_type_from_flags (BDLVMCachePoolFlags flags, gboolean meta, GError **error UNUSED) { + if (!meta) { + if (flags & BD_LVM_CACHE_POOL_STRIPED) + return "striped"; +diff --git a/src/plugins/lvm.c b/src/plugins/lvm.c +index 74493feb..2be1dbdb 100644 +--- a/src/plugins/lvm.c ++++ b/src/plugins/lvm.c +@@ -700,7 +700,7 @@ static BDLVMVDOPooldata* get_vdo_data_from_table (GHashTable *table, gboolean fr + * + * Tech category: %BD_LVM_TECH_CALCS no mode (it is ignored) + */ +-gboolean bd_lvm_is_supported_pe_size (guint64 size, GError **error __attribute__((unused))) { ++gboolean bd_lvm_is_supported_pe_size (guint64 size, GError **error UNUSED) { + return (((size % 2) == 0) && (size >= (BD_LVM_MIN_PE_SIZE)) && (size <= (BD_LVM_MAX_PE_SIZE))); + } + +@@ -712,7 +712,7 @@ gboolean bd_lvm_is_supported_pe_size (guint64 size, GError **error __attribute__ + * + * Tech category: %BD_LVM_TECH_CALCS no mode (it is ignored) + */ +-guint64 *bd_lvm_get_supported_pe_sizes (GError **error __attribute__((unused))) { ++guint64 *bd_lvm_get_supported_pe_sizes (GError **error UNUSED) { + guint8 i; + guint64 val = BD_LVM_MIN_PE_SIZE; + guint8 num_items = ((guint8) round (log2 ((double) BD_LVM_MAX_PE_SIZE))) - ((guint8) round (log2 ((double) BD_LVM_MIN_PE_SIZE))) + 2; +@@ -734,7 +734,7 @@ guint64 *bd_lvm_get_supported_pe_sizes (GError **error __attribute__((unused))) + * + * Tech category: %BD_LVM_TECH_CALCS no mode (it is ignored) + */ +-guint64 bd_lvm_get_max_lv_size (GError **error __attribute__((unused))) { ++guint64 bd_lvm_get_max_lv_size (GError **error UNUSED) { + return BD_LVM_MAX_LV_SIZE; + } + +@@ -754,7 +754,7 @@ guint64 bd_lvm_get_max_lv_size (GError **error __attribute__((unused))) { + * + * Tech category: %BD_LVM_TECH_CALCS no mode (it is ignored) + */ +-guint64 bd_lvm_round_size_to_pe (guint64 size, guint64 pe_size, gboolean roundup, GError **error __attribute__((unused))) { ++guint64 bd_lvm_round_size_to_pe (guint64 size, guint64 pe_size, gboolean roundup, GError **error UNUSED) { + pe_size = RESOLVE_PE_SIZE(pe_size); + guint64 delta = size % pe_size; + if (delta == 0) +@@ -848,7 +848,7 @@ guint64 bd_lvm_get_thpool_meta_size (guint64 size, guint64 chunk_size, guint64 n + * + * Tech category: %BD_LVM_TECH_THIN_CALCS no mode (it is ignored) + */ +-gboolean bd_lvm_is_valid_thpool_md_size (guint64 size, GError **error __attribute__((unused))) { ++gboolean bd_lvm_is_valid_thpool_md_size (guint64 size, GError **error UNUSED) { + return ((BD_LVM_MIN_THPOOL_MD_SIZE <= size) && (size <= BD_LVM_MAX_THPOOL_MD_SIZE)); + } + +@@ -862,7 +862,7 @@ gboolean bd_lvm_is_valid_thpool_md_size (guint64 size, GError **error __attribut + * + * Tech category: %BD_LVM_TECH_THIN_CALCS no mode (it is ignored) + */ +-gboolean bd_lvm_is_valid_thpool_chunk_size (guint64 size, gboolean discard, GError **error __attribute__((unused))) { ++gboolean bd_lvm_is_valid_thpool_chunk_size (guint64 size, gboolean discard, GError **error UNUSED) { + gdouble size_log2 = 0.0; + + if ((size < BD_LVM_MIN_THPOOL_CHUNK_SIZE) || (size > BD_LVM_MAX_THPOOL_CHUNK_SIZE)) +@@ -1983,7 +1983,7 @@ gboolean bd_lvm_thsnapshotcreate (const gchar *vg_name, const gchar *origin_name + * + * Tech category: %BD_LVM_TECH_GLOB_CONF no mode (it is ignored) + */ +-gboolean bd_lvm_set_global_config (const gchar *new_config, GError **error __attribute__((unused))) { ++gboolean bd_lvm_set_global_config (const gchar *new_config, GError **error UNUSED) { + /* XXX: the error attribute will likely be used in the future when + some validation comes into the game */ + +@@ -2008,7 +2008,7 @@ gboolean bd_lvm_set_global_config (const gchar *new_config, GError **error __att + * + * Tech category: %BD_LVM_TECH_GLOB_CONF no mode (it is ignored) + */ +-gchar* bd_lvm_get_global_config (GError **error __attribute__((unused))) { ++gchar* bd_lvm_get_global_config (GError **error UNUSED) { + gchar *ret = NULL; + + g_mutex_lock (&global_config_lock); +@@ -2027,7 +2027,7 @@ gchar* bd_lvm_get_global_config (GError **error __attribute__((unused))) { + * + * Tech category: %BD_LVM_TECH_CACHE_CALCS no mode (it is ignored) + */ +-guint64 bd_lvm_cache_get_default_md_size (guint64 cache_size, GError **error __attribute__((unused))) { ++guint64 bd_lvm_cache_get_default_md_size (guint64 cache_size, GError **error UNUSED) { + return MAX ((guint64) cache_size / 1000, BD_LVM_MIN_CACHE_MD_SIZE); + } + +@@ -2037,7 +2037,7 @@ guint64 bd_lvm_cache_get_default_md_size (guint64 cache_size, GError **error __a + * + * Get LV type string from flags. + */ +-static const gchar* get_lv_type_from_flags (BDLVMCachePoolFlags flags, gboolean meta, GError **error __attribute__((unused))) { ++static const gchar* get_lv_type_from_flags (BDLVMCachePoolFlags flags, gboolean meta, GError **error UNUSED) { + if (!meta) { + if (flags & BD_LVM_CACHE_POOL_STRIPED) + return "striped"; + +From f106e775d3c73e5f97512dd109627e00539b703a Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +Date: Tue, 15 Dec 2020 14:53:13 +0100 +Subject: [PATCH 5/5] Fix max size limit for LVM thinpool metadata + +DM_THIN_MAX_METADATA_SIZE is in 512 sectors, not in KiB so the +upper limit is 15.81 GiB not 31.62 GiB +--- + src/lib/plugin_apis/lvm.api | 2 +- + src/plugins/lvm.h | 10 ++++++---- + tests/lvm_dbus_tests.py | 3 ++- + tests/lvm_test.py | 3 ++- + 4 files changed, 11 insertions(+), 7 deletions(-) + +diff --git a/src/lib/plugin_apis/lvm.api b/src/lib/plugin_apis/lvm.api +index 9f25c1ed..563c1041 100644 +--- a/src/lib/plugin_apis/lvm.api ++++ b/src/lib/plugin_apis/lvm.api +@@ -20,7 +20,7 @@ + #define BD_LVM_MIN_PE_SIZE G_GUINT64_CONSTANT (1024ULL) // 1 KiB + #define BD_LVM_MAX_PE_SIZE G_GUINT64_CONSTANT (17179869184ULL) // 16 GiB + #define BD_LVM_MIN_THPOOL_MD_SIZE G_GUINT64_CONSTANT (4194304ULL) // 4 MiB +-#define BD_LVM_MAX_THPOOL_MD_SIZE G_GUINT64_CONSTANT (33957085184ULL) // 31.62 GiB ++#define BD_LVM_MAX_THPOOL_MD_SIZE G_GUINT64_CONSTANT (16978542592ULL) // 15.81 GiB + #define BD_LVM_MIN_THPOOL_CHUNK_SIZE G_GUINT64_CONSTANT (65536ULL) // 64 KiB + #define BD_LVM_MAX_THPOOL_CHUNK_SIZE G_GUINT64_CONSTANT (1073741824ULL) // 1 GiB + #define BD_LVM_DEFAULT_CHUNK_SIZE G_GUINT64_CONSTANT (65536ULL) // 64 KiB +diff --git a/src/plugins/lvm.h b/src/plugins/lvm.h +index 01c06ca4..2162d769 100644 +--- a/src/plugins/lvm.h ++++ b/src/plugins/lvm.h +@@ -22,11 +22,13 @@ + #define USE_DEFAULT_PE_SIZE 0 + #define RESOLVE_PE_SIZE(size) ((size) == USE_DEFAULT_PE_SIZE ? BD_LVM_DEFAULT_PE_SIZE : (size)) + +-/* lvm constants for thin pool metadata size are actually half of these +- but when they calculate the actual metadata size they double the limits +- so lets just double the limits here too */ ++/* lvm constant for thin pool metadata size is actually half of this ++ but when they calculate the actual metadata size they double the limit ++ so lets just double the limit here too */ + #define BD_LVM_MIN_THPOOL_MD_SIZE (4 MiB) +-#define BD_LVM_MAX_THPOOL_MD_SIZE (DM_THIN_MAX_METADATA_SIZE KiB) ++ ++/* DM_THIN_MAX_METADATA_SIZE is in 512 sectors */ ++#define BD_LVM_MAX_THPOOL_MD_SIZE (DM_THIN_MAX_METADATA_SIZE * 512) + + #define BD_LVM_MIN_THPOOL_CHUNK_SIZE (64 KiB) + #define BD_LVM_MAX_THPOOL_CHUNK_SIZE (1 GiB) +diff --git a/tests/lvm_dbus_tests.py b/tests/lvm_dbus_tests.py +index c06a480c..8f2bb95d 100644 +--- a/tests/lvm_dbus_tests.py ++++ b/tests/lvm_dbus_tests.py +@@ -160,10 +160,11 @@ def test_is_valid_thpool_md_size(self): + + self.assertTrue(BlockDev.lvm_is_valid_thpool_md_size(4 * 1024**2)) + self.assertTrue(BlockDev.lvm_is_valid_thpool_md_size(5 * 1024**2)) +- self.assertTrue(BlockDev.lvm_is_valid_thpool_md_size(16 * 1024**3)) ++ self.assertTrue(BlockDev.lvm_is_valid_thpool_md_size(15 * 1024**3)) + + self.assertFalse(BlockDev.lvm_is_valid_thpool_md_size(1 * 1024**2)) + self.assertFalse(BlockDev.lvm_is_valid_thpool_md_size(3 * 1024**2)) ++ self.assertFalse(BlockDev.lvm_is_valid_thpool_md_size(16 * 1024**3)) + self.assertFalse(BlockDev.lvm_is_valid_thpool_md_size(32 * 1024**3)) + + @tag_test(TestTags.NOSTORAGE) +diff --git a/tests/lvm_test.py b/tests/lvm_test.py +index b84adece..6f80a3ba 100644 +--- a/tests/lvm_test.py ++++ b/tests/lvm_test.py +@@ -150,10 +150,11 @@ def test_is_valid_thpool_md_size(self): + + self.assertTrue(BlockDev.lvm_is_valid_thpool_md_size(4 * 1024**2)) + self.assertTrue(BlockDev.lvm_is_valid_thpool_md_size(5 * 1024**2)) +- self.assertTrue(BlockDev.lvm_is_valid_thpool_md_size(16 * 1024**3)) ++ self.assertTrue(BlockDev.lvm_is_valid_thpool_md_size(15 * 1024**3)) + + self.assertFalse(BlockDev.lvm_is_valid_thpool_md_size(1 * 1024**2)) + self.assertFalse(BlockDev.lvm_is_valid_thpool_md_size(3 * 1024**2)) ++ self.assertFalse(BlockDev.lvm_is_valid_thpool_md_size(16 * 1024**3)) + self.assertFalse(BlockDev.lvm_is_valid_thpool_md_size(32 * 1024**3)) + + @tag_test(TestTags.NOSTORAGE) diff --git a/0004-Fix-default-key-size-for-non-XTS-ciphers.patch b/0004-Fix-default-key-size-for-non-XTS-ciphers.patch new file mode 100644 index 0000000..6292ac7 --- /dev/null +++ b/0004-Fix-default-key-size-for-non-XTS-ciphers.patch @@ -0,0 +1,97 @@ +From 5d29bc014a33d9bdc1c5fb4b8add2f38850f46a8 Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +Date: Wed, 24 Feb 2021 14:44:03 +0100 +Subject: [PATCH] crypto: Fix default key size for non XTS ciphers + +512 bits should be default only for AES-XTS which needs two keys, +default for other modes must be 256 bits. + +resolves: rhbz#1931847 +--- + src/plugins/crypto.c | 11 +++++++++-- + src/plugins/crypto.h | 2 +- + tests/crypto_test.py | 36 ++++++++++++++++++++++++++++++++++++ + 3 files changed, 46 insertions(+), 3 deletions(-) + +diff --git a/src/plugins/crypto.c b/src/plugins/crypto.c +index f4a2e8f0..1e7043fa 100644 +--- a/src/plugins/crypto.c ++++ b/src/plugins/crypto.c +@@ -774,8 +774,15 @@ static gboolean luks_format (const gchar *device, const gchar *cipher, guint64 k + return FALSE; + } + +- /* resolve requested/default key_size (should be in bytes) */ +- key_size = (key_size != 0) ? (key_size / 8) : (DEFAULT_LUKS_KEYSIZE_BITS / 8); ++ if (key_size == 0) { ++ if (g_str_has_prefix (cipher_specs[1], "xts-")) ++ key_size = DEFAULT_LUKS_KEYSIZE_BITS * 2; ++ else ++ key_size = DEFAULT_LUKS_KEYSIZE_BITS; ++ } ++ ++ /* key_size should be in bytes */ ++ key_size = key_size / 8; + + /* wait for enough random data entropy (if requested) */ + if (min_entropy > 0) { +diff --git a/src/plugins/crypto.h b/src/plugins/crypto.h +index 71a1438d..a38724d9 100644 +--- a/src/plugins/crypto.h ++++ b/src/plugins/crypto.h +@@ -36,7 +36,7 @@ typedef enum { + /* 20 chars * 6 bits per char (64-item charset) = 120 "bits of security" */ + #define BD_CRYPTO_BACKUP_PASSPHRASE_LENGTH 20 + +-#define DEFAULT_LUKS_KEYSIZE_BITS 512 ++#define DEFAULT_LUKS_KEYSIZE_BITS 256 + #define DEFAULT_LUKS_CIPHER "aes-xts-plain64" + #define DEFAULT_LUKS2_SECTOR_SIZE 512 + +diff --git a/tests/crypto_test.py b/tests/crypto_test.py +index 0609a070..0aecc032 100644 +--- a/tests/crypto_test.py ++++ b/tests/crypto_test.py +@@ -236,6 +236,42 @@ def test_luks2_format(self): + self.fail("Failed to get pbkdf information from:\n%s %s" % (out, err)) + self.assertEqual(int(m.group(1)), 5) + ++ def _get_luks1_key_size(self, device): ++ _ret, out, err = run_command("cryptsetup luksDump %s" % device) ++ m = re.search(r"MK bits:\s*(\S+)\s*", out) ++ if not m or len(m.groups()) != 1: ++ self.fail("Failed to get key size information from:\n%s %s" % (out, err)) ++ key_size = m.group(1) ++ if not key_size.isnumeric(): ++ self.fail("Failed to get key size information from: %s" % key_size) ++ return int(key_size) ++ ++ @tag_test(TestTags.SLOW, TestTags.CORE) ++ def test_luks_format_key_size(self): ++ """Verify that formating device as LUKS works""" ++ ++ # aes-xts: key size should default to 512 ++ succ = BlockDev.crypto_luks_format(self.loop_dev, "aes-xts-plain64", 0, PASSWD, None, 0) ++ self.assertTrue(succ) ++ ++ key_size = self._get_luks1_key_size(self.loop_dev) ++ self.assertEqual(key_size, 512) ++ ++ # aes-cbc: key size should default to 256 ++ succ = BlockDev.crypto_luks_format(self.loop_dev, "aes-cbc-essiv:sha256", 0, PASSWD, None, 0) ++ self.assertTrue(succ) ++ ++ key_size = self._get_luks1_key_size(self.loop_dev) ++ self.assertEqual(key_size, 256) ++ ++ # try specifying key size for aes-xts ++ succ = BlockDev.crypto_luks_format(self.loop_dev, "aes-xts-plain64", 256, PASSWD, None, 0) ++ self.assertTrue(succ) ++ ++ key_size = self._get_luks1_key_size(self.loop_dev) ++ self.assertEqual(key_size, 256) ++ ++ + class CryptoTestResize(CryptoTestCase): + + def _get_key_location(self, device): diff --git a/0005-Add-workarounds-for-some-LVM-test-issues.patch b/0005-Add-workarounds-for-some-LVM-test-issues.patch new file mode 100644 index 0000000..c41d687 --- /dev/null +++ b/0005-Add-workarounds-for-some-LVM-test-issues.patch @@ -0,0 +1,157 @@ +From 7c31cc534f96766dd2e3427b09d0affca66b0745 Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +Date: Tue, 23 Mar 2021 13:54:02 +0100 +Subject: [PATCH 1/3] tests: Do not try to remove VG before removing the VDO + pool + +--- + tests/lvm_dbus_tests.py | 6 +++--- + tests/lvm_test.py | 6 +++--- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/tests/lvm_dbus_tests.py b/tests/lvm_dbus_tests.py +index 8f2bb95d..b599fdd0 100644 +--- a/tests/lvm_dbus_tests.py ++++ b/tests/lvm_dbus_tests.py +@@ -1517,14 +1517,14 @@ def setUp(self): + self.assertTrue(succ) + + def _clean_up(self): +- BlockDev.lvm_vgremove("testVDOVG") +- BlockDev.lvm_pvremove(self.loop_dev) +- + try: + BlockDev.lvm_lvremove("testVDOVG", "vdoPool", True, None) + except: + pass + ++ BlockDev.lvm_vgremove("testVDOVG") ++ BlockDev.lvm_pvremove(self.loop_dev) ++ + try: + delete_lio_device(self.loop_dev) + except RuntimeError: +diff --git a/tests/lvm_test.py b/tests/lvm_test.py +index 6f80a3ba..6c04faf9 100644 +--- a/tests/lvm_test.py ++++ b/tests/lvm_test.py +@@ -1437,14 +1437,14 @@ def setUp(self): + self.assertTrue(succ) + + def _clean_up(self): +- BlockDev.lvm_vgremove("testVDOVG") +- BlockDev.lvm_pvremove(self.loop_dev) +- + try: + BlockDev.lvm_lvremove("testVDOVG", "vdoPool", True, None) + except: + pass + ++ BlockDev.lvm_vgremove("testVDOVG") ++ BlockDev.lvm_pvremove(self.loop_dev) ++ + try: + delete_lio_device(self.loop_dev) + except RuntimeError: + +From 41b9d745b8c1a33221e15683f390bae180d1e960 Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +Date: Tue, 23 Mar 2021 13:59:24 +0100 +Subject: [PATCH 2/3] tests: Force remove LVM VG /dev/ entry not removed by + vgremove + +The directory is sometimes not removed. This is a known bug that +causes subsequent test cases to fail. +--- + tests/lvm_dbus_tests.py | 6 ++++++ + tests/lvm_test.py | 6 ++++++ + 2 files changed, 12 insertions(+) + +diff --git a/tests/lvm_dbus_tests.py b/tests/lvm_dbus_tests.py +index b599fdd0..3278716e 100644 +--- a/tests/lvm_dbus_tests.py ++++ b/tests/lvm_dbus_tests.py +@@ -399,6 +399,9 @@ def _clean_up(self): + except: + pass + ++ # XXX remove lingering /dev entries ++ shutil.rmtree("/dev/testVG", ignore_errors=True) ++ + LvmPVonlyTestCase._clean_up(self) + + @unittest.skipUnless(lvm_dbus_running, "LVM DBus not running") +@@ -1525,6 +1528,9 @@ def _clean_up(self): + BlockDev.lvm_vgremove("testVDOVG") + BlockDev.lvm_pvremove(self.loop_dev) + ++ # XXX remove lingering /dev entries ++ shutil.rmtree("/dev/testVDOVG", ignore_errors=True) ++ + try: + delete_lio_device(self.loop_dev) + except RuntimeError: +diff --git a/tests/lvm_test.py b/tests/lvm_test.py +index 6c04faf9..d7e1f84c 100644 +--- a/tests/lvm_test.py ++++ b/tests/lvm_test.py +@@ -378,6 +378,9 @@ def _clean_up(self): + except: + pass + ++ # XXX remove lingering /dev entries ++ shutil.rmtree("/dev/testVG", ignore_errors=True) ++ + LvmPVonlyTestCase._clean_up(self) + + class LvmTestVGcreateRemove(LvmPVVGTestCase): +@@ -1445,6 +1448,9 @@ def _clean_up(self): + BlockDev.lvm_vgremove("testVDOVG") + BlockDev.lvm_pvremove(self.loop_dev) + ++ # XXX remove lingering /dev entries ++ shutil.rmtree("/dev/testVDOVG", ignore_errors=True) ++ + try: + delete_lio_device(self.loop_dev) + except RuntimeError: + +From 4ecf0075cedf3a1d275d34b94ce5bb512c4e970e Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +Date: Tue, 23 Mar 2021 14:03:44 +0100 +Subject: [PATCH 3/3] tests: Tag LvmPVVGLVcachePoolCreateRemoveTestCase as + unstable + +LVM randomly fails to activate the newly created metadata LV. +Issue is reported to LVM and not yet fixed. +--- + tests/lvm_dbus_tests.py | 2 +- + tests/lvm_test.py | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/lvm_dbus_tests.py b/tests/lvm_dbus_tests.py +index 3278716e..4882da88 100644 +--- a/tests/lvm_dbus_tests.py ++++ b/tests/lvm_dbus_tests.py +@@ -1213,7 +1213,7 @@ def _clean_up(self): + + @unittest.skipUnless(lvm_dbus_running, "LVM DBus not running") + class LvmPVVGLVcachePoolCreateRemoveTestCase(LvmPVVGLVcachePoolTestCase): +- @tag_test(TestTags.SLOW) ++ @tag_test(TestTags.SLOW, TestTags.UNSTABLE) + def test_cache_pool_create_remove(self): + """Verify that is it possible to create and remove a cache pool""" + +diff --git a/tests/lvm_test.py b/tests/lvm_test.py +index d7e1f84c..eb94c917 100644 +--- a/tests/lvm_test.py ++++ b/tests/lvm_test.py +@@ -1129,7 +1129,7 @@ def _clean_up(self): + LvmPVVGLVTestCase._clean_up(self) + + class LvmPVVGLVcachePoolCreateRemoveTestCase(LvmPVVGLVcachePoolTestCase): +- @tag_test(TestTags.SLOW) ++ @tag_test(TestTags.SLOW, TestTags.UNSTABLE) + def test_cache_pool_create_remove(self): + """Verify that is it possible to create and remove a cache pool""" + diff --git a/0006-Fix-vdo-stats-calculation.patch b/0006-Fix-vdo-stats-calculation.patch new file mode 100644 index 0000000..f062e55 --- /dev/null +++ b/0006-Fix-vdo-stats-calculation.patch @@ -0,0 +1,27 @@ +From 2f2dd62b6f6aa61f14f108b95cee7e82f4114614 Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +Date: Mon, 22 Nov 2021 14:16:02 +0100 +Subject: [PATCH] vdo_stats: Default to 100 % savings for invalid savings + values + +We are currently using "-1" when VDO logical_blocks_used is 0 +which doesn't match the LVM logic which returns 100 so to make +both values in vdo_info and vdo_stats equal we should return 100 +in this case too. +--- + src/plugins/vdo_stats.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/plugins/vdo_stats.c b/src/plugins/vdo_stats.c +index ed04b5101..9f2a24c89 100644 +--- a/src/plugins/vdo_stats.c ++++ b/src/plugins/vdo_stats.c +@@ -96,7 +96,7 @@ static void add_block_stats (GHashTable *stats) { + g_hash_table_replace (stats, g_strdup ("oneKBlocksUsed"), g_strdup_printf ("%"G_GINT64_FORMAT, (data_blocks_used + overhead_blocks_used) * block_size / 1024)); + g_hash_table_replace (stats, g_strdup ("oneKBlocksAvailable"), g_strdup_printf ("%"G_GINT64_FORMAT, (physical_blocks - data_blocks_used - overhead_blocks_used) * block_size / 1024)); + g_hash_table_replace (stats, g_strdup ("usedPercent"), g_strdup_printf ("%.0f", 100.0 * (gfloat) (data_blocks_used + overhead_blocks_used) / (gfloat) physical_blocks + 0.5)); +- savings = (logical_blocks_used > 0) ? (gint64) (100.0 * (gfloat) (logical_blocks_used - data_blocks_used) / (gfloat) logical_blocks_used) : -1; ++ savings = (logical_blocks_used > 0) ? (gint64) (100.0 * (gfloat) (logical_blocks_used - data_blocks_used) / (gfloat) logical_blocks_used) : 100; + g_hash_table_replace (stats, g_strdup ("savings"), g_strdup_printf ("%"G_GINT64_FORMAT, savings)); + if (savings >= 0) + g_hash_table_replace (stats, g_strdup ("savingPercent"), g_strdup_printf ("%"G_GINT64_FORMAT, savings)); diff --git a/EMPTY b/EMPTY deleted file mode 100644 index 0519ecb..0000000 --- a/EMPTY +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/libblockdev.spec b/libblockdev.spec new file mode 100644 index 0000000..c27f9f1 --- /dev/null +++ b/libblockdev.spec @@ -0,0 +1,2068 @@ +%define with_python2 1 +%define with_python3 1 +%define with_gtk_doc 1 +%define with_bcache 1 +%define with_btrfs 1 +%define with_crypto 1 +%define with_dm 1 +%define with_loop 1 +%define with_lvm 1 +%define with_lvm_dbus 1 +%define with_mdraid 1 +%define with_mpath 1 +%define with_swap 1 +%define with_kbd 1 +%define with_part 1 +%define with_fs 1 +%define with_nvdimm 1 +%define with_vdo 1 +%define with_gi 1 +%define with_escrow 1 +%define with_dmraid 0 +%define with_tools 1 + +# python2 is not available on RHEL > 7 and not needed on Fedora > 29 +%if 0%{?rhel} > 7 || 0%{?fedora} > 29 || %{with_python2} == 0 +%define with_python2 0 +%define python2_copts --without-python2 +%endif + +# python3 is not available on older RHEL +%if (! 0%{?fedora} && 0%{?rhel} <= 7) || %{with_python3} == 0 +%define with_python3 0 +%define python3_copts --without-python3 +%endif + +# bcache is not available on RHEL +%if (0%{?rhel}) || %{with_bcache} == 0 +%define with_bcache 0 +%define bcache_copts --without-bcache +%endif + +# lvm_dbus is not available on older RHEL +%if (! 0%{?fedora} && 0%{?rhel} <= 7) || %{with_lvm_dbus} == 0 +%define with_lvm_dbus 0 +%define lvm_dbus_copts --without-lvm-dbus +%endif + +# vdo is not available on non-x86_64 on older RHEL +%if (0%{?rhel} && 0%{?rhel} <= 7) +%ifnarch x86_64 aarch64 s390x ppc64le +%define with_vdo 0 +%define vdo_copts --without-vdo +%endif +%endif + +# btrfs is not available on RHEL > 7 +%if 0%{?rhel} > 7 || %{with_btrfs} == 0 +%define with_btrfs 0 +%define btrfs_copts --without-btrfs +%endif + +# dmraid is not available on RHEL > 7 +%if 0%{?rhel} > 7 +%define with_dmraid 0 +%endif + +%if %{with_btrfs} != 1 +%define btrfs_copts --without-btrfs +%endif +%if %{with_crypto} != 1 +%define crypto_copts --without-crypto +%else +%if %{with_escrow} != 1 +%define crypto_copts --without-escrow +%endif +%endif +%if %{with_dm} != 1 +%define dm_copts --without-dm +%else +%if %{with_dmraid} != 1 +%define dm_copts --without-dmraid +%endif +%endif +%if %{with_loop} != 1 +%define loop_copts --without-loop +%endif +%if %{with_lvm} != 1 +%define lvm_copts --without-lvm +%endif +%if %{with_lvm_dbus} != 1 +%define lvm_dbus_copts --without-lvm_dbus +%endif +%if %{with_mdraid} != 1 +%define mdraid_copts --without-mdraid +%endif +%if %{with_mpath} != 1 +%define mpath_copts --without-mpath +%endif +%if %{with_swap} != 1 +%define swap_copts --without-swap +%endif +%if %{with_kbd} != 1 +%define kbd_copts --without-kbd +%endif +%if %{with_part} != 1 +%define part_copts --without-part +%endif +%if %{with_fs} != 1 +%define fs_copts --without-fs +%endif +%if %{with_nvdimm} != 1 +%define nvdimm_copts --without-nvdimm +%endif +%if %{with_vdo} != 1 +%define vdo_copts --without-vdo +%endif +%if %{with_tools} != 1 +%define tools_copts --without-tools +%endif +%if %{with_gi} != 1 +%define gi_copts --disable-introspection +%endif + +%define configure_opts %{?python2_copts} %{?python3_copts} %{?bcache_copts} %{?lvm_dbus_copts} %{?btrfs_copts} %{?crypto_copts} %{?dm_copts} %{?loop_copts} %{?lvm_copts} %{?lvm_dbus_copts} %{?mdraid_copts} %{?mpath_copts} %{?swap_copts} %{?kbd_copts} %{?part_copts} %{?fs_copts} %{?nvdimm_copts} %{?vdo_copts} %{?tools_copts} %{?gi_copts} + +Name: libblockdev +Version: 2.24 +Release: 8%{?dist} +Summary: A library for low-level manipulation with block devices +License: LGPLv2+ +URL: https://github.com/storaged-project/libblockdev +Source0: https://github.com/storaged-project/libblockdev/releases/download/%{version}-%{release}/%{name}-%{version}.tar.gz +Patch0: 0001-exec-Fix-setting-locale-for-util-calls.patch +Patch1: 0002-exec-polling-fixes.patch +Patch2: 0003-LVM-thin-metadata-calculation-fix.patch +Patch3: 0004-Fix-default-key-size-for-non-XTS-ciphers.patch +Patch4: 0005-Add-workarounds-for-some-LVM-test-issues.patch +Patch5: 0006-Fix-vdo-stats-calculation.patch + +BuildRequires: glib2-devel +%if %{with_gi} +BuildRequires: gobject-introspection-devel +%endif +%if %{with_python2} +BuildRequires: python2-devel +%else +# Obsolete the python2 subpackage to avoid errors on upgrade +Obsoletes: python2-blockdev < %{version}-%{release} +%endif +%if %{with_python3} +BuildRequires: python3-devel +%endif +%if %{with_gtk_doc} +BuildRequires: gtk-doc +%endif +BuildRequires: glib2-doc +BuildRequires: autoconf-archive + +Requires: %{name}-utils%{?_isa} = %{version}-%{release} + +# Needed for the escrow tests in tests/crypto_test.py, but not used to build +# BuildRequires: volume_key +# BuildRequires: nss-tools + +# Needed for python 2 vs. 3 compatibility in the tests, but not used to build +# BuildRequires: python2-six +# BuildRequires: python3-six + +%description +The libblockdev is a C library with GObject introspection support that can be +used for doing low-level operations with block devices like setting up LVM, +BTRFS, LUKS or MD RAID. The library uses plugins (LVM, BTRFS,...) and serves as +a thin wrapper around its plugins' functionality. All the plugins, however, can +be used as standalone libraries. One of the core principles of libblockdev is +that it is stateless from the storage configuration's perspective (e.g. it has +no information about VGs when creating an LV). + +%package devel +Summary: Development files for libblockdev +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: glib2-devel + +%description devel +This package contains header files and pkg-config files needed for development +with the libblockdev library. + +%if %{with_python2} +%package -n python2-blockdev +Summary: Python2 gobject-introspection bindings for libblockdev +Requires: %{name}%{?_isa} = %{version}-%{release} + +%if 0%{?fedora} <= 26 || 0%{?rhel} <= 7 +Requires: pygobject3-base +%else +Requires: python2-gobject-base +%endif +%{?python_provide:%python_provide python2-blockdev} + +%description -n python2-blockdev +This package contains enhancements to the gobject-introspection bindings for +libblockdev in Python2. +%endif + +%if %{with_python3} +%package -n python3-blockdev +Summary: Python3 gobject-introspection bindings for libblockdev +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: python3-gobject-base +%{?python_provide:%python_provide python3-blockdev} + +%description -n python3-blockdev +This package contains enhancements to the gobject-introspection bindings for +libblockdev in Python3. +%endif + +%package utils +BuildRequires: kmod-devel +Summary: A library with utility functions for the libblockdev library + +%description utils +The libblockdev-utils is a library providing utility functions used by the +libblockdev library and its plugins. + +%package utils-devel +Summary: Development files for libblockdev-utils +Requires: %{name}-utils%{?_isa} = %{version}-%{release} +Requires: glib2-devel + +%description utils-devel +This package contains header files and pkg-config files needed for development +with the libblockdev-utils library. + + +%if %{with_btrfs} +%package btrfs +BuildRequires: libbytesize-devel +Summary: The BTRFS plugin for the libblockdev library +Requires: %{name}-utils%{?_isa} = %{version}-%{release} +Requires: btrfs-progs + +%description btrfs +The libblockdev library plugin (and in the same time a standalone library) +providing the BTRFS-related functionality. + +%package btrfs-devel +Summary: Development files for the libblockdev-btrfs plugin/library +Requires: %{name}-btrfs%{?_isa} = %{version}-%{release} +Requires: glib2-devel +Requires: %{name}-utils-devel%{?_isa} = %{version}-%{release} + +%description btrfs-devel +This package contains header files and pkg-config files needed for development +with the libblockdev-btrfs plugin/library. +%endif + + +%if %{with_crypto} +%package crypto +BuildRequires: cryptsetup-devel +BuildRequires: libblkid-devel + +%if %{with_escrow} +BuildRequires: volume_key-devel >= 0.3.9-7 +BuildRequires: nss-devel +%endif + +Summary: The crypto plugin for the libblockdev library +Requires: %{name}-utils%{?_isa} = %{version}-%{release} + +%description crypto +The libblockdev library plugin (and in the same time a standalone library) +providing the functionality related to encrypted devices (LUKS). + +%package crypto-devel +Summary: Development files for the libblockdev-crypto plugin/library +Requires: %{name}-crypto%{?_isa} = %{version}-%{release} +Requires: %{name}-utils-devel%{?_isa} = %{version}-%{release} +Requires: glib2-devel + +%description crypto-devel +This package contains header files and pkg-config files needed for development +with the libblockdev-crypto plugin/library. +%endif + + +%if %{with_dm} +%package dm +BuildRequires: device-mapper-devel +%if %{with_dmraid} +BuildRequires: dmraid-devel +%endif +BuildRequires: systemd-devel +Summary: The Device Mapper plugin for the libblockdev library +Requires: %{name}-utils%{?_isa} = %{version}-%{release} +Requires: device-mapper +%if %{with_dmraid} +Requires: dmraid +%endif + +%description dm +The libblockdev library plugin (and in the same time a standalone library) +providing the functionality related to Device Mapper. + +%package dm-devel +Summary: Development files for the libblockdev-dm plugin/library +Requires: %{name}-dm%{?_isa} = %{version}-%{release} +Requires: glib2-devel +Requires: device-mapper-devel +Requires: systemd-devel +%if %{with_dmraid} +Requires: dmraid-devel +%endif +Requires: %{name}-utils-devel%{?_isa} = %{version}-%{release} + +%description dm-devel +This package contains header files and pkg-config files needed for development +with the libblockdev-dm plugin/library. +%endif + + +%if %{with_fs} +%package fs +BuildRequires: parted-devel +BuildRequires: libblkid-devel +BuildRequires: libmount-devel +Summary: The FS plugin for the libblockdev library +Requires: %{name}-utils%{?_isa} = %{version}-%{release} + +%description fs +The libblockdev library plugin (and in the same time a standalone library) +providing the functionality related to operations with file systems. + +%package fs-devel +Summary: Development files for the libblockdev-fs plugin/library +Requires: %{name}-fs%{?_isa} = %{version}-%{release} +Requires: %{name}-utils-devel%{?_isa} = %{version}-%{release} +Requires: glib2-devel +Requires: xfsprogs +Requires: dosfstools + +%description fs-devel +This package contains header files and pkg-config files needed for development +with the libblockdev-fs plugin/library. +%endif + + +%if %{with_kbd} +%package kbd +BuildRequires: libbytesize-devel +Summary: The KBD plugin for the libblockdev library +Requires: %{name}-utils%{?_isa} = %{version}-%{release} +%if %{with_bcache} +Requires: bcache-tools >= 1.0.8 +%endif + +%description kbd +The libblockdev library plugin (and in the same time a standalone library) +providing the functionality related to kernel block devices (namely zRAM and +Bcache). + +%package kbd-devel +Summary: Development files for the libblockdev-kbd plugin/library +Requires: %{name}-kbd%{?_isa} = %{version}-%{release} +Requires: %{name}-utils-devel%{?_isa} = %{version}-%{release} +Requires: glib2-devel + +%description kbd-devel +This package contains header files and pkg-config files needed for development +with the libblockdev-kbd plugin/library. +%endif + + +%if %{with_loop} +%package loop +Summary: The loop plugin for the libblockdev library +Requires: %{name}-utils%{?_isa} = %{version}-%{release} + +%description loop +The libblockdev library plugin (and in the same time a standalone library) +providing the functionality related to loop devices. + +%package loop-devel +Summary: Development files for the libblockdev-loop plugin/library +Requires: %{name}-loop%{?_isa} = %{version}-%{release} +Requires: %{name}-utils-devel%{?_isa} = %{version}-%{release} +Requires: glib2-devel + +%description loop-devel +This package contains header files and pkg-config files needed for development +with the libblockdev-loop plugin/library. +%endif + + +%if %{with_lvm} +%package lvm +BuildRequires: device-mapper-devel +Summary: The LVM plugin for the libblockdev library +Requires: %{name}-utils%{?_isa} = %{version}-%{release} +Requires: lvm2 +# for thin_metadata_size +Requires: device-mapper-persistent-data + +%description lvm +The libblockdev library plugin (and in the same time a standalone library) +providing the LVM-related functionality. + +%package lvm-devel +Summary: Development files for the libblockdev-lvm plugin/library +Requires: %{name}-lvm%{?_isa} = %{version}-%{release} +Requires: %{name}-utils-devel%{?_isa} = %{version}-%{release} +Requires: glib2-devel + +%description lvm-devel +This package contains header files and pkg-config files needed for development +with the libblockdev-lvm plugin/library. +%endif + +%if %{with_lvm_dbus} +%package lvm-dbus +BuildRequires: device-mapper-devel +Summary: The LVM plugin for the libblockdev library +Requires: %{name}-utils%{?_isa} = %{version}-%{release} +Requires: lvm2-dbusd >= 2.02.156 +# for thin_metadata_size +Requires: device-mapper-persistent-data + +%description lvm-dbus +The libblockdev library plugin (and in the same time a standalone library) +providing the LVM-related functionality utilizing the LVM DBus API. + +%package lvm-dbus-devel +Summary: Development files for the libblockdev-lvm-dbus plugin/library +Requires: %{name}-lvm-dbus%{?_isa} = %{version}-%{release} +Requires: %{name}-utils-devel%{?_isa} = %{version}-%{release} +Requires: glib2-devel + +%description lvm-dbus-devel +This package contains header files and pkg-config files needed for development +with the libblockdev-lvm-dbus plugin/library. +%endif + + +%if %{with_mdraid} +%package mdraid +BuildRequires: libbytesize-devel +Summary: The MD RAID plugin for the libblockdev library +Requires: %{name}-utils%{?_isa} = %{version}-%{release} +Requires: mdadm + +%description mdraid +The libblockdev library plugin (and in the same time a standalone library) +providing the functionality related to MD RAID. + +%package mdraid-devel +Summary: Development files for the libblockdev-mdraid plugin/library +Requires: %{name}-mdraid%{?_isa} = %{version}-%{release} +Requires: %{name}-utils-devel%{?_isa} = %{version}-%{release} +Requires: glib2-devel + +%description mdraid-devel +This package contains header files and pkg-config files needed for development +with the libblockdev-mdraid plugin/library. +%endif + + +%if %{with_mpath} +%package mpath +BuildRequires: device-mapper-devel +Summary: The multipath plugin for the libblockdev library +Requires: %{name}-utils%{?_isa} = %{version}-%{release} +Requires: device-mapper-multipath + +%description mpath +The libblockdev library plugin (and in the same time a standalone library) +providing the functionality related to multipath devices. + +%package mpath-devel +Summary: Development files for the libblockdev-mpath plugin/library +Requires: %{name}-mpath%{?_isa} = %{version}-%{release} +Requires: %{name}-utils-devel%{?_isa} = %{version}-%{release} +Requires: glib2-devel + +%description mpath-devel +This package contains header files and pkg-config files needed for development +with the libblockdev-mpath plugin/library. +%endif + +%if %{with_nvdimm} +%package nvdimm +BuildRequires: ndctl-devel +BuildRequires: libuuid-devel +Summary: The NVDIMM plugin for the libblockdev library +Requires: %{name}-utils%{?_isa} = %{version}-%{release} +Requires: ndctl + +%description nvdimm +The libblockdev library plugin (and in the same time a standalone library) +providing the functionality related to operations with NVDIMM devices. + +%package nvdimm-devel +Summary: Development files for the libblockdev-nvdimm plugin/library +Requires: %{name}-nvdimm%{?_isa} = %{version}-%{release} +Requires: %{name}-utils-devel%{?_isa} = %{version}-%{release} +Requires: glib2-devel + +%description nvdimm-devel +This package contains header files and pkg-config files needed for development +with the libblockdev-nvdimm plugin/library. +%endif + + +%if %{with_part} +%package part +BuildRequires: parted-devel +Summary: The partitioning plugin for the libblockdev library +Requires: %{name}-utils%{?_isa} = %{version}-%{release} +Requires: gdisk +Requires: util-linux + +%description part +The libblockdev library plugin (and in the same time a standalone library) +providing the functionality related to partitioning. + +%package part-devel +Summary: Development files for the libblockdev-part plugin/library +Requires: %{name}-part%{?_isa} = %{version}-%{release} +Requires: %{name}-utils-devel%{?_isa} = %{version}-%{release} +Requires: glib2-devel + +%description part-devel +This package contains header files and pkg-config files needed for development +with the libblockdev-part plugin/library. +%endif + + +%if %{with_swap} +%package swap +BuildRequires: libblkid-devel +Summary: The swap plugin for the libblockdev library +Requires: %{name}-utils%{?_isa} = %{version}-%{release} +Requires: util-linux + +%description swap +The libblockdev library plugin (and in the same time a standalone library) +providing the functionality related to swap devices. + +%package swap-devel +Summary: Development files for the libblockdev-swap plugin/library +Requires: %{name}-swap%{?_isa} = %{version}-%{release} +Requires: %{name}-utils-devel%{?_isa} = %{version}-%{release} +Requires: glib2-devel + +%description swap-devel +This package contains header files and pkg-config files needed for development +with the libblockdev-swap plugin/library. +%endif + + +%if %{with_vdo} +%package vdo +BuildRequires: libbytesize-devel +BuildRequires: libyaml-devel +Summary: The vdo plugin for the libblockdev library +Requires: %{name}-utils%{?_isa} = %{version}-%{release} + +# weak dependencies doesn't work on older RHEL +%if (0%{?rhel} && 0%{?rhel} <= 7) +Requires: vdo +Requires: kmod-kvdo +%else +# we want to build the plugin everywhere but the dependencies might not be +# available so just use weak dependency +Recommends: vdo +Recommends: kmod-kvdo +%endif + +%description vdo +The libblockdev library plugin (and in the same time a standalone library) +providing the functionality related to VDO devices. + +%package vdo-devel +Summary: Development files for the libblockdev-vdo plugin/library +Requires: %{name}-vdo%{?_isa} = %{version}-%{release} +Requires: %{name}-utils-devel%{?_isa} = %{version}-%{release} +Requires: glib2-devel + +%description vdo-devel +This package contains header files and pkg-config files needed for development +with the libblockdev-vdo plugin/library. +%endif + +%if %{with_tools} +%package tools +Summary: Various nice tools based on libblockdev +Requires: %{name} +Requires: %{name}-lvm +BuildRequires: libbytesize-devel +%if %{with_lvm_dbus} == 1 +Recommends: %{name}-lvm-dbus +%endif + +%description tools +Various nice storage-related tools based on libblockdev. + +%endif + +%ifarch s390 s390x +%package s390 +Summary: The s390 plugin for the libblockdev library +Requires: s390utils +Requires: %{name}-utils%{?_isa} = %{version}-%{release} + +%description s390 +The libblockdev library plugin (and in the same time a standalone library) +providing the functionality related to s390 devices. + +%package s390-devel +Summary: Development files for the libblockdev-s390 plugin/library +Requires: %{name}-s390%{?_isa} = %{version}-%{release} +Requires: %{name}-utils-devel%{?_isa} = %{version}-%{release} +Requires: glib2-devel + +%description s390-devel +This package contains header files and pkg-config files needed for development +with the libblockdev-s390 plugin/library. +%endif + +%package plugins-all +Summary: Meta-package that pulls all the libblockdev plugins as dependencies +Requires: %{name}%{?_isa} = %{version}-%{release} + +%if %{with_btrfs} +Requires: %{name}-btrfs%{?_isa} = %{version}-%{release} +%endif + +%if %{with_crypto} +Requires: %{name}-crypto%{?_isa} = %{version}-%{release} +%endif + +%if %{with_dm} +Requires: %{name}-dm%{?_isa} = %{version}-%{release} +%endif + +%if %{with_fs} +Requires: %{name}-fs%{?_isa} = %{version}-%{release} +%endif + +%if %{with_kbd} +Requires: %{name}-kbd%{?_isa} = %{version}-%{release} +%endif + +%if %{with_loop} +Requires: %{name}-loop%{?_isa} = %{version}-%{release} +%endif + +%if %{with_lvm} +Requires: %{name}-lvm%{?_isa} = %{version}-%{release} +%endif + +%if %{with_mdraid} +Requires: %{name}-mdraid%{?_isa} = %{version}-%{release} +%endif + +%if %{with_mpath} +Requires: %{name}-mpath%{?_isa} = %{version}-%{release} +%endif + +%if %{with_nvdimm} +Requires: %{name}-nvdimm%{?_isa} = %{version}-%{release} +%endif + +%if %{with_part} +Requires: %{name}-part%{?_isa} = %{version}-%{release} +%endif + +%if %{with_swap} +Requires: %{name}-swap%{?_isa} = %{version}-%{release} +%endif + +%if %{with_vdo} +Requires: %{name}-vdo%{?_isa} = %{version}-%{release} +%endif + +%ifarch s390 s390x +Requires: %{name}-s390%{?_isa} = %{version}-%{release} +%endif + +%description plugins-all +A meta-package that pulls all the libblockdev plugins as dependencies. + + +%prep +%setup -q -n %{name}-%{version} +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 + +%build +autoreconf -ivf +%configure %{?configure_opts} +%{__make} %{?_smp_mflags} + +%install +%{make_install} +find %{buildroot} -type f -name "*.la" | xargs %{__rm} + + +%ldconfig_scriptlets +%ldconfig_scriptlets utils + +%if %{with_btrfs} +%ldconfig_scriptlets btrfs +%endif + +%if %{with_crypto} +%ldconfig_scriptlets crypto +%endif + +%if %{with_dm} +%ldconfig_scriptlets dm +%endif + +%if %{with_fs} +%ldconfig_scriptlets fs +%endif + +%if %{with_loop} +%ldconfig_scriptlets loop +%endif + +%if %{with_lvm} +%ldconfig_scriptlets lvm +%endif + +%if %{with_lvm_dbus} +%ldconfig_scriptlets lvm-dbus +%endif + +%if %{with_mdraid} +%ldconfig_scriptlets mdraid +%endif + +%if %{with_mpath} +%ldconfig_scriptlets mpath +%endif + +%if %{with_nvdimm} +%ldconfig_scriptlets nvdimm +%endif + +%if %{with_part} +%ldconfig_scriptlets part +%endif + +%if %{with_swap} +%ldconfig_scriptlets swap +%endif + +%if %{with_vdo} +%ldconfig_scriptlets vdo +%endif + +%ifarch s390 s390x +%ldconfig_scriptlets s390 +%endif + +%if %{with_kbd} +%ldconfig_scriptlets kbd +%endif + + +%files +%{!?_licensedir:%global license %%doc} +%license LICENSE +%{_libdir}/libblockdev.so.* +%if %{with_gi} +%{_libdir}/girepository*/BlockDev*.typelib +%endif +%dir %{_sysconfdir}/libblockdev +%dir %{_sysconfdir}/libblockdev/conf.d +%config %{_sysconfdir}/libblockdev/conf.d/00-default.cfg + +%files devel +%doc features.rst specs.rst +%{_libdir}/libblockdev.so +%dir %{_includedir}/blockdev +%{_includedir}/blockdev/blockdev.h +%{_includedir}/blockdev/plugins.h +%{_libdir}/pkgconfig/blockdev.pc +%if %{with_gtk_doc} +%{_datadir}/gtk-doc/html/libblockdev +%endif +%if %{with_gi} +%{_datadir}/gir*/BlockDev*.gir +%endif + +%if %{with_python2} +%files -n python2-blockdev +%{python2_sitearch}/gi/overrides/* +%endif + +%if %{with_python3} +%files -n python3-blockdev +%{python3_sitearch}/gi/overrides/BlockDev* +%{python3_sitearch}/gi/overrides/__pycache__/BlockDev* +%endif + +%files utils +%{_libdir}/libbd_utils.so.* +%{_libdir}/libbd_part_err.so.* + +%files utils-devel +%{_libdir}/libbd_utils.so +%{_libdir}/libbd_part_err.so +%{_libdir}/pkgconfig/blockdev-utils.pc +%dir %{_includedir}/blockdev +%{_includedir}/blockdev/utils.h +%{_includedir}/blockdev/sizes.h +%{_includedir}/blockdev/exec.h +%{_includedir}/blockdev/extra_arg.h +%{_includedir}/blockdev/dev_utils.h +%{_includedir}/blockdev/module.h +%{_includedir}/blockdev/dbus.h + + +%if %{with_btrfs} +%files btrfs +%{_libdir}/libbd_btrfs.so.* + +%files btrfs-devel +%{_libdir}/libbd_btrfs.so +%dir %{_includedir}/blockdev +%{_includedir}/blockdev/btrfs.h +%endif + + +%if %{with_crypto} +%files crypto +%{_libdir}/libbd_crypto.so.* + +%files crypto-devel +%{_libdir}/libbd_crypto.so +%dir %{_includedir}/blockdev +%{_includedir}/blockdev/crypto.h +%endif + + +%if %{with_dm} +%files dm +%{_libdir}/libbd_dm.so.* + +%files dm-devel +%{_libdir}/libbd_dm.so +%dir %{_includedir}/blockdev +%{_includedir}/blockdev/dm.h +%endif + + +%if %{with_fs} +%files fs +%{_libdir}/libbd_fs.so.* + +%files fs-devel +%{_libdir}/libbd_fs.so +%dir %{_includedir}/blockdev +%dir %{_includedir}/blockdev/fs +%{_includedir}/blockdev/fs.h +%{_includedir}/blockdev/fs/*.h +%endif + + +%if %{with_kbd} +%files kbd +%{_libdir}/libbd_kbd.so.* + +%files kbd-devel +%{_libdir}/libbd_kbd.so +%dir %{_includedir}/blockdev +%{_includedir}/blockdev/kbd.h +%endif + + +%if %{with_loop} +%files loop +%{_libdir}/libbd_loop.so.* + +%files loop-devel +%{_libdir}/libbd_loop.so +%dir %{_includedir}/blockdev +%{_includedir}/blockdev/loop.h +%endif + + +%if %{with_lvm} +%files lvm +%{_libdir}/libbd_lvm.so.* + +%files lvm-devel +%{_libdir}/libbd_lvm.so +%dir %{_includedir}/blockdev +%{_includedir}/blockdev/lvm.h +%endif + + +%if %{with_lvm_dbus} +%files lvm-dbus +%{_libdir}/libbd_lvm-dbus.so.* +%config %{_sysconfdir}/libblockdev/conf.d/10-lvm-dbus.cfg + +%files lvm-dbus-devel +%{_libdir}/libbd_lvm-dbus.so +%dir %{_includedir}/blockdev +%{_includedir}/blockdev/lvm.h +%endif + + +%if %{with_mdraid} +%files mdraid +%{_libdir}/libbd_mdraid.so.* + +%files mdraid-devel +%{_libdir}/libbd_mdraid.so +%dir %{_includedir}/blockdev +%{_includedir}/blockdev/mdraid.h +%endif + + +%if %{with_mpath} +%files mpath +%{_libdir}/libbd_mpath.so.* + +%files mpath-devel +%{_libdir}/libbd_mpath.so +%dir %{_includedir}/blockdev +%{_includedir}/blockdev/mpath.h +%endif + + +%if %{with_nvdimm} +%files nvdimm +%{_libdir}/libbd_nvdimm.so.* + +%files nvdimm-devel +%{_libdir}/libbd_nvdimm.so +%dir %{_includedir}/blockdev +%{_includedir}/blockdev/nvdimm.h +%endif + + +%if %{with_part} +%files part +%{_libdir}/libbd_part.so.* + +%files part-devel +%{_libdir}/libbd_part.so +%dir %{_includedir}/blockdev +%{_includedir}/blockdev/part.h +%endif + + +%if %{with_swap} +%files swap +%{_libdir}/libbd_swap.so.* + +%files swap-devel +%{_libdir}/libbd_swap.so +%dir %{_includedir}/blockdev +%{_includedir}/blockdev/swap.h +%endif + + +%if %{with_vdo} +%files vdo +%{_libdir}/libbd_vdo.so.* + +%files vdo-devel +%{_libdir}/libbd_vdo.so +%dir %{_includedir}/blockdev +%{_includedir}/blockdev/vdo.h +%endif + +%if %{with_tools} +%files tools +%{_bindir}/lvm-cache-stats +%endif + +%ifarch s390 s390x +%files s390 +%{_libdir}/libbd_s390.so.* + +%files s390-devel +%{_libdir}/libbd_s390.so +%dir %{_includedir}/blockdev +%{_includedir}/blockdev/s390.h +%endif + +%files plugins-all + +%changelog +* Tue Dec 07 2021 Vojtech Trefny - 2.24-8 +- Fix vdo stats calculation + Resolves: rhbz#2023883 + +* Wed Jun 30 2021 Vojtech Trefny - 2.24-7 +- Add workarounds for some LVM test issues + Resolves: rhbz#1974352 + +* Fri May 14 2021 Vojtech Trefny - 2.24-6 +- Fix default key size for non XTS ciphers + Resolves: rhbz#1931847 + +* Mon Jan 11 2021 Vojtech Trefny - 2.24-5 +- Fix LVM thin metadata calculation fix + Resolves: rhbz#1901714 + +* Mon Dec 14 2020 Vojtech Trefny - 2.24-4 +- LVM thin metadata calculation fix + Resolves: rhbz#1901714 + +* Wed Nov 18 2020 Vojtech Trefny - 2.24-3 +- exec: Polling fixes + Resolves: rhbz#1884689 + +* Mon Nov 09 2020 Vojtech Trefny - 2.24-2 +- exec: Fix setting locale for util calls + Resolves: rhbz#1880031 + +* Fri May 22 2020 Vojtech Trefny - 2.24-1 +- Rebased to the latest upstream release 2.24 + Resolves: rhbz#1824153 + +* Mon Dec 02 2019 Vojtech Trefny - 2.19-12 +- Use cryptsetup to check LUKS2 label + Resolves: rhbz#1778689 +- Fix expected cache pool name with newest LVM + Related: rhbz#1778689 + +* Thu Jun 06 2019 Vojtech Trefny - 2.19-11 +- Fix checking swap status on lvm/md (vtrefny) + Resolves: rhbz#1649815 + +* Thu May 30 2019 Tomas Bzatek - 2.19-10 +- Memory leak fixes (tbzatek) + Resolves: rhbz#1714276 + +* Mon May 06 2019 Vojtech Trefny - 2.19-9 +- Remove device-mapper-multipath dependency from fs and part plugins (vtrefny) + Resolves: rhbz#1700297 + +* Mon Apr 08 2019 Vojtech Trefny - 2.19-8 +- Allow running tests against installed version of libblockdev (vtrefny) + Related: rhbz#1679668 + +* Mon Jan 07 2019 Vojtech Trefny - 2.19-7 +- Use major/minor macros from sys/sysmacros.h instead of linux/kdev_t.h (vtrefny) + Resolves: rhbz#1644825 + +* Tue Oct 16 2018 Vojtech Trefny - 2.19-6 +- Fix 'Require exact version of the utils subpackage' (vtrefny) + Related: rhbz#1614328 + +* Tue Oct 16 2018 Vojtech Trefny - 2.19-5 +- Require exact version of the utils subpackage (vtrefny) + Related: rhbz#1614328 + +* Mon Oct 08 2018 Vojtech Trefny - 2.19-4 +- Use libblkid to check swap status before swapon (vtrefny) + Related: rhbz#1634016 +- Add error codes and Python exceptions for swapon fails (vtrefny) + Resolves: rhbz#1634016 + +* Mon Aug 13 2018 Vojtech Trefny - 2.19-3 +- Build VDO plugin on all architectures with VDO support (vtrefny) + Related: rhbz#1614328 + +* Mon Aug 13 2018 Vojtech Trefny - 2.19-2 +- Do not require 'dmraid' package (vtrefny) + Related: rhbz#1589861 + +* Fri Aug 10 2018 Vojtech Trefny - 2.19-1 +- Use python interpreter explicitly when running boilerplate_generator.py (vtrefny) +- vdo: Implement bd_vdo_get_stats() (tbzatek) +- Add test for is_tech_available with multiple dependencies (vtrefny) +- lvm-dbus.c: Check for 'lvmdbus' dependency in 'bd_lvm_is_tech_avail' (vtrefny) +- lvm.c: Check for 'lvm' dependency in 'bd_lvm_is_tech_avail' (vtrefny) +- Fix licence headers in sources (vtrefny) +- Fix three memory leaks in lvm-dbus.c (vtrefny) +- Ignore "bad-super-call" pylint warning in BlockDev.py (vtrefny) +- Fix running pylint in tests (vtrefny) +- Fix vdo configuration options definition in spec file (vtrefny) +- Fix calling BlockDev.reinit in swap tests (vtrefny) +- Fix how we check zram stats from /sys/block/zram0/mm_stat (vtrefny) +- Skip VDO tests also when the 'kvdo' module is not available (vtrefny) +- Add version to tests that should be skipped on CentOS/RHEL 7 (vtrefny) +- Skip btrfs tests if btrfs module is not available (vtrefny) +- Do not build KBD plugin with bcache support on RHEL (vtrefny) +- Do not build btrfs plugin on newer RHEL (vtrefny) +- fs: Properly close both ends of the pipe (tbzatek) +- Make sure library_test works after fixing -Wstrict-prototypes (vtrefny) +- Make sure library tests properly clean after themselves (vtrefny) +- pkg-config: add -L${libdir} and -I${includedir} (max.kellermann) +- plugins/kbd: make wait_for_file() static (max.kellermann) +- plugins/lvm{,-dbus}: get_lv_type_from_flags() returns const string (max.kellermann) +- plugins/dm: add explicit cast to work around -Wdiscarded-qualifiers (max.kellermann) +- plugins/crypto: work around -Wdiscarded-qualifiers (max.kellermann) +- plugins/check_deps: make all strings and `UtilDep` instances `const` (max.kellermann) +- exec: make `msg` parameters const (max.kellermann) +- fix -Wstrict-prototypes (max.kellermann) +- module.c: Accept kernel modules if they are built-in (marco.guerri.dev) +- BlockDev.py Convert dictionary keys to set before using them (vtrefny) +- Skip 'test_cache_pool_create_remove' on CentOS 7 (vtrefny) +- Re-order libbd_crypto_la_LIBADD to fix libtool issue (tom) +- acinclude.m4: Use AS_EXIT to fail in LIBBLOCKDEV_FAILURES (vtrefny) +- configure.ac: Fix missing parenthesis in blkid version check (vtrefny) +- Allow specifying extra options for PBKDF when creating LUKS2 (vtrefny) +- Reintroduce python2 support for Fedora 29 (vtrefny) +- Use versioned command for Python 2 (vtrefny) +- Fix few wrong names in doc strings (vtrefny) +- Make sure all our free and copy functions work with NULL (vtrefny) +- Use libblkid in bd_crypto_is_luks (vtrefny) +- vdo: Properly destroy the yaml parser (tbzatek) +- Add a simple test case for bd_crypto_tc_open (vtrefny) +- Add Python override for bd_crypto_tc_open_full (vtrefny) +- Show simple summary after configure (vtrefny) +- Do not build VDO plugin on non-x86_64 architectures (vtrefny) +- Sync spec with downstream (vtrefny) + +* Thu Jun 28 2018 Vojtech Trefny - 2.17-3 +- Build kbd plugin withou bcache support + +* Fri Jun 22 2018 Vojtech Trefny - 2.17-2 +- Do not build btrs plugin on RHEL 8 + +* Tue Apr 24 2018 Vojtech Trefny - 2.17-1 +- Redirect cryptsetup log to libblockdev log (vtrefny) +- Add a generic logging function for libblockdev (vtrefny) +- Add functions to resize LUKS 2 (vtrefny) +- Add function to get information about LUKS 2 integrity devices (vtrefny) +- Add function to get information about a LUKS device (vtrefny) +- Add a basic test for creating LUKS 2 format (vtrefny) +- Use libblockdev function to create LUKS 2 in tests (vtrefny) +- Add support for creating LUKS 2 format (vtrefny) +- Skip bcache tests on Rawhide (vtrefny) +- Allow building libblockdev without Python 2 support (vtrefny) +- Allow compiling libblockdev crypto plugin without escrow support (vtrefny) +- Require at least libndctl 58.4 (vtrefny) +- New function for luks metadata size (japokorn) +- Add functions to backup and restore LUKS header (vtrefny) +- Add function for killing keyslot on a LUKS device (vtrefny) +- Add functions to suspend and resume a LUKS device (vtrefny) +- Use '=' instead of '==' to compare using 'test' (v.podzimek) +- lvm-dbus: Check returned job object for error (vtrefny) +- Get sector size for non-block NVDIMM namespaces too (vtrefny) +- Fix memory leaks discovered by clang (vtrefny) +- Add new functions to docs/libblockdev-sections.txt (segfault) +- Make a link point to the relevant section (segfault) +- Don't use VeraCrypt PIM if compiled against libcryptsetup < 2.0 (segfault) +- Make keyfiles parameter to bd_crypto_tc_open_full zero terminated (segfault) +- Add function bd_crypto_device_seems_encrypted (segfault) +- Support VeraCrypt PIM (segfault) +- Support TCRYPT system volumes (segfault) +- Support TCRYPT hidden containers (segfault) +- Support TCRYPT keyfiles (segfault) +- Support unlocking VeraCrypt volumes (segfault) +- Enforce ZERO_INIT gcc backwards compatibility (bjornpagen) +- Add function for getting NVDIMM namespace name from devname or path (vtrefny) +- Add --without-xyz to DISTCHECK_CONFIGURE_FLAGS for disabled plugins (vtrefny) +- Add tests for the NVDIMM plugin (vtrefny) +- Add the NVDIMM plugin (vtrefny) +- Fix build with clang (bjornpagen) +- s390: don't hardcode paths, search PATH (flokli) +- Fix build against musl libc (bjornpagen) +- Fix python2-gobject-base dependency on Fedora 26 and older (vtrefny) +- Sync the spec file with downstream (vtrefny) + +* Wed Apr 11 2018 Vojtech Trefny - 2.16-3 +- Add the NVDIMM plugin (vtrefny) +- Add tests for the NVDIMM plugin (vtrefny) +- Add --without-xyz to DISTCHECK_CONFIGURE_FLAGS for disabled plugins (vtrefny) +- Add function for getting NVDIMM namespace name from devname or path (vtrefny) + +* Fri Feb 09 2018 Igor Gnatenko - 2.16-2 +- Escape macros in %%changelog + +* Thu Feb 08 2018 Vojtech Trefny - 2.16-1 +- Add tests for progress report (jtulak) +- Add e2fsck progress (jtulak) +- Add progress reporting infrastructure for Ext fsck (jtulak) +- Add a function to test if prog. reporting was initialized (jtulak) +- Add support for LUKS 2 opening and key management (vtrefny) +- Fix few more links for project and documentation website (vtrefny) +- Sync the spec file with downstream (vpodzime) +- Check if 'journalctl' is available before trying to use it in tests (vtrefny) +- Update 'Testing libblockdev' section in documentation (vtrefny) +- Fix link to online documentation (vtrefny) +- Fix how the new kernel module functions are added to docs (vpodzime) + +* Wed Feb 07 2018 Fedora Release Engineering - 2.15-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Wed Feb 07 2018 Iryna Shcherbina - 2.15-3 +- Update Python 2 dependency declarations to new packaging standards + (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) + +* Sat Feb 03 2018 Igor Gnatenko - 2.15-2 +- Switch to %%ldconfig_scriptlets + +* Fri Dec 01 2017 Vratislav Podzimek - 2.15-1 +- Do not use the 'btrfs' plugin in overrides tests (vpodzime) +- Do not use the btrfs plugin in library tests (vpodzime) +- Check for btrfs module availability in btrfs module (vtrefny) +- Move kernel modules (un)loading and checking into utils (vtrefny) +- Free locale struct in kbd plugin (vtrefny) +- Add test for setting partition flags on GPT (vtrefny) +- Use only sgdisk to set flags on GPT (vtrefny) +- Move the fs.h file to its original place (vpodzime) +- Add a HACKING.rst file (vpodzime) +- Mark bcache tests as unstable (vpodzime) +- Fix memory leaks in bd_fs_vfat_get_info() (vpodzime) +- Revert the behaviour of bd_fs_check_deps() (vpodzime) +- Split the bd_fs_is_tech_avail() implementation (vpodzime) +- Split the FS plugin source into multiple files (vpodzime) +- Fix bd_s390_dasd_format (vponcova) +- Mark unstable tests as such (vpodzime) +- bd_s390_dasd_is_ldl should be true only for LDL DADSs (vponcova) +- Do not lie about tag creation (vpodzime) + +* Wed Nov 08 2017 Zbigniew Jędrzejewski-Szmek - 2.14-2 +- Rebuild for cryptsetup-2.0.0 + +* Tue Oct 31 2017 Vratislav Podzimek - 2.14-1 +- Support the legacy boot GPT flag (intrigeri) +- Respect the version in the blockdev.pc file (vpodzime) +- Add pkgconfig definitions for the utils library (vpodzime) +- fs.c: Fix potential NULL pointer dereference (vtrefny) +- dm.c: Fix uninitialized values in various dm plugin functions (vtrefny) +- dm.c: Check return values of dm_task_set_name/run/get_info functions (vtrefny) +- fs.c: Fix multiple "forward NULL" warnings in 'bd_fs_ntfs_get_info' (vtrefny) +- lvm-dbus.c: Fix multiple "use after free" coverity warnings (vtrefny) +- Fix duplicate 'const' in generated functions (vtrefny) +- Add some test cases for NTFS (kailueke) +- Add function wrappers for NTFS tools (kailueke) +- exec.c: Fix error message in 'bd_utils_exec_and_report_progress' (vtrefny) +- crypto.c: Fix waiting for enough entropy (vtrefny) +- Ignore some coverity false positive errors (vtrefny) +- exec.c: Ignore errors from 'g_io_channel_shutdown' (vtrefny) +- part.c: Check if we've found a place to put new logical partitions (vtrefny) +- kbd.c: Fix potential string overflow in 'bd_kbd_bcache_create' (vtrefny) +- exec.c: Fix resource leaks in 'bd_utils_exec_and_report_progress' (vtrefny) +- fs.c: Fix "forward null" in 'do_mount' and 'bd_fs_xfs_get_info' (vtrefny) +- part.c: Fix possible NULL pointer dereference (vtrefny) +- crypto.c: Use right key buffer in 'bd_crypto_luks_add_key' (vtrefny) +- exec.c: Fix "use after free" in 'bd_utils_check_util_version' (vtrefny) +- kbd.c: Fix double free in 'bd_kbd_zram_get_stats' (vtrefny) +- part.c: Check if file discriptor is >= 0 before closing it (vtrefny) +- mdraid.c: Fix resource leaks (vtrefny) +- lvm.c: Fix "use after free" in 'bd_lvm_get_thpool_meta_size' (vtrefny) +- fs.c: Fix for loop condition in 'bd_fs_get_fstype' (vtrefny) +- fs.c: Check sscanf return value in 'bd_fs_vfat_get_info' (vtrefny) +- fs.c: Fix resource leaks in 'bd_fs_get_fstype' (vtrefny) +- blockdev.c.in: Fix unused variables (vtrefny) +- Use libbytesize to parse bcache block size (vtrefny) +- Use system values in KbdTestBcacheStatusTest (vtrefny) +- Fix BSSize memory leaks in btrfs and mdraid plugins (vtrefny) +- Skip btrfs subvolume tests with btrfs-progs 4.13.2 (vtrefny) +- Added function to get DM device subsystem (japokorn) +- Sync spec with downstream (vpodzime) + +* Fri Sep 29 2017 Vratislav Podzimek - 2.13-1 +- Fix the rpmlog and shortlog targets (vpodzime) +- Add a function for enabling/disabling plugins' init checks (vpodzime) +- Assign functions to tech-mode categories (vpodzime) +- Add missing items to particular sections in the documentation (vpodzime) +- Add a basic test for the runtime dependency checking (vpodzime) +- Simplify what WITH_BD_BCACHE changes in the KBD plugin (vpodzime) +- Add functions for querying available technologies (vpodzime) +- Dynamically check for the required utilities (vpodzime) +- Use shorter prefix for tempfiles (vtrefny) +- Try harder when waiting for lio device to show up (vtrefny) +- Better handle old and new zram sysfs api in tests (vtrefny) +- Skip btrfs tests on CentOS 7 aarch64 (vtrefny) +- Add new function for setting swap label (vtrefny) +- Use only one git tag for new releases (vtrefny) +- Fix source URL in spec file (vtrefny) +- Add NEWS.rst file (vtrefny) +- Do not include s390utils/vtoc.h in s390 plugin (vtrefny) +- Use "AC_CANONICAL_BUILD" to check architecture instead of "uname" (vtrefny) +- Bypass error proxy in s390 test (vtrefny) +- Fix zFCP LUN max length (vtrefny) +- Do not run g_clear_error after setting it (vtrefny) +- Allow compiling libblockdev without s390 plugin (vtrefny) +- Add a function for getting plugin name (vpodzime) + +* Thu Sep 28 2017 Troy Dawson - 2.12-3 +- Cleanup spec file conditionals correctly + +* Wed Sep 27 2017 Troy Dawson - 2.12-2 +- Cleanup spec file conditionals + +* Wed Aug 30 2017 Vratislav Podzimek - 2.12-1 +- Own directories /etc/libblockdev and /etc/libblockdev/conf.d (vtrefny) +- Wait for resized partition (kailueke) +- Make sure the device is opened for libparted (vpodzime) +- Fix label check in swap_test (vtrefny) +- Use "run_tests" script for running tests from Makefile (vtrefny) +- Add a script for running tests (vtrefny) +- Tests: Move library initialization to setUpClass method (vtrefny) +- Stop skipping FAT resize tests on rawhide (vtrefny) +- Close filesystem before closing the partition during FAT resize (vtrefny) +- Use mountpoint for "xfs_info" calls (vtrefny) +- Use libmount cache when parsing /proc/mounts (vtrefny) +- Add some space for the CI status (vpodzime) +- Confirm the force when creating PVs in FS tests (vpodzime) +- Skip vgremove tests on 32bit Debian (vtrefny) +- Fix names of backing files in tests (vtrefny) +- Fix checking for available locales (vtrefny) +- Skip dependency checking in mpath tests on Debian (vtrefny) +- Skip zRAM tests on Debian (vtrefny) +- Skip the test for device escrow on Debian too (vtrefny) +- Skip free region tests on Debian too (vtrefny) +- Fix redirecting command output to /dev/null in tests (vtrefny) +- Try harder to unmount devices in test cleanup (vtrefny) +- Require only plugins that are needed for given test (vtrefny) +- Try to get distribution info from "PrettyName" if "CPEName" isn't available (vtrefny) +- Use -ff when creating PVs in FS tests (vpodzime) +- Sync spec with downstream (vpodzime) + +* Mon Jul 31 2017 Vratislav Podzimek - 2.11-1 +- Make the KbdZRAMDevicesTestCase inherit from KbdZRAMTestCase (vpodzime) +- Allow non-source directory builds (kailueke) +- Add a way to disable runtime dependency checks (vpodzime) +- Link to GObject even if no plugin is activated (kailueke) +- Skip zram tests on Rawhide (vpodzime) +- Keep most utilities available for tests (vpodzime) +- Use new libmount function to get (un)mount error message (vtrefny) +- Update the documentation URL (vpodzime) + +* Wed Jul 26 2017 Fedora Release Engineering - 2.10-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Wed Jul 05 2017 Vratislav Podzimek - 2.10-1 +- Only enable partition size tolerance with alignment (vpodzime) +- Limit the requested partition size to maximum possible (vpodzime) +- Do not verify vfat FS' size after generic resize (vpodzime) +- Specify tolerance for partition size (kailueke) +- Only use the exact constraint if not using any other (vpodzime) +- Check resulting FS size in tests for generic FS resize (vpodzime) +- Query setting FS label support and generic relabeling (kailueke) +- Do not strictly require all FS utilities (vpodzime) +- Compile everything with the C99 standard (vpodzime) +- Add partition resize function (kailueke) +- Generic Check and Repair Functions (kailueke) +- Query functions for FS resize and repair support (kailueke) +- Update the project/source URL in the spec file (vpodzime) +- Add functions for opening/closing TrueCrypt/VeraCrypt volumes (vpodzime) +- Adapt to a change in behaviour in new libmount (vpodzime) +- Try RO mount also if we get EACCES (vpodzime) +- Size in bytes for xfs_resize_device (kailueke) +- src/plugins/Makefile.am: Remove hard coded include path in /usr prefix (tristan.vanberkom) +- Fixed include for libvolume_key.h (tristan.vanberkom) +- Ignore parted warnings if possible (squimrel) +- bcache tests: Remove FEELINGLUCKY checks (tasleson) +- kbd.c: Code review corrections (tasleson) +- kbd.c: Make bd_kbd_bcache_create work without abort (tasleson) + +* Tue Jun 13 2017 Vratislav Podzimek - 2.9-1 +- Fix hardcoded reference to gcc (timo.gurr) +- Catch and ignore partial failures in LVM tests' cleanups (vpodzime) +- Fix hardcoded reference to pkg-config (timo.gurr) +- Make GObject introspection optional (vpodzime) +- Do not link libraries required by plugins to the GI files (vpodzime) +- Make sure the whole build status image is shown (vpodzime) +- Show CI status in README (at the GH repo's front page) (vpodzime) +- Always require the libudev pkg (tgurr) +- Make sure we give kernel time to fully setup zram device(s) (vpodzime) +- fs_test.py: Close FDs when calling utilities (tasleson) +- crypto.c: Correct segmentation fault (tasleson) + +* Tue Jun 06 2017 Vratislav Podzimek - 2.8-1 +- Temporarily skip vfat generic resize test on rawhide (vtrefny) +- Use "safeprobe" in "bd_fs_wipe" (vtrefny) +- Add a generic filesystem resize function (vtrefny) +- Add a function to get mountpoint for a device (vtrefny) +- Add a function to get filesystem type for a device (vtrefny) +- Only include the LVM DBus config when shipping LVM DBus (vpodzime) +- Skip the LVM DBus vgreduce tests on Rawhide (vpodzime) +- Do not build the lvm-dbus plugin on RHEL/CentOS (vpodzime) +- Give zRAM more time to settle before trying to remove a device (vpodzime) +- Put zram tests adding/removing devices into a separate class (vpodzime) +- Skip LVM cache and RAID tests on Rawhide (vpodzime) +- Fix the skip_on decorator factory for tests (vpodzime) +- Use 'blkid -p' instead of lsblk to get device's FS type (vpodzime) +- Improve the lvm_set_global_config test (vpodzime) +- Pass '-y' to pvresize (vpodzime) +- Create a copy of os.environ for a child process (vpodzime) +- Revert "Use the "C.UTF-8" locale instead of just "C"" (vpodzime) +- Fix how we create vfat FS in tests (vpodzime) +- Skip the test if requiring unavailable locales (vpodzime) +- Use the "C.UTF-8" locale instead of just "C" (vpodzime) +- Add functions for working with ext2 and ext3 filesystems (vtrefny) +- Link to gobject when lvm or btrfs is enabled (andreas) +- Link to libm where needed (andreas) +- Add a function for cleaning a device (vtrefny) +- Add few code exaples to documentation (vtrefny) +- Use a special exception for no fs signature when doing wipe (vpodzime) +- One more incompatible os.symlink() call (vpodzime) +- Do not use pass-by-name in the os.symlink() call (vpodzime) +- Ignore previous errors when falling back to using ioctl() (vpodzime) +- Use ioctl() call to teardown loop devices (vpodzime) +- Resolve the device to remove for mdadm (vpodzime) +- Add a function for getting device symlinks (vpodzime) +- Use the new resolve_device() function where appropriate (vpodzime) +- Add the resolve_device() function to the utils library (vpodzime) +- First try to read the 'autoclear' flag from /sys/ (vpodzime) + +* Wed Apr 26 2017 Vratislav Podzimek - 2.7-1 +- Skip btrfs min size tests on Fedora 25 (vtrefny) +- Make sure the loop device doesn't disappear during tests (vpodzime) +- Close the loop device when autoclear is (un)set (vpodzime) +- Do not enforce Python 3 for running tests in CI (vpodzime) +- Revert "Use different BTRFS_MIN_MEMBER_SIZE on aarch64" (vtrefny) +- Use both 'old' and 'new' sysfs files to read zRAM stats (vtrefny) +- Check if libparted-fs-resize pkgconfig is available (vpodzime) +- Do not try to get name for inactive partitions (vtrefny) +- Skip tests for getting free regions on CentOS/RHEL (vpodzime) +- Free the container holding the specs of free regions (vpodzime) +- Open loop devices as O_RDONLY when getting flags (vpodzime) +- Resolve maximum partition size when we know its start (vpodzime) +- Use --id instead of --part-type when setting partition id (vpodzime) +- Fix mdadm command for removing failed device from an array (vtrefny) +- Skip bcache tests on CentOS/RHEL 7 (vpodzime) +- Use six.assertRaisesRegex in the FS tests (vpodzime) +- Use mkdtemp() instead of TemporaryDirectory() (vpodzime) +- Fix installation without specifying --exec-prefix (vpodzime) +- Add options to force mkfs.ext4/vfat to create a FS on the whole device (vpodzime) +- Skip the test for device escrow on CentOS/RHEL (vpodzime) +- Define DEVNULL on our own if not in subprocess (vpodzime) +- Remove the patches from the spec file (vpodzime) +- Sync the spec file with downstream (vpodzime) +- Stop skipping zRAM stats tests (vtrefny) +- Add more tests for zRAM stats (vtrefny) +- Fix reading zRAM properties from sysfs (vtrefny) + +* Wed Apr 12 2017 Vratislav Podzimek - 2.6-3 +- Do not try to parse 'raid_spec' for 'bd_md_activate' (vtrefny) + Resolves: rhbz#1439111 + +* Tue Apr 11 2017 Vratislav Podzimek - 2.6-2 +- Make sure the returned thpool MD size is valid (vpodzime) + +* Wed Mar 15 2017 Vratislav Podzimek - 2.6-1 +- Move the part_err library before part and fs (vtrefny) +- Fix BuildRequires for crypto and dm packages (vtrefny) +- Fix mounting read-only devices (vtrefny) +- Fix the bd_s390_dasd_is_ldl function. (vponcova) +- Add the bd_s390_dasd_is_fba function to check if DASD is FBA (vponcova) +- Disable MD RAID tests on 32bit systems (vpodzime) +- Fix error message when mounting with a wrong fs type (vtrefny) +- Only create RPMs for requested/configured plugins (vpodzime) +- Only check dependencies of plugins to be built (vpodzime) +- Only build and distribute plugins if configured so (vpodzime) +- Fix format-security and unused-result compiler warnings (vtrefny) +- Add an AC macro for modular builds (vpodzime) +- Add functions for mounting and unmounting filesystems (vtrefny) + +* Mon Mar 06 2017 Vratislav Podzimek - 2.5-1 +- Do not try to get GVariant after not adding anything to its builder (vpodzime) +- Replace NULL with "" when building ExtraArg (vpodzime) +- Replace NULL with "" when adding it as a 's' GVariant (vpodzime) +- Make sure we don't try to add NULL as GVariant to DBus params (vpodzime) +- Add function for getting recommended thpool metadata size (vpodzime) +- Make udev settle after we create a LIO device (vpodzime) +- Always use '--yes' for lvremove (vpodzime) + +* Tue Feb 21 2017 Vratislav Podzimek - 2.4-1 +- Update specs.rst to use present-tense and current API (agrover) +- Add functions using BLOBs as LUKS passphrases (vpodzime) +- Make sure the _error_quark() functions are in the library (vtrefny) +- Return a special error when trying to wipe empty device (vtrefny) +- Adapt tests to use LIO devices instead of loop devices (vpodzime) +- Add functions for creating and deleting LIO devices (vpodzime) +- MDRAID: Allow path as input for functions that work with sysfs (vtrefny) + +* Wed Feb 15 2017 Vratislav Podzimek - 2.3-3 +- Rebuild with changelog fixed up + +* Tue Feb 14 2017 Vratislav Podzimek - 2.3-1 +- Allow specifying raid 'name' in multiple way when calling md functions (vtrefny) +- Allow using both path and raid name in bd_md_set_bitmap_location (vtrefny) +- Fix potential memory issues in s390 sanitizate functions (vpodzime) +- Try multiple times when probing device for wiping (vpodzime) +- Check for libvolume_key.h and dmraid.h in configure.ac (vpodzime) +- Define our own macro for testing required header files (vpodzime) +- Include blockdev/utils.h in mdraid.h (vtrefny) +- Fix misspelling (agrover) +- Skip the bcache tests even on x86_64 (vpodzime) +- Take a break between bcache creation tests (vpodzime) +- Make sure ./configure fails if there are some soft failures (vpodzime) +- Improve the error message on missing GI support (vpodzime) +- Only require bcache-tools if supporting bcache (vpodzime) +- Skip bcache tests on non-x86_64 architectures (vpodzime) +- Try harder to register a new bcache device (vpodzime) +- Reimplement swapon/swapoff functions by using syscalls (vpodzime) +- Make sure bcache functions are correctly provided or not (vpodzime) +- Changelog fixup (vpodzime) + +* Fri Feb 10 2017 Fedora Release Engineering - 2.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Wed Jan 11 2017 Vratislav Podzimek - 2.2-2 +- Rebuild with changelog fixed up + +* Wed Jan 11 2017 Vratislav Podzimek - 2.2-1 +- Use the .in file as source when bumping version (vpodzime) +- Run pylint based on the python version and make it optional (vpodzime) +- Disable python3 and bcache on RHEL (vpodzime) +- Make bcache support optional (vpodzime) +- Teach boileplate_generator.py to skip things based on patterns (vpodzime) +- Require lower versions of some utilities (vpodzime) +- Do not require python3 for the boilerplate generation script (vpodzime) +- Use a proper initialization value for 'GPollFD fds[2]' (vpodzime) +- Deal with older parted and libblkid (vpodzime) +- Make python3 and gtk-doc optional (vpodzime) +- Bump the version of the utils library (vpodzime) +- Fix docstring for 'bd_md_node_from_name' (vtrefny) +- Add tests for added mdraid methods (vtrefny) +- Skip 'MDTestNominateDenominateActive' unless feeling lucky (vtrefny) +- MDRaid tests: change 'wait_for_resync' to wait for given action (vtrefny) +- Add functionality need by storaged to mdraid plugin (vtrefny) +- Move 'echo_str_to_file' method to utils (vtrefny) +- Add a function to setup a loop device from a file descriptor (vpodzime) +- Add functions to get/set the autoclear flag on a loop device (vpodzime) +- Fix checking /proc/mdstat for resync action (vtrefny) +- Adapt the test config files to version 2.x (vpodzime) + +* Mon Dec 12 2016 Charalampos Stratakis - 2.1-3 +- Rebuild for Python 3.6 + +* Tue Nov 15 2016 Vratislav Podzimek - 2.1-2 +- Rebuild for a chain-build with storaged (vpodzime) + +* Thu Nov 10 2016 Vratislav Podzimek - 2.1-1 +- Do not require an exclusive lock on the device to commit part stuff (vpodzime) +- Prevent failure if there are no btrfs subvolumes (vpodzime) +- Fix the test for getting version of a failing utility (vpodzime) +- Also run the utils tests (vpodzime) +- Bump the version of the pkgconfig module (vpodzime) +- Include utils.h in plugins that need it (vpodzime) +- Fix dependency check in fs plugin (vtrefny) +- Add support for setting part id (part type) on msdos part tables (vtrefny) +- Trim the extra info for MD RAID's name (vpodzime) +- Add xfsprogs and dosfstools as dependencies of the fs plugin (vpodzime) +- Fix md_name_from_node to work with the "/dev/" prefix (vpodzime) +- New major upstream release + +* Wed Nov 9 2016 Vratislav Podzimek - 1.9-8 +- Revert "Prevent issues between libparted and udev" (vpodzime) +- Revert "Open the device file as RDWR when committing parts" (vpodzime) + +* Thu Oct 27 2016 Vratislav Podzimek - 1.9-7 +- Open the device file as RDWR when committing parts (vpodzime) +- Handle mdadm --examine output during migration (adamw) + Resolves: rhbz#1381996 + +* Mon Oct 24 2016 Vratislav Podzimek - 1.9-6 +- Prevent issues between libparted and udev (vpodzime) + +* Mon Oct 10 2016 Vratislav Podzimek - 1.9-5 +- Make sure all object paths are passed and extracted as such (vpodzime) + Resolves: rhbz#1374973 + +* Tue Oct 4 2016 Vratislav Podzimek - 1.9-4 +- Do not report volume name for FW RAID container device (vpodzime) + Related: rhbz#1379865 +- Search for just "UUID" in mdadm --examine output (vpodzime) + Related: rhbz#1379865 +- Use 'mdadm --examine --export' to get MD RAID level (vpodzime) + Related: rhbz#1379865 + +* Mon Oct 3 2016 Vratislav Podzimek - 1.9-3 +- Try to search for "RAID Level" in mdadm's output (vpodzime) + Resolves: rhbz#1379865 +- Fix the number passed to LVM DBus as a job-creation timeout (vpodzime) + Resolves: rhbz#1378970 + +* Mon Aug 29 2016 Vratislav Podzimek - 1.9-2 +- Explicitly cast number constants for GVariants (vpodzime) + +* Wed Jul 27 2016 Vratislav Podzimek - 1.9-1 +- Add functions for creating thin/cache pools from existing LVs (vpodzime) +- Add the new mpath_get_members() function to the docs (vpodzime) + +* Tue Jul 19 2016 Fedora Release Engineering - 1.8-2 +- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages + +* Wed Jun 29 2016 Vratislav Podzimek - 1.8-1 +- Add a function to get all mpath member devices (vpodzime) +- Fix backport issues in the zfcp-related functionality (#1348442) (vpodzime) +- Revert "Fix a few const params in the s390 plugin." (vpodzime) +- Fix creation of the version-only tags (vpodzime) + +* Wed Jun 15 2016 Vratislav Podzimek - 1.7-1 +- Include the LV roles in the LVdata (vpodzime) +- Add a few missing items to the documentation (vpodzime) +- Document fields of the structures (vpodzime) +- Report (meta)data LV name properly for cache pools in lvm-dbus (vpodzime) +- Add information about related LVs to LVMLVdata (vpodzime) +- Remove unused code for getting supported functions (vpodzime) +- Add zFCP functionality to s390 plugin (sbueno+anaconda) +- Fix a few const params in the s390 plugin. (sbueno+anaconda) + +* Wed Jun 01 2016 Vratislav Podzimek - 1.6-1 +- Ignore merge commits when creating changelog (vpodzime) +- Only take the number of the first %%changelog line found (vpodzime) +- Add some more detailed description to the part plugin (vpodzime) +- Fix a few extra issues with the const types (vpodzime) +- Add function for getting best free region (vpodzime) +- Add function for getting free regions (vpodzime) +- Fix the error message when setting part flag fails (vpodzime) +- Add function for setting disk flags (vpodzime) +- Add function for getting information about disk(s) (vpodzime) +- Do not set nonsense partition paths (vpodzime) +- Add function for getting partition by position (vpodzime) +- Indicate if there was error from parted or not in set_parted_error() (vpodzime) +- Minor fixes for the bd_part_get_part_spec() function (vpodzime) +- Add support for extra GPT flags (vpodzime) +- Add functionality for partition types (GUIDs) (vpodzime) +- Add functionality for partition names (vpodzime) +- Do not destroy disk objects we didn't get (vpodzime) +- Add a function for setting multiple partition flags at once (vpodzime) +- Remove the unused definition USE_PYTHON3 from configure.ac (vpodzime) +- Use different BTRFS_MIN_MEMBER_SIZE on aarch64 (vpodzime) +- Better release memory from parted objects on failures (vpodzime) +- Rework how we do optimal alignment (vpodzime) +- Do not try to destroy object we didn't get (vpodzime) +- Don't pass sizes in bytes to LVM (#1317373) (vpodzime) +- Add the libbytesize-devel build requires (vpodzime) +- Search for the LVM DBus service in both active and activatable names (vpodzime) +- Adapt to another stupid change in btrfs-progs (vpodzime) +- Add the XFS-related functions to the documentation (vpodzime) +- Add tests for the XFS-related functions (vpodzime) +- Add support for the XFS file system to the FS plugin (vpodzime) +- Add chunk_size to BDMDExamineData (vtrefny) +- Add the subpackage for the FS plugin (vpodzime) +- Add the FS plugin to the docs (vpodzime) +- Add tests for the ext4 functionality in the fs plugin (vpodzime) +- Add the FS plugin and the ext4 support (vpodzime) +- Add a function for running utility reporting error and exit code (vpodzime) +- Add the subpackage for the part plugin (vpodzime) +- Add a missing BuildRequires for parted-devel (vpodzime) +- Tag as both libblockdev-$version and just $version (vpodzime) +- Add the 'part' plugin to documentation (vpodzime) +- Add tests for the newly added part plugin (vpodzime) +- Add the part plugin with storaged-required functionality (vpodzime) + +* Mon Mar 21 2016 Vratislav Podzimek - 1.5-1 +- Merge pull request #72 from vpodzime/master-faster_tests (vpodzime) +- Ignore all .bak files (vpodzime) +- Use python3-pylint and skip Python 2 tests (vpodzime) +- Try a bit harder when deactivating MD arrays in tests (vpodzime) +- Recompile only the LVM plugin in tests (vpodzime) +- Merge pull request #65 from vpodzime/master-loc_indep_error (vpodzime) +- Merge pull request #70 from vojtechtrefny/master-chunk_size (vpodzime) +- Add bd_md_create_with_chunk_size() function (vtrefny) +- Merge pull request #68 from vpodzime/master-no_intro_data (vpodzime) +- Merge pull request #71 from vpodzime/master-ipython3 (vpodzime) +- Run coverage with the right config directories (vpodzime) +- Merge pull request #67 from phatina/master (vpodzime) +- Merge pull request #69 from vpodzime/master-lvm_dbus_autostart (vpodzime) +- Use ipython3 for debugging and testing sessions (vpodzime) +- Don't expect to always get introspection data from DBus (vpodzime) +- Make invocation of tests configurable (phatina) +- Make error messages locale agnostic (vpodzime) + +* Tue Mar 15 2016 Vratislav Podzimek - 1.4-5 +- Search for the LVM DBus service in activatable names (vpodzime) +- Better check for the LVM DBus API (vpodzime) + +* Wed Mar 9 2016 Vratislav Podzimek - 1.4-4 +- Do not try to get object path of NULL in vgreduce (vpodzime) + +* Tue Mar 1 2016 Peter Robinson 1.4-3 +- Depend on python3-gobject-base not python3-gobject so as to not pull in X components + +* Thu Feb 25 2016 Vratislav Podzimek - 1.4-2 +- Add/fix the requirement for the LVM DBus daemon + +* Thu Feb 25 2016 Vratislav Podzimek - 1.4-1 +- Merge pull request #62 from vpodzime/master-clean_up (vpodzime) +- Use addCleanup() instead of tearDown() in tests (vpodzime) +- Merge pull request #58 from vpodzime/master-lvm_dbus_pr (vpodzime) +- Add the VG renaming functionality (vpodzime) +- Packaging of the lvm-dbus plugin (vpodzime) +- The LVM DBus plugin (vpodzime) +- Add more generic functions for logging (vpodzime) +- Use MAX(a, b) instead of CLAMP(b, a, b) (vpodzime) +- Merge pull request #59 from vpodzime/master-vgrename (vpodzime) +- Add a function for renaming VGs (vpodzime) +- Merge pull request #57 from clumens/master (vpodzime) +- Fix error reporting when running "make test". (clumens) +- Merge pull request #54 from vojtechtrefny/master-pvsize (vpodzime) +- Do not try to create a PV with 4KiB metadata space (vpodzime) +- Add pv_info to BDLVMPVdata (vtrefny) +- btrfs now requires at least 128MiB device(s) (vpodzime) +- Merge pull request #52 from vpodzime/master (vpodzime) +- Round size in thpoolcreate() to KiB (vpodzime) +- Sync the %%changelog in spec with downstream (vpodzime) + +* Wed Nov 25 2015 Vratislav Podzimek - 1.3-4 +- Create the cache pool before the to-be-cached LV (vpodzime) + +* Thu Nov 05 2015 Robert Kuska - 1.3-3 +- Rebuilt for Python3.5 rebuild + +* Wed Nov 04 2015 Vratislav Podzimek - 1.3-2 +- Fix the annotation of bd_try_init in blockdev.c (vpodzime) + +* Mon Oct 26 2015 Vratislav Podzimek - 1.3-1 +- Add missing python GI requires (vpodzime) +- Merge pull request #49 from dashea/libblockdev-python (vpodzime) +- Merge pull request #50 from vpodzime/master-fix_striped_lv (vpodzime) +- Merge pull request #46 from vpodzime/master-bcache_destroy (vpodzime) +- Merge pull request #39 from vpodzime/master-lvm_physical_space (vpodzime) +- Add a missing ldconfig that rpmlint found. (dshea) +- Move python files to separate packages (#1256758) (dshea) +- Fix lvcreate calls for striped LVs (vpodzime) +- Merge pull request #48 from vojtechtrefny/master_pvfree (vpodzime) +- Add pv_free to BDLVMPVdata (vtrefny) +- Merge pull request #47 from atodorov/add_coverage_report (vpodzime) +- Produce coverage report in CI (atodorov) +- Check bcache device's state before trying to detach the cache in destroy() (vpodzime) +- Fix URLs in the spec (vpodzime) +- Fix the int-float less-than comparison (vpodzime) +- Fix the calculation of physical space taken by an LV (vpodzime) + +* Wed Sep 23 2015 Vratislav Podzimek - 1.2-1 +- Merge pull request #40 from vpodzime/master-config_support (vpodzime) +- Add tests for configuration support (vpodzime) +- Add a function for getting the loaded soname for a plugin (vpodzime) +- Add the default configuration (vpodzime) +- Load and respect configuration files when loading plugins (vpodzime) +- Add functions for finding and processing configuration files (vpodzime) +- Merge pull request #38 from vpodzime/master-md_superblock_size (vpodzime) +- Better document how MD RAID superblock size should be calculated (vpodzime) +- Merge pull request #36 from phatina/master (vpodzime) +- BTRFS: allow an arbitrary label to be set for a btrfs volume (phatina) +- Merge pull request #32 from phatina/master (vpodzime) +- BTRFS: fix parsing empty partition label (phatina) +- Merge pull request #35 from vpodzime/master (vpodzime) +- Define env variables for sudo via the env utility (vpodzime) +- Merge pull request #34 from dashea/python3-tests (vpodzime) +- Use unittest.addCleanup to simplify crypto_test. (dshea) +- Run tests with both python2 and python3 in the ci target. (dshea) +- Fix python3 issues in the unittests. (dshea) +- Do not run all tests in the 'ci' target (vpodzime) +- Merge pull request #33 from clumens/master (vpodzime) +- Add a new makefile target that does everything needed for jenkins. (clumens) +- Synchronize the .spec file with downstream (vpodzime) + +* Fri Jul 24 2015 Vratislav Podzimek - 1.1-2 +- Explicitly specify the type of the cert_data parameter (#1246096) (vpodzime) + +* Fri Jun 19 2015 Vratislav Podzimek - 1.1-1 +- Clean generated boilerplate code on 'make clean' (vpodzime) +- Merge pull request #31 from atodorov/use_lang_c (vpodzime) +- tests: use LANG=C in test_backup_passphrase() (atodorov) +- Merge pull request #30 from atodorov/makefile_updates (vpodzime) +- Makefile.am: - add separate check target - add coverage targets - make it possible to test with Python3 (atodorov) +- Merge pull request #29 from atodorov/fix_issue_28 (vpodzime) +- Merge pull request #27 from atodorov/fix_docs_url (vpodzime) +- Merge pull request #26 from atodorov/test_docs (vpodzime) +- Change the modified sources back in tearDown() method as well. Closes #28. (atodorov) +- update URL to on-line documentation (atodorov) +- add test documentation (atodorov) +- Merge pull request #22 from dashea/escrow-tests (vpodzime) +- Merge pull request #25 from dashea/python-dep (vpodzime) +- Filter the python files from automatic rpm requires (dshea) +- Added tests for escrow packets and backup passphrases (dshea) +- Free leaked contexts from crypto_init (dshea) +- Cooperate with volume_key's memory management (dshea) +- Fix inheritance in the LVM tests to prevent multiple runs of some tests (vpodzime) +- Make the regexp for testing crypto_generate_backup_passphrase() stricter (vpodzime) +- Leave room in the backup passphrase for a trailing 0 (dshea) +- Add functions to get names of data/metadata internal LVs (vpodzime) +- Allow getting info for an internal LV (vpodzime) +- Gather information about all LVs (vpodzime) +- Round requested size to KBs in lvresize() (#1221247) (vpodzime) +- Add overrides for the ensure_init() function (vpodzime) +- Change the default value of the 'reload' parameter of try_reinit() (vpodzime) +- Merge pull request #21 from vpodzime/master-thpool_size_discard (vpodzime) +- Add overrides for the lvm_is_valid_thpool_chunk_size() function (vpodzime) + +* Wed Jun 17 2015 Fedora Release Engineering - 1.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Thu May 21 2015 Vratislav Podzimek - 1.0-1 +- Adapt the release helper targets to autotools (vpodzime) +- Fixes of paths in Makefile.am's inspired by build failures on s390 (vpodzime) +- Add an s390-specific BuildRequires (vpodzime) +- Distribute also the boilerplate_generator.py script (vpodzime) +- Fix path to the generated blockdev.pc file (vpodzime) +- Adapt tests that compile stuff to autotools (vpodzime) +- Merge pull request #18 from vpodzime/master-autotools (vpodzime) +- Merge pull request #20 from dashea/gtkdoc-sections (vpodzime) +- Use the autotools building system instead of scons (vpodzime) +- Add the two new functions to the 'blockdev' docs section (vpodzime) +- Fix the line defining the docs file for the s390 section (vpodzime) +- Add a missing #include to the kbd.api file (vpodzime) +- Prevent s390-specific stuff from being used on other architectures (vpodzime) +- Update the documentation of the is_initialized() function (vpodzime) +- Merge pull request #19 from vpodzime/master-ensure_init (vpodzime) +- Remove private macros from the gtkdoc sections file. (dshea) +- Terminate ifdef statements for arch check. (sbueno+anaconda) +- Return early from the init functions if setting up logging fails (vpodzime) +- Add tests for the new and modified init functions (vpodzime) +- Add new try_init() and try_reinit() functions (vpodzime) +- Fix for adding number of loaded plugins (vpodzime) +- Fix for ensure_init() (vpodzime) +- Rename the try_init() function to ensure_init() and improve it (vpodzime) +- Check number of loaded plugins and library initialization state (vpodzime) +- Make 'reload' default to True instead of False in overrides (vpodzime) +- Add the s390 plugin test file. (sbueno+anaconda) +- Add the s390 plugin functions. (sbueno+anaconda) +- Add the s390 plugin. (sbueno+anaconda) +- Fix a typo in the spec file. (sbueno+anaconda) +- Require the kmod-devel package for the build process (vpodzime) +- Merge pull request #16 from dashea/escrow-encoding (vpodzime) +- Merge pull request #13 from vpodzime/master-lvm_cache (vpodzime) +- Merge pull request #12 from vpodzime/master-kbd_plugin (vpodzime) +- Merge pull request #14 from vpodzime/master-better_is_multipath (vpodzime) +- Use g_strdup() instead of g_strdup_printf() to just dup a string (vpodzime) +- Fix the spelling of "escrow" (dshea) +- Make the crypto plugin string parameters const (dshea) +- Set encoding to NULL before writing the escrow packet. (dshea) +- Get cache stats directly from the device mapper (vpodzime) +- Reimplement the is_mpath_member() function using device mapper (vpodzime) +- Add the LVM cache related symbols to the LVM section in the documentation (vpodzime) +- Update the list of LVM cache related functions in features.rst (vpodzime) +- Add tests for functions related to the LVM cache technology (vpodzime) +- Implement the lvm_cache_stats() function (vpodzime) +- Implement the lvm_cache_pool_name function (vpodzime) +- Implement the lvm_cache_create_cached_lv() function (vpodzime) +- Implement lvm_cache_attach/detach() functions (vpodzime) +- Implement the lvm_cache_create_pool() function plus two support functions (vpodzime) +- Implement the lvm_cache_get_default_md_size() function (vpodzime) +- Add the 'type' parameter to the lvm_lvcreate function (vpodzime) +- Teach boilerplate_generator to work with enum return types (vpodzime) +- Teach boilerplate_generator to work with 'const' return types (vpodzime) +- Add subpackages for the KBD plugin and its devel files (vpodzime) +- Add provided symbols to the documentation section of the KBD plugin (vpodzime) +- Implement the bcache_get_backing/cache_device functions (vpodzime) +- Exclude bcache tests from the normal 'test' target (vpodzime) +- Add some more and prolong some of the waits in KBD tests (vpodzime) +- Zero all newly allocated structures (vpodzime) +- Implement the bcache_status function and all it wants (vpodzime) +- Fix for the zram stats (vpodzime) +- Add bcache_get_mode and bcache_set_mode functions (vpodzime) +- Teach boilerplate_generator to work with enum return types (vpodzime) +- Teach boilerplate_generator to work with 'const' return types (vpodzime) +- Add the zram_get_stats function (vpodzime) +- Add the check() function for the KBD plugin (vpodzime) +- Add ErrorProxy instance for the KBD plugin (vpodzime) +- Add tests for bcache_create/attach/detach/destroy functions (vpodzime) +- Add the 'rebuild' Makefile target (vpodzime) +- Add bcache_create, bcache_attach, bcache_detach and bcache_destroy functions (vpodzime) +- Implement a helper function to echo string into a file (vpodzime) +- Add tests for zram_create_devices and zram_destroy_devices functions (vpodzime) +- Add the zram_destroy_devices function to the KBD plugin (vpodzime) +- Add first function to the KBD plugin: zram_create_devices (vpodzime) +- Add the KernelBlockDevices plugin (vpodzime) + +* Wed May 13 2015 Vratislav Podzimek - 0.13-1 +- Prevent a leaky test from running in Jenkins (vpodzime) +- Try harder when cleaning up after MD RAID tests (vpodzime) +- Improve the MD RAID activate/deactivate test (vpodzime) +- One more @contextmanager that needs try-finally (vpodzime) +- Do not require metadata version to be reported by 'mdadm --examine' (#1217900) (vpodzime) +- Make sure we always set things back in context managers (vpodzime) +- Make the release date for version 1.0 more realistic (vpodzime) +- Merge pull request #11 from vpodzime/master (vpodzime) +- Run utilities with LC_ALL=C (vpodzime) (#1219033) +- Free GMatchInfo instance even in case of no match (vpodzime) +- Resolve /dev/md/ symlinks when checking swap status. (dlehman) + +* Fri Apr 24 2015 Vratislav Podzimek - 0.12-1 +- Require minimum version of libblockdev-utils in some plugins (vpodzime) +- Report both stdout and stderr if exit code != 0 (vpodzime) + +* Fri Apr 17 2015 Vratislav Podzimek - 0.11-1 +- Fix issues with using overriden functions over ErrorProxy (vpodzime) +- Update the roadmap.rst and features.rst with new stuff (vpodzime) +- Fix two minor issues with docs generation (vpodzime) + +* Thu Apr 16 2015 Vratislav Podzimek - 0.10-1 +- Fix return type of the unload_plugins() function (vpodzime) +- Close the DL handle when check() or init() fail (vpodzime) +- Add one more check to the reload test (vpodzime) +- Drop reference to check() and init() functions (vpodzime) +- Add more cats to tests (vpodzime) +- Make regexp for getting btrfs version more generic (vpodzime) +- Merge pull request #8 from vpodzime/master-check_functions (vpodzime) +- Fix parameters passed to unoverridden swapon function (vpodzime) +- Implement and test swap plugin's check function (vpodzime) +- Implement and test MD RAID plugin's check function (vpodzime) +- Implement and test mpath plugin's check function (vpodzime) +- Try harder to get util's version (vpodzime) +- Implement and test loop plugin's check function (vpodzime) +- Implement and test DM plugin's check function (vpodzime) +- Implement and test BTRFS plugin's check function (vpodzime) +- Implement and test LVM plugin's check function (vpodzime) +- Init logging before loading plugins (vpodzime) +- Add function for utility availability checking (vpodzime) +- Fix default value for the fake_utils' path argument (vpodzime) +- Add ErrorProxy instance for the utils functions (vpodzime) +- Add function for version comparison (vpodzime) +- Merge pull request #9 from clumens/master (vpodzime) +- Disable pylint checking on the new exception proxy. (clumens) +- Fix XRules application and add a test for it (vpodzime) +- Raise NotImplementedError when an unavailable function is called (vpodzime) +- Merge pull request #4 from vpodzime/master-error_proxy (vpodzime) +- Merge branch 'master' into master-error_proxy (vpodzime) +- Merge pull request #5 from vpodzime/master-not_implemented_error (vpodzime) +- Add a simple test for unloaded/unavailable functions (vpodzime) +- Unload the plugins properly when reinit() is called (vpodzime) +- Raise error/exception when an unimplemented function is called (#1201475) (vpodzime) +- Do an ugly but necessary hack to make local GI overrides work (vpodzime) +- Add the __dir__ method to ErrorProxy (vpodzime) +- Add a rationale for the ErrorProxy to the overrides' docstring (vpodzime) +- Add some basic info about GI overrides to the documentation (vpodzime) +- Use pylint to check for errors in python overrides (vpodzime) +- Add the first small test for the ErrorProxy (vpodzime) +- Put the GI overrides in a special dir so that they are preferred (vpodzime) +- Add a cache for attributes already resolved by ErrorProxy (vpodzime) +- Implement the ErrorProxy python class and use it (vpodzime) + +* Tue Apr 07 2015 Vratislav Podzimek - 0.9-1 +- Merge pull request #7 from vpodzime/master-fw_raid_fixes (vpodzime) +- Try a bit harder when trying to determine MD RAID name (#1207317) (vpodzime) +- Don't be naïve about mdadm --detail telling us what we want (#1207317) (vpodzime) +- Ignore libblockdev tarballs (vpodzime) +- Implement a test of btrfs_list_subvolumes on data from bug report (vpodzime) +- Implement a context manager for running tests with fake utils (vpodzime) +- Do not try to cannonicalize MD UUIDs if we didn't get them (#1207317) (vpodzime) +- Fix the table in roadmap.rst (vpodzime) +- Enrich the roadmap.rst file and add info about new plans (vpodzime) +- Sync spec file with downstream (vpodzime) + +* Fri Mar 27 2015 Vratislav Podzimek - 0.8-1 +- Merge pull request #6 from vpodzime/master-sort_btrfs_subvolumes (vpodzime) +- Don't be naïve about mdadm providing us data we would like (#1206394) (vpodzime) +- Sort BTRFS subvolumes in a way that child never appears before parent (#1201120) (vpodzime) +- Let libcryptsetup handle LUKSname->/dev/mapper/LUKSname for us (vpodzime) +- Fix the crypto_luks_resize and create a test for it (vpodzime) +- Add targets to create the SRPM and RPM files easily (vpodzime) +- Don't round up to multiple of PE size bigger than max value of the rtype (vpodzime) +- Mark majority of MD RAID tests as slow (vpodzime) +- Merge pull request #1 from dashea/file-paths (vpodzime) +- Don't report error for no loop device associated with given file (vpodzime) +- Skip the detail_data.clean check when running tests in Jenkins (vpodzime) +- Make package file paths more specific (dshea) +- Implement and use MD RAID-specific wait for tests (vpodzime) +- Try to give MD RAID time to sync things before querying them (vpodzime) +- Fix the default value of the BDMDDetailData.clean field (vpodzime) +- Do cleanup after every single MD RAID tests (vpodzime) +- Do cleanup after every single LVM test (vpodzime) +- Do cleanup after every single BTRFS test (vpodzime) +- Make sure the LUKS device is closed and removed after tests (vpodzime) +- Make sure DM maps from tests are removed after tests (vpodzime) +- Make sure that loop devices are deactivated after tests (vpodzime) +- Make the tearDown method of the mpath test case better visible (vpodzime) +- Make sure that the swap is deactivated after tests (vpodzime) +- Fix docstrings in tests' utils helper functions (vpodzime) +- Improve the logging tests in utils_test.py (vpodzime) +- Update the features.rst file (vpodzime) +- Update the roadmap (vpodzime) +- Don't check if we get a mountpoint for BTRFS operations (vpodzime) + +* Sun Mar 22 2015 Peter Robinson 0.7-2 +- Ship license as per packaging guidelines +- plugins-all should depend on base library too +- Add dev docs + +* Fri Feb 27 2015 Vratislav Podzimek - 0.7-1 +- Be ready for mdadm --examine to not provide some of the values we want (vpodzime) +- Add exit code information to exec logging (vpodzime) +- Improve and add tests (vpodzime) +- Mark the test_force_plugin and test_reload as slow (vpodzime) +- Make sure we get some devices when creating btrfs volume (vpodzime) +- Add override for the lvremove function (vpodzime) +- Do not create LUKS format with no passphrase and no key file (vpodzime) +- Make sure we use the /dev/mapper/... path for luks_status (vpodzime) + +* Thu Feb 19 2015 Vratislav Podzimek - 0.6-1 +- Don't report error when non-existing swap's status is queried (vpodzime) +- Make libblockdev-plugins-all pull the same version of plugins (vpodzime) +- Don't report error when asked for a backing file of an uknown loop (vpodzime) +- Fix accidental change in the spec's changelog (vpodzime) + +* Mon Feb 16 2015 Vratislav Podzimek - 0.5-1 +- Add tests for what we can easily test from the mpath plugin (vpodzime) +- Add link to sources to the documentation (vpodzime) +- Add missing symbols into the libblockdev-sections.txt file (vpodzime) +- Do not build docs for testing (vpodzime) +- Add the bd_try_init function (vpodzime) +- Log stdout and stderr output when running processes (vpodzime) +- Allow a subset of plugins to be load instead of all (vpodzime) +- Make sure devmapper doesn't spam stdout with tons of messages (vpodzime) +- Let debug messages go to stderr when running ipython (vpodzime) +- Give plugins a way to initialize themselves (vpodzime) +- Give plugins a way how to check if they could run properly (vpodzime) +- Allow a subset of plugins to be load instead of all [TEST NEEDED] (vpodzime) +- Make sure we use the whole /dev/mapper path for cryptsetup (vpodzime) +- Fix vg_pv_count parsing when getting info about PV (vpodzime) +- Set default values to data structures if real values are not available (vpodzime) +- Fix the parameter name specifying pool metadata size (vpodzime) +- Activate LUKS as ReadWrite in luks_open (vpodzime) +- Make sure we pass key_size to cryptsetup in bytes (vpodzime) +- Add the min_entropy parameter to luks_format Python overrides (vpodzime) +- Pass size in KiB instead of B to lvcreate (vpodzime) +- Add underscore into dataalignment and metadatasize parameter names (vpodzime) +- Don't report error if non-mpath device is tested for being mpath member (vpodzime) +- Fix name of the invoked utility in mpath_set_friendly_names (vpodzime) + +* Sat Jan 31 2015 Vratislav Podzimek - 0.4-1 +- Improve the test for lvm_set_global_config (vpodzime) +- Fix some minor issues in the spec file (vpodzime) +- Fix issues with the LVM global config str (vpodzime) +- Add couple more Python overrides (vpodzime) +- Fix the name of the lvm_thlvpoolname() function in the header file (vpodzime) +- Use assertEqual instead of assertTrue(a == b) (vpodzime) +- Add the min_entropy parameter to luks_format (vpodzime) +- Move internal dmraid-related macros into the source file (vpodzime) +- Add an override for the md_add function (vpodzime) +- Fix parameters in luks_open python overrides (vpodzime) +- Prevent init() from being done multiple times and provide a test function (vpodzime) +- Add the roadmap.rst document (vpodzime) +- Remove an extra parenthesis in one of the docstrings (vpodzime) +- Move the mddetail function next to the mdexamine function (vpodzime) +- Add some more constants required by blivet (vpodzime) + +* Wed Jan 21 2015 Vratislav Podzimek - 0.3-1 +- Require volume_key-devel in a version that fixes build issues (vpodzime) +- Fix Python 2 devel package name in BuildRequires (vpodzime) +- Generate docs for the library and all plugins (vpodzime) +- Make doc comments better for documentation generation (vpodzime) +- Fix parameter names in function prototypes (vpodzime) +- Add the metadatasize parameter to pvcreate (vpodzime) +- Add the dataalignment parameter to lvm_pvcreate (vpodzime) +- Export non-internal constants via introspection (vpodzime) +- Expand size constants in the GI-scanned files (vpodzime) +- Fix usage printing in the boilerplate_generator (vpodzime) +- Add the build directory to .gitignore (vpodzime) +- Add the md_run function (vpodzime) +- Fix some issues in Python overrides (vpodzime) +- Add the escrow_device function to the crypto plugin (vpodzime) +- Fix version of GI files in the Makefile (vpodzime) +- Make the order of release target's dependencies more explicit (vpodzime) + +* Mon Jan 12 2015 Vratislav Podzimek - 0.2-1 +- Fix dependencies of the release target (vpodzime) +- Python overrides for the GI-generated bindings (vpodzime) +- Pass version info to the code and use it to load plugins (vpodzime) + +* Wed Dec 10 2014 Vratislav Podzimek - 0.1-1 +- Initial release diff --git a/sources b/sources new file mode 100644 index 0000000..79bff78 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (libblockdev-2.24.tar.gz) = 92b7d734ea2cefbb67e626bef369d6785ba2a4bbbf09a4f59345febe977bc32319fb44f38b3c3177b8652abbc1f87b6cc76d41fdd2d70783c1c168049bdcb1d6