mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-15 17:23:10 +09:00
Feature #1612: Enforce correct format for DISK/SIZE
This commit is contained in:
1 parent
779d2d6dbc
commit
19acb3fd9b
2 files changed
+14
No files matched your search
@@ -357,6 +357,17 @@ int ImagePool::disk_attribute(int vm_id,
|
||||
return -1;
|
||||
}
|
||||
|
||||
int rc;
|
||||
long long size;
|
||||
|
||||
rc = disk->vector_value("SIZE", size);
|
||||
|
||||
if ( rc != 0 || size <= 0 )
|
||||
{
|
||||
error_str = "SIZE attribute must be a positive integer value.";
|
||||
return -1;
|
||||
}
|
||||
|
||||
img_type = Image::DATABLOCK;
|
||||
dev_prefix = disk->vector_value("DEV_PREFIX");
|
||||
|
||||
|
||||
@@ -1729,6 +1729,9 @@ int VirtualMachine::get_disk_images(string& error_str)
|
||||
}
|
||||
else
|
||||
{
|
||||
oss << "DISK " << i << ": " << error_str;
|
||||
error_str = oss.str();
|
||||
|
||||
goto error_common;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user