mirror of
https://github.com/OpenNebula/one.git
synced 2025-02-12 21:57:23 +03:00
Fixed a bug in contextualization (#77)
tm_context was called even if context was not specified for the VM git-svn-id: http://svn.opennebula.org/one/trunk@450 3034c82b-c49b-4eb3-8279-a7acafdc01c0
This commit is contained in:
parent
0dfe0a58c8
commit
6aa658e1df
@ -191,6 +191,8 @@ void TransferManager::prolog_action(int vid)
|
|||||||
vector<const Attribute *> attrs;
|
vector<const Attribute *> attrs;
|
||||||
int num;
|
int num;
|
||||||
|
|
||||||
|
int context_result;
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
// Setup & Transfer script
|
// Setup & Transfer script
|
||||||
@ -312,20 +314,25 @@ void TransferManager::prolog_action(int vid)
|
|||||||
// Generate context file (There are 0...num-1 disks, constext is disk.num)
|
// Generate context file (There are 0...num-1 disks, constext is disk.num)
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
|
|
||||||
if ( vm->generate_context(files) != 0 )
|
context_result = vm->generate_context(files);
|
||||||
|
|
||||||
|
if ( context_result == -1 )
|
||||||
{
|
{
|
||||||
goto error_context;
|
goto error_context;
|
||||||
}
|
}
|
||||||
|
|
||||||
xfr << "CONTEXT " << vm->get_context_file() << " ";
|
if ( context_result )
|
||||||
|
|
||||||
if (!files.empty())
|
|
||||||
{
|
{
|
||||||
xfr << files << " ";
|
xfr << "CONTEXT " << vm->get_context_file() << " ";
|
||||||
}
|
|
||||||
|
|
||||||
xfr << vm->get_hostname() << ":" << vm->get_remote_dir()
|
if (!files.empty())
|
||||||
<< "/disk." << num << endl;
|
{
|
||||||
|
xfr << files << " ";
|
||||||
|
}
|
||||||
|
|
||||||
|
xfr << vm->get_hostname() << ":" << vm->get_remote_dir()
|
||||||
|
<< "/disk." << num << endl;
|
||||||
|
}
|
||||||
|
|
||||||
xfr.close();
|
xfr.close();
|
||||||
|
|
||||||
|
@ -686,7 +686,7 @@ int VirtualMachine::generate_context(string &files)
|
|||||||
|
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user