[Libvirt-cim] [PATCH] Make CS.RequestStateChange() agree to proceed if RUNNING|BLOCKED

Dan Smith danms at us.ibm.com
Tue Jan 22 17:23:37 UTC 2008


# HG changeset patch
# User Dan Smith <danms at us.ibm.com>
# Date 1201026051 28800
# Node ID c92db5f8d2b108163d75b32f906c7b55fa4f2854
# Parent  335e7862efa1f3cffce393e684179ec6cc8ee4a4
Make CS.RequestStateChange() agree to proceed if RUNNING|BLOCKED

This is an interesting Xen quirk propagated through libvirt.  For the
most part, RUNNING and BLOCKED are the same thing to us.

Signed-off-by: Dan Smith <danms at us.ibm.com>

diff -r 335e7862efa1 -r c92db5f8d2b1 src/Virt_ComputerSystem.c
--- a/src/Virt_ComputerSystem.c	Fri Jan 18 09:14:17 2008 -0800
+++ b/src/Virt_ComputerSystem.c	Tue Jan 22 10:20:51 2008 -0800
@@ -512,6 +512,7 @@ static CMPIStatus state_change_disable(v
 
         switch (info->state) {
         case VIR_DOMAIN_RUNNING:
+        case VIR_DOMAIN_BLOCKED:
                 CU_DEBUG("Stop domain");
                 ret = virDomainShutdown(dom);
                 break;
@@ -537,6 +538,7 @@ static CMPIStatus state_change_pause(vir
 
         switch (info->state) {
         case VIR_DOMAIN_RUNNING:
+        case VIR_DOMAIN_BLOCKED:
                 CU_DEBUG("Pause domain");
                 ret = virDomainSuspend(dom);
                 break;
@@ -561,6 +563,7 @@ static CMPIStatus state_change_reboot(vi
 
         switch (info->state) {
         case VIR_DOMAIN_RUNNING:
+        case VIR_DOMAIN_BLOCKED:
                 CU_DEBUG("Reboot domain");
                 ret = virDomainReboot(dom, 0);
                 break;
@@ -585,6 +588,7 @@ static CMPIStatus state_change_reset(vir
 
         switch (info->state) {
         case VIR_DOMAIN_RUNNING:
+        case VIR_DOMAIN_BLOCKED:
                 CU_DEBUG("Reset domain");
                 ret = domain_reset(dom);
                 break;




More information about the Libvirt-cim mailing list