# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1214428450 25200
# Node ID bd1ee412c6853d5fd005eca535b0b04446e08fb4
# Parent edf96787c23dc7a91a008916b4b00b22fc22703a
For pause, reboot, and enable add support for guests in the NOSTATE state.
It's possible that a XenFV guest might return no state instead of blocked or running.
When xend schedules to guest to run, the guest needs qemu to run (to handle device
emulation). If we get the state of the guest before qemu is done running its setup,
libvirt reports no state.
This should be a safe approach - we return an error if the guest is in some other state or
if libvirt is unable to successfully change the state of the guest.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r edf96787c23d -r bd1ee412c685 src/Virt_ComputerSystem.c
--- a/src/Virt_ComputerSystem.c Wed Jun 25 12:34:09 2008 -0700
+++ b/src/Virt_ComputerSystem.c Wed Jun 25 14:14:10 2008 -0700
@@ -733,6 +733,7 @@
switch (info->state) {
case VIR_DOMAIN_RUNNING:
case VIR_DOMAIN_BLOCKED:
+ case VIR_DOMAIN_NOSTATE:
CU_DEBUG("Pause domain");
ret = virDomainSuspend(dom);
break;
@@ -758,6 +759,7 @@
switch (info->state) {
case VIR_DOMAIN_RUNNING:
case VIR_DOMAIN_BLOCKED:
+ case VIR_DOMAIN_NOSTATE:
CU_DEBUG("Reboot domain");
ret = virDomainReboot(dom, 0);
break;
@@ -783,6 +785,7 @@
switch (info->state) {
case VIR_DOMAIN_RUNNING:
case VIR_DOMAIN_BLOCKED:
+ case VIR_DOMAIN_NOSTATE:
CU_DEBUG("Reset domain");
ret = domain_reset(dom);
break;