From 7a9fe2fa602ea65c5819c9e659b400064417e367 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Fri, 10 Nov 2023 11:29:45 +0100 Subject: [PATCH] M #-: Remove unused code for Backup action in scheduler --- src/scheduler/include/ScheduledActionXML.h | 73 -------------------- src/scheduler/include/Scheduler.h | 14 +--- src/scheduler/src/sched/Scheduler.cc | 4 -- src/scheduler/src/sched/SchedulerTemplate.cc | 5 -- 4 files changed, 1 insertion(+), 95 deletions(-) delete mode 100644 src/scheduler/include/ScheduledActionXML.h diff --git a/src/scheduler/include/ScheduledActionXML.h b/src/scheduler/include/ScheduledActionXML.h deleted file mode 100644 index 011d4d1bd6..0000000000 --- a/src/scheduler/include/ScheduledActionXML.h +++ /dev/null @@ -1,73 +0,0 @@ -/* -------------------------------------------------------------------------- */ -/* Copyright 2002-2023, OpenNebula Project, OpenNebula Systems */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); you may */ -/* not use this file except in compliance with the License. You may obtain */ -/* a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ -/* See the License for the specific language governing permissions and */ -/* limitations under the License. */ -/* -------------------------------------------------------------------------- */ - -#ifndef SCHEDULED_ACTION_XML_H_ -#define SCHEDULED_ACTION_XML_H_ - -#include -#include -#include - -#include "SchedAction.h" - -class VirtualMachineActionsPoolXML; - -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ - -class SchedActionsXML : public SchedActions -{ -public: - SchedActionsXML(Template * vm):SchedActions(vm){}; - - int do_actions(int vmid, time_t stime); -}; - -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ - -class BackupActions -{ -public: - - BackupActions(int max, int maxh):max_backups(max), max_backups_host(maxh){}; - - void add(int vmid, int hid, time_t stime, SchedActionsXML& sas); - - void dispatch(VirtualMachineActionsPoolXML* vmapool); - -private: - int max_backups; - - int max_backups_host; - - struct VMBackupAction - { - VMBackupAction():backup("SCHED_ACTION"){}; - - /** ID of the VM and action**/ - int vm_id = -1; - - int action_id = -1; - - /** Pending backup operation **/ - VectorAttribute backup; - }; - - std::map> host_backups; -}; - -#endif /* SCHEDULED_ACTION_XML_H_ */ diff --git a/src/scheduler/include/Scheduler.h b/src/scheduler/include/Scheduler.h index dd8964f7f3..080a1ffa4a 100644 --- a/src/scheduler/include/Scheduler.h +++ b/src/scheduler/include/Scheduler.h @@ -80,9 +80,7 @@ protected: host_dispatch_limit(0), zone_id(0), mem_ds_scale(0), - diff_vnets(false), - max_backups(5), - max_backups_host(2) + diff_vnets(false) { } @@ -228,16 +226,6 @@ private: */ bool diff_vnets; - /** - * Max number of active backups - */ - int max_backups; - - /** - * Max number of active backups per host - */ - int max_backups_host; - /** * oned runtime configuration values */ diff --git a/src/scheduler/src/sched/Scheduler.cc b/src/scheduler/src/sched/Scheduler.cc index 212e15fa35..18ba123707 100644 --- a/src/scheduler/src/sched/Scheduler.cc +++ b/src/scheduler/src/sched/Scheduler.cc @@ -129,10 +129,6 @@ void Scheduler::start() conf.get("DIFFERENT_VNETS", diff_vnets); - conf.get("MAX_BACKUPS", max_backups); - - conf.get("MAX_BACKUPS_HOST", max_backups_host); - // ----------------------------------------------------------- // Log system & Configuration File // ----------------------------------------------------------- diff --git a/src/scheduler/src/sched/SchedulerTemplate.cc b/src/scheduler/src/sched/SchedulerTemplate.cc index 7006ae7c98..4016b0a937 100644 --- a/src/scheduler/src/sched/SchedulerTemplate.cc +++ b/src/scheduler/src/sched/SchedulerTemplate.cc @@ -46,8 +46,6 @@ void SchedulerTemplate::set_conf_default() # LIVE_RESCHEDS # COLD_MIGRATE_MODE # LOG -# MAX_BACKUPS -# MAX_BACKUPS_HOST #------------------------------------------------------------------------------- */ set_conf_single("MESSAGE_SIZE", "1073741824"); @@ -60,9 +58,6 @@ void SchedulerTemplate::set_conf_default() set_conf_single("LIVE_RESCHEDS", "0"); set_conf_single("COLD_MIGRATE_MODE", "0"); - set_conf_single("MAX_BACKUPS", "5"); - set_conf_single("MAX_BACKUPS_HOST", "2"); - //DEFAULT_SCHED vvalue.clear(); vvalue.insert(make_pair("POLICY","1"));