From: Dan Smith Subject: [PATCH] Fix vnet-create error checking and another stack dump Date: Thu, 03 Nov 2005 15:33:14 -0800 Message-ID: <87oe51johx.fsf@theine.beaverton.ibm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Xen Developers List-Id: xen-devel@lists.xenproject.org --=-=-= This patch adds a check to make sure the config file passed to vnet-create is correct. This is better than throwing IOError, because IOError's are currently reported as xend communication failures. Also, fix the IOError handling at the end of the file so we don't get a stack dump if that path is taken. Signed-off-by: Dan Smith --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=vnet_create_conf.patch diff -r 289b73a5ace7 tools/python/xen/xm/main.py --- a/tools/python/xen/xm/main.py Thu Nov 3 08:58:45 2005 +++ b/tools/python/xen/xm/main.py Thu Nov 3 15:28:41 2005 @@ -660,6 +660,10 @@ def xm_vnet_create(args): arg_check(args, 1, "vnet-create") conf = args[0] + if not os.access(conf, os.R_OK): + print "File not found: %s" % conf + sys.exit(1) + from xen.xend.XendClient import server server.xend_vnet_create(conf) @@ -794,7 +798,7 @@ except KeyboardInterrupt: print "Interrupted." sys.exit(1) - except IOError: + except IOError, ex: if os.geteuid() != 0: err("Most commands need root access. Please try again as root.") else: --=-=-= -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@us.ibm.com --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-=-=--