john.levon@sun.com
2007-Jan-24 20:01 UTC
[Xen-devel] [PATCH] During suspend, return immediately with a failure if the domain will never
# HG changeset patch # User john.levon@sun.com # Date 1169670529 28800 # Node ID 14fb98867856742513b4241612889209925d2bd0 # Parent f546aae09c9e5ebc5b496642a86a2d2a5fd0f108 During suspend, return immediately with a failure if the domain will never suspend, instead of pointlessly retrying. Signed-off-by: John Levon <john.levon@sun.com> diff --git a/tools/libxc/xc_linux_save.c b/tools/libxc/xc_linux_save.c --- a/tools/libxc/xc_linux_save.c +++ b/tools/libxc/xc_linux_save.c @@ -378,8 +378,29 @@ static int suspend_and_state(int (*suspe ERROR("Could not get vcpu context"); - if (info->shutdown && info->shutdown_reason == SHUTDOWN_suspend) - return 0; // success + if (info->dying) { + ERROR("domain is dying"); + return -1; + } + + if (info->crashed) { + ERROR("domain has crashed"); + return -1; + } + + if (info->shutdown) { + switch (info->shutdown_reason) { + case SHUTDOWN_poweroff: + case SHUTDOWN_reboot: + ERROR("domain has shut down"); + return -1; + case SHUTDOWN_suspend: + return 0; + case SHUTDOWN_crash: + ERROR("domain has crashed"); + return -1; + } + } if (info->paused) { // try unpausing domain, wait, and retest @@ -393,7 +414,7 @@ static int suspend_and_state(int (*suspe if( ++i < 100 ) { - ERROR("Retry suspend domain."); + ERROR("Retry suspend domain"); usleep(10000); // 10ms goto retry; } _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
John Levon
2007-Jan-24 21:09 UTC
Re: [Xen-devel] [PATCH] During suspend, return immediately with a failure if the domain will never
On Wed, Jan 24, 2007 at 01:01:13PM -0700, john.levon@sun.com wrote:> During suspend, return immediately with a failure if the domain will never > suspend, instead of pointlessly retrying.This helps a little bit in transparency, but is still stuck due to xc_save/restore. I know this has been discussed before, but is there a good continuing reason for this not to be part of xend? I have never seen them actually crash as far as I remember. regards john _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel