xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Joe Jin <joe.jin@oracle.com>
To: Matt Wilson <msw@amazon.com>, Keir Fraser <keir@xen.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Cc: chuang cao <chuang.cao@oracle.com>, Joe Jin <joe.jin@oracle.com>,
	Sureshmon Nair <sureshmon.nair@oracle.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: [PATCH] Xend: handle died domain in getVCPUInfo()
Date: Tue, 10 Dec 2013 17:04:47 +0800	[thread overview]
Message-ID: <52A6D92F.6020600@oracle.com> (raw)

When created new guest on NUMA server, xend tried to get the best node
by calculated all vcpus info, if domain already be terminated then
getVCPUInfo() will throw below exception and guest start failed:

[2013-09-04 20:01:26 6254] ERROR (XendDomainInfo:496) VM start failed
Traceback (most recent call last):
  File "/usr/lib64/python2.4/site-packages/xen/xend/XendDomainInfo.py", line 482, in start
    XendTask.log_progress(31, 60, self._initDomain)
  File "/usr/lib64/python2.4/site-packages/xen/xend/XendTask.py", line 209, in log_progress
    retval = func(*args, **kwds)
  File "/usr/lib64/python2.4/site-packages/xen/xend/XendDomainInfo.py", line 2918, in _initDomain
    node = self._setCPUAffinity()
  File "/usr/lib64/python2.4/site-packages/xen/xend/XendDomainInfo.py", line 2835, in _setCPUAffinity
    best_node = find_relaxed_node(candidate_node_list)[0]
  File "/usr/lib64/python2.4/site-packages/xen/xend/XendDomainInfo.py", line 2803, in find_relaxed_node
    cpuinfo = dom.getVCPUInfo()
  File "/usr/lib64/python2.4/site-packages/xen/xend/XendDomainInfo.py", line 1600, in getVCPUInfo
    raise XendError(str(exn))
XendError: (3, 'No such process')

This patch will check return value of xc.vcpu_getinfo() and make sure the
error not caused by domain died before throw the exception.

Signed-off-by: Joe Jin <joe.jin@oracle.com>
Cc: Matt Wilson <msw@amazon.com>
Cc: Keir Fraser <keir@xen.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Roger Pau Monne <roger.pau@citrix.com>
---
 tools/python/xen/xend/XendDomainInfo.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py
index e9d3e7e..8d4ff5c 100644
--- a/tools/python/xen/xend/XendDomainInfo.py
+++ b/tools/python/xen/xend/XendDomainInfo.py
@@ -35,8 +35,10 @@ import stat
 import shutil
 import traceback
 from types import StringTypes
+import errno
 
 import xen.lowlevel.xc
+from xen.lowlevel.xc import Error as XCError
 from xen.util import asserts, auxbin, mkdir
 from xen.util.blkif import parse_uname
 import xen.util.xsm.xsm as security
@@ -1540,7 +1542,10 @@ class XendDomainInfo:
 
             return sxpr
 
-        except RuntimeError, exn:
+        except XCError, exn:
+            # Domain already died.
+            if exn.args[0] == errno.ESRCH:
+                return sxpr
             raise XendError(str(exn))
 
 
-- 
1.7.1

             reply	other threads:[~2013-12-10  9:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-10  9:04 Joe Jin [this message]
2013-12-15 21:33 ` [PATCH] Xend: handle died domain in getVCPUInfo() Matt Wilson
2013-12-16 16:42   ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52A6D92F.6020600@oracle.com \
    --to=joe.jin@oracle.com \
    --cc=chuang.cao@oracle.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=keir@xen.org \
    --cc=konrad.wilk@oracle.com \
    --cc=msw@amazon.com \
    --cc=roger.pau@citrix.com \
    --cc=sureshmon.nair@oracle.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).