1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-23 17:33:56 +03:00

M #-: Fix CppCheck issues in 6.6 branch (#2485)

(cherry picked from commit c70a239033)
This commit is contained in:
Pavel Czerný 2023-02-07 12:33:31 +01:00 committed by Ruben S. Montero
parent ef5d0c60d4
commit 19f18e2877
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87
8 changed files with 11 additions and 13 deletions

View File

@ -135,7 +135,7 @@ public:
typedef class IncIterator inc_iterator;
private:
ExtendedAttribute * attribute_factory(VectorAttribute * va, int id) const
ExtendedAttribute * attribute_factory(VectorAttribute * va, int id) const override
{
return new Increment(va, id);
};

View File

@ -2039,7 +2039,7 @@ void LifeCycleManager::trigger_updatevnet(int vnid)
// -------------------------------------------------------------
if ( is_tmpl || is_update )
{
auto rc = vm->nic_update(vnid);
rc = vm->nic_update(vnid);
if (rc < 0)
{

View File

@ -3974,8 +3974,6 @@ void VirtualMachineBackup::request_execute(
Backups::Mode mode;
int li_id;
ostringstream oss;
// ------------------------------------------------------------------------
// Get request parameters
// ------------------------------------------------------------------------

View File

@ -59,9 +59,9 @@ private:
VMBackupAction():backup("SCHED_ACTION"){};
/** ID of the VM and action**/
int vm_id;
int vm_id = -1;
int action_id;
int action_id = -1;
/** Pending backup operation **/
VectorAttribute backup;

View File

@ -80,7 +80,9 @@ protected:
host_dispatch_limit(0),
zone_id(0),
mem_ds_scale(0),
diff_vnets(false)
diff_vnets(false),
max_backups(5),
max_backups_host(2)
{
}

View File

@ -163,12 +163,12 @@ public:
*/
int set_up() override;
int active_backups()
int active_backups() const
{
return _active_backups;
}
int host_backups(int host_id)
int host_backups(int host_id) const
{
return backups_host[host_id];
}
@ -183,7 +183,7 @@ protected:
/**
* Total backup operations in progress
*/
mutable int _active_backups;
mutable int _active_backups = 0;
/**
* Backup operations per host

View File

@ -332,7 +332,7 @@ int VirtualMachineActionsPoolXML::get_suitable_nodes(
<< " and (not(DONE > 0) or boolean(REPEAT))) or "
<< "( TIME[starts-with(text(),\"+\")] and not(DONE>0) ) ]/../..";
return get_nodes(oss.str().c_str(), content);
return get_nodes(oss.str(), content);
}
/* -------------------------------------------------------------------------- */

View File

@ -2374,8 +2374,6 @@ int VirtualMachineManager::updatenic(VirtualMachine * vm, int vnid)
string vm_tmpl;
string drv_msg;
ostringstream os;
if (!vm->hasHistory())
{
return -1;