mirror of
https://git.proxmox.com/git/proxmox
synced 2025-10-04 19:39:30 +00:00
maintenance: make is_offline more generic
... and add MaintenanceType::Delete to it. We also want to clear any cach entries if we are deleting the datastore, not just if it is marked as offline. Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
This commit is contained in:
parent
d291f67236
commit
6134a73b1e
@ -77,10 +77,9 @@ pub struct MaintenanceMode {
|
||||
}
|
||||
|
||||
impl MaintenanceMode {
|
||||
/// Used for deciding whether the datastore is cleared from the internal cache after the last
|
||||
/// task finishes, so all open files are closed.
|
||||
pub fn is_offline(&self) -> bool {
|
||||
self.ty == MaintenanceType::Offline
|
||||
/// Used for deciding whether the datastore is cleared from the internal cache
|
||||
pub fn clear_from_cache(&self) -> bool {
|
||||
self.ty == MaintenanceType::Offline || self.ty == MaintenanceType::Delete
|
||||
}
|
||||
|
||||
pub fn check(&self, operation: Option<Operation>) -> Result<(), Error> {
|
||||
|
Loading…
Reference in New Issue
Block a user