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

Merge branch 'feature-1791' of git.opennebula.org:one into feature-1791

This commit is contained in:
Jaime Melis 2013-03-08 16:03:59 +01:00
commit d004f4277a
8 changed files with 36 additions and 16 deletions

View File

@ -108,7 +108,10 @@
BOOT_STOPPED = 22,
CLEANUP_DELETE = 23,
HOTPLUG_SNAPSHOT = 24,
HOTPLUG_NIC = 25
HOTPLUG_NIC = 25,
HOTPLUG_SAVEAS = 26,
HOTPLUG_SAVEAS_POWEROFF = 27,
HOTPLUG_SAVEAS_SUSPENDED = 28
-->
<xs:element name="LCM_STATE" type="xs:integer"/>
<xs:element name="RESCHED" type="xs:integer"/>

View File

@ -70,7 +70,10 @@
BOOT_STOPPED = 22,
CLEANUP_DELETE = 23,
HOTPLUG_SNAPSHOT = 24,
HOTPLUG_NIC = 25
HOTPLUG_NIC = 25,
HOTPLUG_SAVEAS = 26,
HOTPLUG_SAVEAS_POWEROFF = 27,
HOTPLUG_SAVEAS_SUSPENDED = 28
-->
<xs:element name="LCM_STATE" type="xs:integer"/>
<xs:element name="RESCHED" type="xs:integer"/>

View File

@ -79,7 +79,7 @@ int Document::insert(SqlDB *db, string& error_str)
// Check default attributes
// ---------------------------------------------------------------------
get_template_attribute("NAME", name);
erase_template_attribute("NAME", name);
if ( name.empty() == true )
{
@ -199,8 +199,8 @@ string& Document::to_xml(string& xml) const
<< "<ID>" << oid << "</ID>"
<< "<UID>" << uid << "</UID>"
<< "<GID>" << gid << "</GID>"
<< "<UNAME>" << uname << "</UNAME>"
<< "<GNAME>" << gname << "</GNAME>"
<< "<UNAME>" << uname << "</UNAME>"
<< "<GNAME>" << gname << "</GNAME>"
<< "<NAME>" << name << "</NAME>"
<< "<TYPE>" << type << "</TYPE>"
<< perms_to_xml(perm_str)

View File

@ -96,7 +96,10 @@ public class VirtualMachine extends PoolElement{
"BOOT_STOPPED",
"CLEANUP_DELETE",
"HOTPLUG_SNAPSHOT",
"HOTPLUG_NIC" };
"HOTPLUG_NIC",
"HOTPLUG_SAVEAS",
"HOTPLUG_SAVEAS_POWEROFF",
"HOTPLUG_SAVEAS_SUSPENDED" };
private static final String[] SHORT_LCM_STATES =
{
@ -124,7 +127,11 @@ public class VirtualMachine extends PoolElement{
"boot",
"boot",
"clea",
"snap" };
"snap",
"hotp",
"hotp",
"hotp",
"hotp" };
/**
* Creates a new VM representation.
@ -468,9 +475,9 @@ public class VirtualMachine extends PoolElement{
* @param imageName Name of the new Image that will be created.
* @return If an error occurs the error message contains the reason.
*/
public OneResponse savedisk(int diskId, String imageName)
public OneResponse savedisk(int diskId, String imageName, boolean hot = false)
{
return savedisk(diskId, imageName, "");
return savedisk(diskId, imageName, "", hot);
}
/**
@ -481,11 +488,13 @@ public class VirtualMachine extends PoolElement{
* @param imageName Name of the new Image that will be created.
* @param imageType Type of the new image. Set to empty string to use
* the default type
* @param hot do not defer saveas operation
* @return If an error occurs the error message contains the reason.
*/
public OneResponse savedisk(int diskId, String imageName, String imageType)
public OneResponse savedisk(int diskId, String imageName, String imageType,
boolean hot)
{
return client.call(SAVEDISK, id ,diskId, imageName, imageType);
return client.call(SAVEDISK, id ,diskId, imageName, imageType, hot);
}
/**

View File

@ -104,7 +104,10 @@ var oZones = {
"BOOT_STOPPED",
"CLEANUP_DELETE",
"HOTPLUG_SNAPSHOT",
"HOTPLUG_NIC"][value]);
"HOTPLUG_NIC",
"HOTPLUG_SAVEAS",
"HOTPLUG_SAVEAS_POWEROFF",
"HOTPLUG_SAVEAS_SUSPENDED"][value]);
break;
case "IMAGE":
case "image":

View File

@ -112,7 +112,10 @@ var OpenNebula = {
"BOOT_STOPPED",
"CLEANUP_DELETE",
"HOTPLUG_SNAPSHOT",
"HOTPLUG_NIC"][value]);
"HOTPLUG_NIC",
"HOTPLUG_SAVEAS",
"HOTPLUG_SAVEAS_POWEROFF",
"HOTPLUG_SAVEAS_SUSPENDED"][value]);
break;
case "IMAGE":
case "image":

View File

@ -49,8 +49,7 @@ var vm_graphs = [
}
];
var VNCstates=["RUNNING","SHUTDOWN","SHUTDOWN_POWEROFF","UNKNOWN","HOTPLUG","CANCEL","MIGRATE", "HOTPLUG_SNAPSHOT", "HOTPLUG_NIC"];
var VNCstates=["RUNNING","SHUTDOWN","SHUTDOWN_POWEROFF","UNKNOWN","HOTPLUG","CANCEL","MIGRATE", "HOTPLUG_SNAPSHOT", "HOTPLUG_NIC", "HOTPLUG_SAVEAS", "HOTPLUG_SAVEAS_POWEROFF", "HOTPLUG_SAVEAS_SUSPENDED"];
//Permanent storage for last value of aggregated network usage
//Used to calculate bandwidth

View File

@ -81,7 +81,7 @@ int VMTemplate::insert(SqlDB *db, string& error_str)
// Check default attributes
// ---------------------------------------------------------------------
get_template_attribute("NAME", name);
erase_template_attribute("NAME", name);
if ( name.empty() == true )
{