bug #291: Number of DATABLOCKs than a VM can have is set to a maximum of 10

This commit is contained in:
Tino Vázquez committed 2010-08-04 13:05:13 +02:00
1 parent ca8effde6b
commit fc91d48210
1 file changed
+16 -2
+16 -2
View File
@@ -825,8 +825,9 @@ int VirtualMachine::get_disk_images()
ImagePool * ipool;
VectorAttribute * disk;
int n_os = 0;
int n_cd = 0;
int n_os = 0; // Number of OS images
int n_cd = 0; // Number of CDROMS
int n_db = 0; // Number of DATABLOCKS
string type;
ostringstream oss;
@@ -858,6 +859,9 @@ int VirtualMachine::get_disk_images()
case Image::CDROM:
n_cd++;
break;
case Image::DATABLOCK:
n_db++;
break;
default:
break;
}
@@ -871,6 +875,11 @@ int VirtualMachine::get_disk_images()
{
goto error_max_cd;
}
if( n_db > 10 ) // Max. number of DATABLOCK images is 10
{
goto error_max_db;
}
}
else if ( rc == -1 )
{
@@ -889,6 +898,11 @@ error_max_cd:
NebulaLog::log("ONE",Log::ERROR,
"VM can not use more than one CDROM image.");
goto error_common;
error_max_db:
NebulaLog::log("ONE",Log::ERROR,
"VM can not use more than 10 DATABLOCK images.");
goto error_common;
error_image:
NebulaLog::log("ONE",Log::ERROR, "Could not get disk image for VM");