os-cmpi-xen
changeset 96:e717d287cf85
Implemented support for Reboot in Xen_ComputerSystem.RequestStateChange.
Support for reset already existed - added Reboot with same semantics.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
Support for reset already existed - added Reboot with same semantics.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
author | Jim Fehlig <jfehlig@novell.com> |
---|---|
date | Tue Mar 27 16:04:49 2007 -0600 (2007-03-27) |
parents | 549c7fdf185a |
children | c37b7ff52b4f |
files | ChangeLog src/Xen_ComputerSystem.c |
line diff
1.1 --- a/ChangeLog Wed Mar 21 10:43:12 2007 -0600 1.2 +++ b/ChangeLog Tue Mar 27 16:04:49 2007 -0600 1.3 @@ -1,3 +1,11 @@ 1.4 +------------------------------------------------------------------- 1.5 +Tue Mar 27 16:01:43 MDT 2007 - jfehlig@novell.com 1.6 + 1.7 + - Implemented support for Reboot in 1.8 + Xen_ComputerSystem.RequestStateChange. Support for 1.9 + reset already existed - added Reboot with same semantics. 1.10 + 1.11 + 1.12 ------------------------------------------------------------------- 1.13 Wed Mar 21 10:35:23 MDT 2007 - jfehlig@novell.com 1.14
2.1 --- a/src/Xen_ComputerSystem.c Wed Mar 21 10:43:12 2007 -0600 2.2 +++ b/src/Xen_ComputerSystem.c Tue Mar 27 16:04:49 2007 -0600 2.3 @@ -916,11 +916,15 @@ static CMPIStatus InvokeMethod( 2.4 rc = 4097; // "Invalid State Transition" 2.5 } 2.6 } 2.7 - else if (requestedState == 11) { /* 11 == Reset */ 2.8 - /* Can Reset only when in Active, Paused, or Suspended states. 2.9 - * Not sure what a Paused or Suspended domain looks like after 2.10 - * a reset. Need clarification in the Virtual System Profile. 2.11 - * For now we'll restrict this set to Active state only. 2.12 + /* 10 == Reboot and 11 == Reset 2.13 + * We'll treat these state transitions the same for now. 2.14 + */ 2.15 + else if (requestedState == 10 || requestedState == 11) { 2.16 + /* Can Reboot or Reset only when in Active, Paused, or Suspended 2.17 + * states. Not sure what a Paused or Suspended domain looks like 2.18 + * after a reboot or reset. Need clarification in the Virtual 2.19 + * System Profile. For now we'll restrict this set to Active 2.20 + * state only. 2.21 */ 2.22 if (resource->power_state == XEN_VM_POWER_STATE_RUNNING) { 2.23 if (!xen_vm_clean_reboot(session->xen, resource->handle)) { 2.24 @@ -931,8 +935,8 @@ static CMPIStatus InvokeMethod( 2.25 } 2.26 } 2.27 else { 2.28 - _SBLIM_TRACE(1, ("--- Domain is not active - unable to reset")); 2.29 - CMSetStatusWithChars(_BROKER, &status, CMPI_RC_ERR_FAILED, "Invalide state transition - VirtualSystem must be active to reset"); 2.30 + _SBLIM_TRACE(1, ("--- Domain is not active - unable to reboot")); 2.31 + CMSetStatusWithChars(_BROKER, &status, CMPI_RC_ERR_FAILED, "Invalide state transition - VirtualSystem must be active to reboot"); 2.32 rc = 4097; // "Invalid State Transition" 2.33 } 2.34 }