From: Dan Smith <danms@us.ibm.com>
To: Xen Developers <xen-devel@lists.xensource.com>
Subject: [PATCH][RESEND] Fix stale-state issue with 'xm dom{id, name}'
Date: Fri, 30 Sep 2005 09:54:55 -0700 [thread overview]
Message-ID: <87psqqh4ww.fsf@us.ibm.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 350 bytes --]
This is a resend of my stale state fix, which is yet unapplied. If
there are issues, please let me know.
Note that this fixes the issue poked by xm-test, as shown in the
following snippet of David's latest FC3pae.report:
> FAIL: 01_shutdown_basic_pos
> I had to run an xm list to update xend state!
Signed-off-by: Dan Smith <danms@us.ibm.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: domid_fix.patch --]
[-- Type: text/x-patch, Size: 2852 bytes --]
diff -r 9d047fb99e38 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py Fri Sep 30 16:37:52 2005
+++ b/tools/python/xen/xend/XendDomainInfo.py Fri Sep 30 09:47:51 2005
@@ -795,7 +795,7 @@
if not info:
info = dom_get(self.domid)
if not info:
- return
+ return False
self.info.update(info)
self.validateInfo()
@@ -803,6 +803,8 @@
log.debug("XendDomainInfo.update done on domain %d: %s", self.domid,
self.info)
+
+ return True
## private:
diff -r 9d047fb99e38 tools/python/xen/xend/server/SrvDomain.py
--- a/tools/python/xen/xend/server/SrvDomain.py Fri Sep 30 16:37:52 2005
+++ b/tools/python/xen/xend/server/SrvDomain.py Fri Sep 30 09:47:51 2005
@@ -21,6 +21,8 @@
from xen.xend import XendDomain
from xen.xend import PrettyPrint
from xen.xend.Args import FormFn
+from xen.xend.XendError import XendError
+from xen.xend.XendLogging import log
from xen.web.SrvDir import SrvDir
@@ -210,7 +212,9 @@
#
# if op and op[0] in ['vifs', 'vif', 'vbds', 'vbd', 'mem_target_set']:
# return self.perform(req)
- self.dom.update()
+ if not self.dom.update():
+ raise XendError("Domain %s no longer exists" % self.dom.getName())
+
if self.use_sxp(req):
req.setHeader("Content-Type", sxp.mime_type)
sxp.show(self.dom.sxpr(), out=req)
diff -r 9d047fb99e38 tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py Fri Sep 30 16:37:52 2005
+++ b/tools/python/xen/xm/main.py Fri Sep 30 09:47:51 2005
@@ -32,6 +32,7 @@
warnings.filterwarnings('ignore', category=FutureWarning)
from xen.xend import PrettyPrint
from xen.xend import sxp
+from xen.xend.XendClient import XendError
from xen.xm.opts import *
shorthelp = """Usage: xm <subcommand> [args]
Control, list, and manipulate Xen guest instances
@@ -385,14 +386,24 @@
name = args[0]
from xen.xend.XendClient import server
- dom = server.xend_domain(name)
+ try:
+ dom = server.xend_domain(name)
+ except XendError, e:
+ err("Unable to get info for domain %s" % name)
+ sys.exit(1)
+
print sxp.child_value(dom, 'domid')
def xm_domname(args):
name = args[0]
from xen.xend.XendClient import server
- dom = server.xend_domain(name)
+ try:
+ dom = server.xend_domain(name)
+ except XendError, e:
+ err("Unable to get info for domain %s" % name)
+ sys.exit(1)
+
print sxp.child_value(dom, 'name')
def xm_sched_bvt(args):
@@ -687,7 +698,6 @@
args = argv[2:]
if cmd:
try:
- from xen.xend.XendClient import XendError
rc = cmd(args)
if rc:
usage()
[-- Attachment #3: Type: text/plain, Size: 87 bytes --]
--
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms@us.ibm.com
[-- Attachment #4: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next reply other threads:[~2005-09-30 16:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-30 16:54 Dan Smith [this message]
2005-10-01 10:54 ` [PATCH][RESEND] Fix stale-state issue with 'xm dom{id, name}' Ewan Mellor
2005-10-01 15:33 ` Dan Smith
2005-10-01 19:40 ` Anthony Liguori
2005-10-04 7:36 ` Ewan Mellor
2005-10-04 13:41 ` Dan Smith
2005-10-04 17:35 ` Dan Smith
2005-10-04 23:14 ` Ewan Mellor
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=87psqqh4ww.fsf@us.ibm.com \
--to=danms@us.ibm.com \
--cc=xen-devel@lists.xensource.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.