1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-20 10:50:08 +03:00

Feature #2212: IMAGE/FSTYPE and DISK/FORMAT now default to 'raw'

This commit is contained in:
Carlos Martín 2013-09-06 17:11:03 +02:00
parent 1b2df8e0fc
commit b892965041
2 changed files with 16 additions and 14 deletions

View File

@ -177,12 +177,17 @@ int Image::insert(SqlDB *db, string& error_str)
{
if ( source.empty() && path.empty() )
{
if (type != DATABLOCK)
{
goto error_no_path;
}
erase_template_attribute("FSTYPE", fs_type);
// DATABLOCK image needs FSTYPE
if (type != DATABLOCK || fs_type.empty())
if (fs_type.empty())
{
goto error_no_path;
fs_type = "raw";
}
}
else if ( !source.empty() && !path.empty() )
@ -210,15 +215,7 @@ error_type:
goto error_common;
error_no_path:
if ( type == DATABLOCK )
{
error_str = "A DATABLOCK type IMAGE has to declare a PATH, or both "
"SIZE and FSTYPE.";
}
else
{
error_str = "No PATH in template.";
}
error_str = "No PATH in template.";
goto error_common;
error_path_and_source:

View File

@ -284,10 +284,15 @@ int TransferManager::prolog_transfer_command(
size = disk->vector_value("SIZE");
format = disk->vector_value("FORMAT");
if ( size.empty() || format.empty() )
if (format.empty())
{
os << "No size or format in FS";
vm->log("TM", Log::WARNING, "No size or format in FS, skipping");
format = "raw";
}
if ( size.empty() )
{
os << "No size in FS";
vm->log("TM", Log::WARNING, "No size in FS, skipping");
return 0;
}