diff --git a/backport-DRBDmon-Adjust-events-log-supplier-program-name.patch b/backport-DRBDmon-Adjust-events-log-supplier-program-name.patch new file mode 100644 index 0000000000000000000000000000000000000000..079f046113d9c7be1043c290c066e02ce314b4bd --- /dev/null +++ b/backport-DRBDmon-Adjust-events-log-supplier-program-name.patch @@ -0,0 +1,25 @@ +From 4ecb776ed6b75d326624281b50f0a11adeca2e58 Mon Sep 17 00:00:00 2001 +From: Robert Altnoeder +Date: Wed, 20 Nov 2024 18:44:19 +0100 +Subject: [PATCH] DRBDmon: Adjust events log supplier program name + +--- + user/drbdmon/subprocess/EventsSourceSpawner.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/user/drbdmon/subprocess/EventsSourceSpawner.cpp b/user/drbdmon/subprocess/EventsSourceSpawner.cpp +index 20fa13be..1b50aa23 100644 +--- a/user/drbdmon/subprocess/EventsSourceSpawner.cpp ++++ b/user/drbdmon/subprocess/EventsSourceSpawner.cpp +@@ -21,7 +21,7 @@ const char* const EventsSourceSpawner::EVENTS_PROGRAM_ARGS[] = + "all", + nullptr + }; +-const char* const EventsSourceSpawner::SAVED_EVENTS_PROGRAM = "eventsfeeder"; ++const char* const EventsSourceSpawner::SAVED_EVENTS_PROGRAM = "drbd-events-log-supplier"; + + EventsSourceSpawner::EventsSourceSpawner(MessageLog& logRef): + log(logRef) +-- +2.33.1.windows.1 + diff --git a/backport-DRBDmon-Integrate-global-local-command-delegation.patch b/backport-DRBDmon-Integrate-global-local-command-delegation.patch new file mode 100644 index 0000000000000000000000000000000000000000..45530da497e47277c18a1755fe9876441cbaecc6 --- /dev/null +++ b/backport-DRBDmon-Integrate-global-local-command-delegation.patch @@ -0,0 +1,169 @@ +From 1053b3344c85646bbfbc59233a3d502183c3ea65 Mon Sep 17 00:00:00 2001 +From: Robert Altnoeder +Date: Fri, 26 Jul 2024 08:37:09 +0200 +Subject: [PATCH] DRBDmon: Integrate global/local command delegation + +--- + user/drbdmon/terminal/DisplayCommon.h | 12 +++++----- + user/drbdmon/terminal/DisplayCommonImpl.cpp | 20 ++++++++++------- + user/drbdmon/terminal/DisplayCommonImpl.h | 8 +++++-- + user/drbdmon/terminal/MDspBase.cpp | 25 +++------------------ + 4 files changed, 28 insertions(+), 37 deletions(-) + +diff --git a/user/drbdmon/terminal/DisplayCommon.h b/user/drbdmon/terminal/DisplayCommon.h +index 9160c3dd..b1b94e43 100644 +--- a/user/drbdmon/terminal/DisplayCommon.h ++++ b/user/drbdmon/terminal/DisplayCommon.h +@@ -2,6 +2,7 @@ + #define DISPLAYCOMMON_H + + #include ++#include + + class DisplayCommon + { +@@ -16,9 +17,7 @@ class DisplayCommon + enum command_state_type : uint8_t + { + INPUT = 0, +- CANCEL = 1, +- CMD_LOCAL = 2, +- CMD_GLOBAL = 3 ++ CANCEL = 1 + }; + + virtual ~DisplayCommon() noexcept +@@ -47,9 +46,12 @@ class DisplayCommon + virtual void display_problem_mode_label(const bool using_problem_mode) const = 0; + virtual problem_mode_type get_problem_mode() const noexcept = 0; + virtual void toggle_problem_mode() noexcept = 0; +- virtual command_state_type command_line_key_pressed(const uint32_t key) const = 0; ++ virtual command_state_type command_line_key_pressed( ++ const uint32_t key, ++ ModularDisplay& display ++ ) const = 0; + virtual void activate_command_line() const = 0; +- virtual bool global_command() const = 0; ++ virtual bool execute_command(ModularDisplay& display) const = 0; + virtual void application_idle() const = 0; + virtual void application_working() const = 0; + }; +diff --git a/user/drbdmon/terminal/DisplayCommonImpl.cpp b/user/drbdmon/terminal/DisplayCommonImpl.cpp +index 8427b2fc..f3ceed78 100644 +--- a/user/drbdmon/terminal/DisplayCommonImpl.cpp ++++ b/user/drbdmon/terminal/DisplayCommonImpl.cpp +@@ -706,7 +706,10 @@ void DisplayCommonImpl::toggle_problem_mode() noexcept + } + } + +-DisplayCommon::command_state_type DisplayCommonImpl::command_line_key_pressed(const uint32_t key) const ++DisplayCommon::command_state_type DisplayCommonImpl::command_line_key_pressed( ++ const uint32_t key, ++ ModularDisplay& display ++) const + { + DisplayCommon::command_state_type state = DisplayCommon::command_state_type::INPUT; + if (key == KeyCodes::FUNC_12) +@@ -717,11 +720,8 @@ DisplayCommon::command_state_type DisplayCommonImpl::command_line_key_pressed(co + else + if (key == KeyCodes::ENTER) + { +- state = DisplayCommon::command_state_type::CMD_LOCAL; +- if (global_command()) +- { +- state = DisplayCommon::command_state_type::CMD_GLOBAL; +- } ++ const bool processed = execute_command(display); ++ state = processed ? DisplayCommon::command_state_type::CANCEL : DisplayCommon::command_state_type::INPUT; + } + else + { +@@ -834,7 +834,7 @@ void DisplayCommonImpl::activate_command_line() const + } + } + +-bool DisplayCommonImpl::global_command() const ++bool DisplayCommonImpl::execute_command(ModularDisplay& display) const + { + bool processed = false; + const std::string& command = dsp_comp_hub.command_line->get_text(); +@@ -859,7 +859,11 @@ bool DisplayCommonImpl::global_command() const + processed = dsp_comp_hub.global_cmd_exec->execute_command(upper_keyword, tokenizer); + if (!processed) + { +- processed = dsp_comp_hub.drbd_cmd_exec->execute_command(upper_keyword, tokenizer); ++ processed = display.execute_command(upper_keyword, tokenizer); ++ if (!processed) ++ { ++ processed = dsp_comp_hub.drbd_cmd_exec->execute_command(upper_keyword, tokenizer); ++ } + } + } + } +diff --git a/user/drbdmon/terminal/DisplayCommonImpl.h b/user/drbdmon/terminal/DisplayCommonImpl.h +index 1ac7fafa..8e09bfbe 100644 +--- a/user/drbdmon/terminal/DisplayCommonImpl.h ++++ b/user/drbdmon/terminal/DisplayCommonImpl.h +@@ -3,6 +3,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -35,9 +36,12 @@ class DisplayCommonImpl : public DisplayCommon + virtual void display_problem_mode_label(const bool using_problem_mode) const override; + virtual problem_mode_type get_problem_mode() const noexcept; + virtual void toggle_problem_mode() noexcept; +- virtual DisplayCommon::command_state_type command_line_key_pressed(const uint32_t key) const; ++ virtual command_state_type command_line_key_pressed( ++ const uint32_t key, ++ ModularDisplay& display ++ ) const override; + virtual void activate_command_line() const; +- virtual bool global_command() const override; ++ virtual bool execute_command(ModularDisplay& display) const override; + virtual void application_idle() const override; + virtual void application_working() const override; + +diff --git a/user/drbdmon/terminal/MDspBase.cpp b/user/drbdmon/terminal/MDspBase.cpp +index 77bc86af..f95d3a21 100644 +--- a/user/drbdmon/terminal/MDspBase.cpp ++++ b/user/drbdmon/terminal/MDspBase.cpp +@@ -176,29 +176,10 @@ bool MDspBase::key_pressed(const uint32_t key) + else + if (base_input_mode == base_input_mode_type::COMMAND) + { +- const DisplayCommon::command_state_type state = dsp_comp_hub.dsp_common->command_line_key_pressed(key); +- bool exit_cmd_mode = false; +- if (state == DisplayCommon::command_state_type::CMD_LOCAL) +- { +- StringTokenizer tokenizer(dsp_comp_hub.command_line->get_text(), DisplayConsts::CMD_TOKEN_DELIMITER); +- if (tokenizer.has_next()) +- { +- std::string keyword(tokenizer.next()); +- if (keyword.length() >= 2) +- { +- keyword.erase(0, 1); +- std::string upper_keyword = string_transformations::uppercase_copy_of(keyword); +- exit_cmd_mode = execute_command(upper_keyword, tokenizer); +- } +- } +- } +- else ++ const DisplayCommon::command_state_type state = dsp_comp_hub.dsp_common->command_line_key_pressed( ++ key, *this ++ ); + if (state != DisplayCommon::command_state_type::INPUT) +- { +- exit_cmd_mode = true; +- } +- +- if (exit_cmd_mode) + { + base_input_mode = base_input_mode_type::GLOBAL_KEYS; + dsp_comp_hub.dsp_io->write_text(dsp_comp_hub.ansi_ctl->ANSI_CURSOR_OFF.c_str()); +-- +2.33.1.windows.1 + diff --git a/drbd.spec b/drbd.spec index dcc96c92e054defdc95c99c33323376d558e85a6..381fae28888f0182d815aa3fd04af77e1ba63c45 100644 --- a/drbd.spec +++ b/drbd.spec @@ -1,12 +1,14 @@ Name: drbd Summary: DRBD user-land tools and scripts Version: 9.29.0 -Release: 2 +Release: 3 Source0: http://www.linbit.com/downloads/%{name}/utils/%{name}-utils-%{version}.tar.gz Patch0: drbd-utils-9.12.2-disable_xsltproc_network_read.patch Patch1: drbd-utils-9.15.0-make_configure-workaround.patch Patch2: backport-drbd-verify.py-relax-host-key-checking.patch Patch3: backport-DRBDmon-Disabled-DRBD-commands-warning-only-for-actu.patch +Patch4: backport-DRBDmon-Integrate-global-local-command-delegation.patch +Patch5: backport-DRBDmon-Adjust-events-log-supplier-program-name.patch License: GPL-2.0-or-later ExclusiveOS: linux @@ -216,6 +218,10 @@ management utility. %systemd_preun drbd.service %changelog +* Fri Dec 06 2024 liupei - 9.29.0-3 +- DRBDmon: Integrate global/local command delegation +- DRBDmon: Adjust events log supplier program name + * Tue Dec 03 2024 liupei - 9.29.0-2 - drbd-verify.py: relax host key checking - DRBDmon: Disabled DRBD commands warning only for actual DRBD commands