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

Changed XEN Driver to take ROOT as mandatory, no BOOT.

Updated examples, configuration and schema.

git-svn-id: http://svn.opennebula.org/trunk@45 3034c82b-c49b-4eb3-8279-a7acafdc01c0
This commit is contained in:
Constantino Vázquez Blanco 2008-07-09 17:24:01 +00:00
parent 58bc20f69f
commit 1410db8a4a
4 changed files with 17 additions and 16 deletions

View File

@ -7,5 +7,5 @@
# - memory
MEMORY = 128
OS = [ kernel="/vmlinuz", initrd="/initrd.img"]
OS = [ kernel="/vmlinuz", initrd="/initrd.img", root="sda1" ]
CREDIT = 256

View File

@ -23,11 +23,12 @@ MEMORY = "amount_of_requested_MEM" # Mandatory, XEN, KVM
#---------------------------------------
OS = [
kernel = "path_to_os_kernel", # Mandatory, default, XEN, KVM
initrd = "path_to_initrd_image", # Optional, default, XEN, KVM
kernel_cmd = "kernel_command_line", # Optional, default, KVM
boot = "device to boot from" ] # Mandatory, default, XEN, KVM
kernel = "path_to_os_kernel", # XEN: Mandatory,default. KVM: Optional
initrd = "path_to_initrd_image", # XEN: Mandatory,default. KVM: Optional
kernel_cmd = "kernel_command_line", # Optional, default, KVM
root = "device to be mounted as root" # XEN: Mandatory,default. KVM: Optional
boot = "device to boot from" ] # KVM: Mandatory,default XEN: Optional
#---------------------------------------
# Features of the hypervisor
#---------------------------------------

View File

@ -12,7 +12,7 @@ MEMORY = 128
OS = [
kernel = "/vmlinuz",
initrd = "/initrd.img",
boot = "sda1" ]
root = "sda1" ]
# --- 2 disks ---

View File

@ -39,7 +39,7 @@ int XenDriver::deployment_description(
string kernel = "";
string initrd = "";
string boot = "";
string root = "";
const VectorAttribute * disk;
@ -130,7 +130,7 @@ int XenDriver::deployment_description(
kernel = os->vector_value("KERNEL");
initrd = os->vector_value("INITRD");
boot = os->vector_value("BOOT");
root = os->vector_value("ROOT");
}
if ( kernel.empty() )
@ -143,9 +143,9 @@ int XenDriver::deployment_description(
get_default("OS","INITRD",initrd);
}
if ( boot.empty() )
if ( root.empty() )
{
get_default("OS","BOOT",boot);
get_default("OS","ROOT",root);
}
if ( kernel.empty() )
@ -157,13 +157,13 @@ int XenDriver::deployment_description(
file << "kernel = '" << kernel << "'" << endl;
}
if ( boot.empty() )
if ( root.empty() )
{
goto error_boot;
goto error_root;
}
else
{
file << "root = '/dev/" << boot << " ro'" << endl;
file << "root = '/dev/" << root << " ro'" << endl;
}
if ( !initrd.empty() )
@ -337,8 +337,8 @@ error_kernel:
file.close();
return -1;
error_boot:
vm->log("VMM", Log::ERROR, "No boot device defined and no default provided.");
error_root:
vm->log("VMM", Log::ERROR, "No root device defined and no default provided.");
file.close();
return -1;