# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1216757900 25200
# Node ID cc69139baaddfd14451940fc7bab9239be0edfcb
# Parent 695e6e7fb85f14e7e7685b94832b0fc73027e405
(#2) 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.
This can occur when the guest is active, but isn't running of the CPU or blocked
waiting for it.
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.
Updates:
-For the reboot and reset operations, add support for paused guests (per the VSP).
-If the guest returns VIR_DOMAIN_NOSTATE, the provider should return the value
CIM_STATE_ENABLED, not CIM_STATE_UNKNOWN.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 695e6e7fb85f -r cc69139baadd src/Virt_ComputerSystem.c
--- a/src/Virt_ComputerSystem.c Wed Jul 23 13:10:16 2008 -0700
+++ b/src/Virt_ComputerSystem.c Tue Jul 22 13:18:20 2008 -0700
@@ -139,7 +139,7 @@
static uint16_t state_lv_to_cim(const char lv_state)
{
if (lv_state == VIR_DOMAIN_NOSTATE)
- return CIM_STATE_UNKNOWN;
+ return CIM_STATE_ENABLED;
else if (lv_state == VIR_DOMAIN_RUNNING)
return CIM_STATE_ENABLED;
else if (lv_state == VIR_DOMAIN_BLOCKED)
@@ -780,6 +780,7 @@
switch (info->state) {
case VIR_DOMAIN_RUNNING:
case VIR_DOMAIN_BLOCKED:
+ case VIR_DOMAIN_NOSTATE:
CU_DEBUG("Pause domain");
ret = virDomainSuspend(dom);
break;
@@ -805,6 +806,8 @@
switch (info->state) {
case VIR_DOMAIN_RUNNING:
case VIR_DOMAIN_BLOCKED:
+ case VIR_DOMAIN_NOSTATE:
+ case VIR_DOMAIN_PAUSED:
CU_DEBUG("Reboot domain");
ret = virDomainReboot(dom, 0);
break;
@@ -830,6 +833,8 @@
switch (info->state) {
case VIR_DOMAIN_RUNNING:
case VIR_DOMAIN_BLOCKED:
+ case VIR_DOMAIN_NOSTATE:
+ case VIR_DOMAIN_PAUSED:
CU_DEBUG("Reset domain");
ret = domain_reset(dom);
break;
Show replies by date
KR> # HG changeset patch
KR> # User Kaitlin Rupert <karupert(a)us.ibm.com>
KR> # Date 1216757900 25200
KR> # Node ID cc69139baaddfd14451940fc7bab9239be0edfcb
KR> # Parent 695e6e7fb85f14e7e7685b94832b0fc73027e405
KR> (#2) For pause, reboot, and enable add support for guests in the
KR> NOSTATE state.
So, it looks to me that a KVM guest, when first defined, can have
NOSTATE, but imply offline. Xen's notion of NOSTATE seems to imply
being online. In my patch to domain_online() just now, I had to
account for those differences.
Perhaps something needs to change in this patch as well? For example,
if we're in NOSTATE, we allow running virDomainReboot(), but will that
function fail if it can't do a shutdown on the domain?
What about for suspend? I doubt libvirt will let you pause an offline
domain, so perhaps we should alter things a bit?
--
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms(a)us.ibm.com