From: Christian Ebner <c.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox 1/2] pbs-api-types: make operation non-optional for maintenance-mode check
Date: Thu, 22 Jan 2026 16:11:20 +0100 [thread overview]
Message-ID: <20260122151125.832787-2-c.ebner@proxmox.com> (raw)
In-Reply-To: <20260122151125.832787-1-c.ebner@proxmox.com>
This checks the availability of the datastore constrained by the
currently set maintenance-mode, based on the operation the caller
would like to perform.
In an effort to force the operation to be set when performing
datastore operations, make this non optional for the maintenance mode
checks.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
pbs-api-types/src/maintenance.rs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/pbs-api-types/src/maintenance.rs b/pbs-api-types/src/maintenance.rs
index 6b97ff10..5af34291 100644
--- a/pbs-api-types/src/maintenance.rs
+++ b/pbs-api-types/src/maintenance.rs
@@ -93,7 +93,7 @@ impl MaintenanceMode {
|| self.ty == MaintenanceType::Unmount
}
- pub fn check(&self, operation: Option<Operation>) -> Result<(), Error> {
+ pub fn check(&self, operation: Operation) -> Result<(), Error> {
if self.ty == MaintenanceType::Delete {
bail!("datastore is being deleted");
}
@@ -102,7 +102,7 @@ impl MaintenanceMode {
.decode_utf8()
.unwrap_or(Cow::Borrowed(""));
- if let Some(Operation::Lookup) = operation {
+ if Operation::Lookup == operation {
return Ok(());
} else if self.ty == MaintenanceType::Unmount {
bail!("datastore is being unmounted");
@@ -111,7 +111,7 @@ impl MaintenanceMode {
} else if self.ty == MaintenanceType::S3Refresh {
bail!("S3 refresh maintenance mode: {}", message);
} else if self.ty == MaintenanceType::ReadOnly {
- if let Some(Operation::Write) = operation {
+ if Operation::Write == operation {
bail!("read-only maintenance mode: {}", message);
}
}
--
2.47.3
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
next prev parent reply other threads:[~2026-01-22 15:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-22 15:11 [pbs-devel] [PATCH proxmox{, -backup} 0/6] fix #6716: Add support for http proxy configuration for S3 endpoints Christian Ebner
2026-01-22 15:11 ` Christian Ebner [this message]
2026-01-22 15:11 ` [pbs-devel] [PATCH proxmox 2/2] s3-client: add proxy configuration as optional client option Christian Ebner
2026-01-22 15:11 ` [pbs-devel] [PATCH proxmox-backup 1/4] datastore: make operation non-optional in lookups Christian Ebner
2026-01-22 15:11 ` [pbs-devel] [PATCH proxmox-backup 2/4] tools: factor out node proxy config read helper Christian Ebner
2026-01-22 15:11 ` [pbs-devel] [PATCH proxmox-backup 3/4] datastore: refactor datastore lookup parameters into dedicated type Christian Ebner
2026-01-22 15:11 ` [pbs-devel] [PATCH proxmox-backup 4/4] fix #6716: pass node http proxy config to s3 backend Christian Ebner
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=20260122151125.832787-2-c.ebner@proxmox.com \
--to=c.ebner@proxmox.com \
--cc=pbs-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox