1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-08 21:17:43 +03:00

Trim spaces and fix newline at the end of file

This commit is contained in:
Jaime Melis 2012-09-10 18:08:00 +02:00
parent df2d09a550
commit 5db7e6d04b
6 changed files with 60 additions and 61 deletions

View File

@ -63,15 +63,15 @@ public:
* Triggers specific actions to the Information Manager. This function
* wraps the ActionManager trigger function.
* @param action the IM action
* @param vid VM unique id. This is the argument of the passed to the
* @param vid VM unique id. This is the argument of the passed to the
* invoked action.
*/
virtual void trigger(
Actions action,
int vid);
/**
* This functions starts the associated listener thread, and creates a
* This functions starts the associated listener thread, and creates a
* new thread for the Information Manager. This thread will wait in
* an action loop till it receives ACTION_FINALIZE.
* @return 0 on success.
@ -80,12 +80,12 @@ public:
/**
* Loads Virtual Machine Manager Mads defined in configuration file
* @param uid of the user executing the driver. When uid is 0 the nebula
* @param uid of the user executing the driver. When uid is 0 the nebula
* identity will be used. Otherwise the Mad will be loaded through the
* sudo application.
* sudo application.
*/
void load_mads(int uid);
/**
* Gets the thread identification.
* @return pthread_t for the manager thread (that in the action loop).
@ -153,7 +153,7 @@ private:
* Pointer to the Host Pool, to access hosts
*/
HostPool * hpool;
/**
* Action engine for the Manager
*/
@ -180,7 +180,7 @@ private:
};
/**
* Returns a pointer to a Transfer Manager driver. The driver is
* Returns a pointer to a Transfer Manager driver. The driver is
* searched by its name.
* @param name the name of the driver
* @return the TM driver owned by uid with attribute name equal to value
@ -193,9 +193,9 @@ private:
return static_cast<const TransferManagerDriver *>
(MadManager::get(0,_name,name));
};
/**
* Returns a pointer to a Transfer Manager driver. The driver is
* Returns a pointer to a Transfer Manager driver. The driver is
* searched by its name.
* @return the TM driver for the Transfer Manager
*/
@ -207,11 +207,11 @@ private:
};
/**
* Function to execute the Manager action loop method within a new pthread
* Function to execute the Manager action loop method within a new pthread
* (requires C linkage)
*/
friend void * tm_action_loop(void *arg);
friend void * tm_action_loop(void *arg);
/**
* The action function executed when an action is triggered.
* @param action the name of the action
@ -222,20 +222,20 @@ private:
void * arg);
/**
* This function starts the prolog sequence
* This function starts the prolog sequence
*/
void prolog_action(int vid);
/**
* This function starts the prolog migration sequence
* This function starts the prolog migration sequence
*/
void prolog_migr_action(int vid);
/**
* This function starts the prolog resume sequence
* This function starts the prolog resume sequence
*/
void prolog_resume_action(int vid);
/**
* This function starts the epilog sequence
*/
@ -245,7 +245,7 @@ private:
* This function starts the epilog_stop sequence
*/
void epilog_stop_action(int vid);
/**
* This function starts the epilog_delete sequence
*/
@ -284,4 +284,3 @@ private:
};
#endif /*TRANSFER_MANAGER_H*/

View File

@ -422,11 +422,11 @@ void TransferManager::prolog_action(int vid)
continue;
}
rc = prolog_transfer_command(vm,
disk,
rc = prolog_transfer_command(vm,
disk,
vm_tm_mad,
opennebula_hostname,
xfr,
opennebula_hostname,
xfr,
os);
if ( rc != 0 )
{
@ -447,7 +447,7 @@ void TransferManager::prolog_action(int vid)
if ( context_result )
{
//CONTEXT tm_mad files hostname:remote_system_dir/disk.i vmid dsid(=0)
xfr << "CONTEXT "
xfr << "CONTEXT "
<< vm_tm_mad << " "
<< vm->get_context_file() << " ";
@ -456,10 +456,10 @@ void TransferManager::prolog_action(int vid)
xfr << files << " ";
}
xfr << vm->get_hostname() << ":"
xfr << vm->get_hostname() << ":"
<< vm->get_remote_system_dir() << "/disk." << num << " "
<< vm->get_oid() << " "
<< vm->get_ds_id()
<< vm->get_oid() << " "
<< vm->get_ds_id()
<< endl;
}
@ -592,21 +592,21 @@ void TransferManager::prolog_migr_action(int vid)
tm_mad = vm_tm_mad;
ds_id = vm_ds_id;
}
else
else
{
tm_mad = disk->vector_value("TM_MAD");
ds_id = disk->vector_value("DATASTORE_ID");
if ( tm_mad.empty() || ds_id.empty() )
{
continue;
continue;
}
}
//MV tm_mad prev_host:remote_system_dir/disk.i host:remote_system_dir/disk.i vmid dsid
xfr << "MV "
<< tm_mad << " "
<< vm->get_previous_hostname() << ":"
<< vm->get_previous_hostname() << ":"
<< vm->get_remote_system_dir() << "/disk." << disk_id << " "
<< vm->get_hostname() << ":"
<< vm->get_remote_system_dir() << "/disk." << disk_id << " "
@ -617,11 +617,11 @@ void TransferManager::prolog_migr_action(int vid)
//MV tm_mad prev_host:remote_system_dir host:remote_system_dir VMID 0
xfr << "MV "
<< vm_tm_mad << " "
<< vm->get_previous_hostname() << ":"
<< vm->get_previous_hostname() << ":"
<< vm->get_remote_system_dir() << " "
<< vm->get_hostname() << ":"
<< vm->get_hostname() << ":"
<< vm->get_remote_system_dir() << " "
<< vm->get_oid() << " "
<< vm->get_oid() << " "
<< vm_ds_id << endl;
xfr.close();
@ -731,21 +731,21 @@ void TransferManager::prolog_resume_action(int vid)
tm_mad = vm_tm_mad;
ds_id = vm_ds_id;
}
else
else
{
tm_mad = disk->vector_value("TM_MAD");
ds_id = disk->vector_value("DATASTORE_ID");
if ( tm_mad.empty() || ds_id.empty() )
{
continue;
continue;
}
}
//MV tm_mad fe:system_dir/disk.i host:remote_system_dir/disk.i vmid dsid
xfr << "MV "
<< tm_mad << " "
<< nd.get_nebula_hostname() << ":"
<< nd.get_nebula_hostname() << ":"
<< vm->get_system_dir() << "/disk." << disk_id << " "
<< vm->get_hostname() << ":"
<< vm->get_remote_system_dir() << "/disk." << disk_id << " "
@ -760,7 +760,7 @@ void TransferManager::prolog_resume_action(int vid)
<< vm->get_hostname() << ":" << vm->get_remote_system_dir()<< " "
<< vm->get_oid() << " "
<< vm_ds_id << endl;
xfr.close();
tm_md->transfer(vid,xfr_name);
@ -810,15 +810,15 @@ void TransferManager::epilog_transfer_command(
tm_mad = vm->get_tm_mad();
ds_id = vm->get_ds_id();
}
else
else
{
save = disk->vector_value("SAVE");
tm_mad = disk->vector_value("TM_MAD");
ds_id = disk->vector_value("DATASTORE_ID");
if ( save.empty() || ds_id.empty() || tm_mad.empty() )
{
return;
return;
}
}
@ -863,7 +863,7 @@ void TransferManager::epilog_transfer_command(
<< vm->get_hostname() << ":"
<< vm->get_remote_system_dir() << "/disk." << disk_index << " "
<< vm->get_oid() << " "
<< ds_id
<< ds_id
<< endl;
}
}
@ -940,12 +940,12 @@ void TransferManager::epilog_action(int vid)
}
//DELETE vm_tm_mad hostname:remote_system_dir vmid ds_id
xfr << "DELETE "
xfr << "DELETE "
<< vm_tm_mad << " "
<< vm->get_hostname() << ":" << vm->get_remote_system_dir() << " "
<< vm->get_oid() << " "
<< vm_ds_id << endl;
xfr.close();
tm_md->transfer(vid,xfr_name);
@ -1054,14 +1054,14 @@ void TransferManager::epilog_stop_action(int vid)
tm_mad = vm_tm_mad;
ds_id = vm_ds_id;
}
else
else
{
tm_mad = disk->vector_value("TM_MAD");
ds_id = disk->vector_value("DATASTORE_ID");
if ( tm_mad.empty() || ds_id.empty() )
{
continue;
continue;
}
}
@ -1070,7 +1070,7 @@ void TransferManager::epilog_stop_action(int vid)
<< tm_mad << " "
<< vm->get_hostname() << ":"
<< vm->get_remote_system_dir() << "/disk." << disk_id << " "
<< nd.get_nebula_hostname() << ":"
<< nd.get_nebula_hostname() << ":"
<< vm->get_system_dir() << "/disk." << disk_id << " "
<< vm->get_oid() << " "
<< ds_id << endl;
@ -1193,14 +1193,14 @@ void TransferManager::epilog_delete_action(bool local, int vid)
tm_mad = vm_tm_mad;
ds_id = vm_ds_id;
}
else
else
{
tm_mad = disk->vector_value("TM_MAD");
ds_id = disk->vector_value("DATASTORE_ID");
if ( tm_mad.empty() || ds_id.empty() )
{
continue;
continue;
}
}
@ -1265,7 +1265,7 @@ error_drivers:
error_file:
os.str("");
os << "epilog_delete, could not open file: " << xfr_name;
os << ". You may need to manually clean " << vm->get_hostname()
os << ". You may need to manually clean " << vm->get_hostname()
<< ":" << vm->get_remote_system_dir();
goto error_common;
@ -1355,14 +1355,14 @@ void TransferManager::epilog_delete_previous_action(int vid)
tm_mad = vm_tm_mad;
ds_id = vm_ds_id;
}
else
else
{
tm_mad = disk->vector_value("TM_MAD");
ds_id = disk->vector_value("DATASTORE_ID");
if ( tm_mad.empty() || ds_id.empty() )
{
continue;
continue;
}
}
@ -1376,12 +1376,12 @@ void TransferManager::epilog_delete_previous_action(int vid)
}
//DELTE vm_tm_mad prev_host:remote_system_dir vmid ds_id(=0)
xfr << "DELETE "
xfr << "DELETE "
<< vm_tm_mad << " "
<< vm->get_previous_hostname() <<":"<< vm->get_remote_system_dir()
<< " " << vm->get_oid() << " "
<< vm_ds_id << endl;
xfr.close();
tm_md->transfer(vid,xfr_name);
@ -1402,7 +1402,7 @@ error_drivers:
error_file:
os.str("");
os << "epilog_delete_previous, could not open file: " << xfr_name;
os << ". You may need to manually clean " << vm->get_previous_hostname()
os << ". You may need to manually clean " << vm->get_previous_hostname()
<< ":" << vm->get_remote_system_dir();
goto error_common;
@ -1447,7 +1447,7 @@ void TransferManager::driver_cancel_action(int vid)
// ------------------------------------------------------------------------
// Cancel the current operation
// ------------------------------------------------------------------------
tm_md->driver_cancel(vid);
vm->unlock();

