[PATCH] For pause, reboot, and enable add support for guests in the NOSTATE state

# HG changeset patch # User Kaitlin Rupert <karupert@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@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;

@@ -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;
Looking at the VSP, it looks like we're supposed to support reboot from the following states: Active, Paused, Suspended. If there aren't any objections, I'll rework this patch to support that.
@@ -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;
Same story with reset. We should support Active, Paused, Suspended as valid from states. -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com

KR> Looking at the VSP, it looks like we're supposed to support reboot KR> from the following states: Active, Paused, Suspended. KR> If there aren't any objections, I'll rework this patch to support KR> that. KR> Same story with reset. We should support Active, Paused, KR> Suspended as valid from states. In order to do that, I think you'll need to first unpause the domain and then do a shutdown or reboot. I'm fine with it if it works well, and with the rest of the content of the patch. Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@us.ibm.com

+1 for me. Kaitlin Rupert wrote:
# HG changeset patch # User Kaitlin Rupert <karupert@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@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;
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim
participants (3)
-
Dan Smith
-
Deepti B Kalakeri
-
Kaitlin Rupert