1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-22 13:33:52 +03:00

M #-: Remove unused code for Backup action in scheduler

This commit is contained in:
Ruben S. Montero 2023-11-10 11:29:45 +01:00
parent 4756ef9d1b
commit 7a9fe2fa60
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87
4 changed files with 1 additions and 95 deletions

View File

@ -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 <queue>
#include <map>
#include <vector>
#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<int, std::vector<VMBackupAction>> host_backups;
};
#endif /* SCHEDULED_ACTION_XML_H_ */

View File

@ -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
*/

View File

@ -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
// -----------------------------------------------------------

View File

@ -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"));