View File

@ -23,7 +23,7 @@
# - dsid is the target datastore
# - template is the template of the VM in XML and base64 encoded
# To access the vm_template you can use the xpath.rb utility. Check the
# To access the vm_template you can use the xpath.rb utility. Check the
# datastore drivers for an example.
exit 0

View File

@ -23,7 +23,7 @@
# - dsid is the target datastore
# - template is the template of the VM in XML and base64 encoded
# To access the vm_template you can use the xpath.rb utility. Check the
# To access the vm_template you can use the xpath.rb utility. Check the
# datastore drivers for an example.
exit 0

View File

@ -350,7 +350,7 @@ string * VirtualMachineManager::format_message(
}
else
{
oss << "<DISK_TARGET_PATH/>";
oss << "<DISK_TARGET_PATH/>";
}
oss << tmpl

View File

@ -447,14 +447,14 @@ class ExecDriver < VirtualMachineDriver
pre << action.data[:tm_command] << " " << action.data[:vm]
post << action.data[:tm_command] << " " << action.data[:vm]
steps=[
# Execute a pre-migrate TM setup
{
:driver => :tm,
:action => :tm_premigrate,
:parameters => pre.split
},
},
# Execute pre-boot networking setup on migrating host
{
:driver => :vnm,
@ -485,7 +485,7 @@ class ExecDriver < VirtualMachineDriver
:action => :tm_postmigrate,
:parameters => post.split
#TODO :fail_action what to do here? cancel VM?
},
},
]
action.run(steps)