all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Daniel Kral <d.kral@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH ha-manager 3/7] sim: hardware: factor common service lock hash access in unlock_service
Date: Fri, 17 Apr 2026 14:27:18 +0200	[thread overview]
Message-ID: <20260417122728.330123-4-d.kral@proxmox.com> (raw)
In-Reply-To: <20260417122728.330123-1-d.kral@proxmox.com>

Signed-off-by: Daniel Kral <d.kral@proxmox.com>
---
 src/PVE/HA/Sim/Hardware.pm | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/PVE/HA/Sim/Hardware.pm b/src/PVE/HA/Sim/Hardware.pm
index 891d552f..88fd64e8 100644
--- a/src/PVE/HA/Sim/Hardware.pm
+++ b/src/PVE/HA/Sim/Hardware.pm
@@ -319,12 +319,14 @@ sub unlock_service {
 
     die "no such service '$sid'\n" if !$conf->{$sid};
 
-    if (!defined($conf->{$sid}->{lock})) {
+    my $service_lock = $conf->{$sid}->{lock};
+
+    if (!defined($service_lock)) {
         return undef;
     }
 
-    if (defined($lock) && $conf->{$sid}->{lock} ne $lock) {
-        warn "found lock '$conf->{$sid}->{lock}' trying to remove '$lock' lock\n";
+    if (defined($lock) && $service_lock ne $lock) {
+        warn "found lock '$service_lock' trying to remove '$lock' lock\n";
         return undef;
     }
 
-- 
2.47.3





  parent reply	other threads:[~2026-04-17 12:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-17 12:27 [PATCH ha-manager 0/7] some test logging output improvements Daniel Kral
2026-04-17 12:27 ` [PATCH ha-manager 1/7] sim: always limit the priority level to 4 characters Daniel Kral
2026-04-17 12:27 ` [PATCH ha-manager 2/7] consistently use correct priority levels for log calls Daniel Kral
2026-04-17 12:27 ` Daniel Kral [this message]
2026-04-17 12:27 ` [PATCH ha-manager 4/7] use log with warning priority instead of warn where possible Daniel Kral
2026-04-17 12:27 ` [PATCH ha-manager 5/7] pve-ha-tester: capture and fail for unexpected perl warnings Daniel Kral
2026-04-17 12:27 ` [PATCH ha-manager 6/7] test: ha-tester: use consistent word casing for failed test messages Daniel Kral
2026-04-17 12:27 ` [PATCH ha-manager 7/7] test: ha-tester: use colorized diff for unexpected test log outputs Daniel Kral

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260417122728.330123-4-d.kral@proxmox.com \
    --to=d.kral@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal