WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] XenD: Check for device model if path is not specifie

To: "'xen-devel@xxxxxxxxxxxxxxxxxxx'" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] XenD: Check for device model if path is not specified (i.e. using auxbin path)
From: Michal Novotny <minovotn@xxxxxxxxxx>
Date: Tue, 30 Nov 2010 13:19:19 +0100
Delivery-date: Tue, 30 Nov 2010 04:19:56 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.12) Gecko/20101103 Fedora/1.0-0.33.b2pre.fc14 Thunderbird/3.1.6
Hi,
this is the patch to check for device model (in XendConfig.py) when the device_model had no path specified, i.e. XenD was trying to read the file on the auxbin path. Without this patch applied the meaningless python error "coercing to Unicode: need string or buffer, NoneType found" occurred:

[2010-11-30 13:56:47 5255] ERROR (xmlrpclib2:181) Internal error handling xend.domain.create
Traceback (most recent call last):
File "/usr/lib64/python2.4/site-packages/xen/util/xmlrpclib2.py", line 134, in _marshaled_dispatch
    response = self._dispatch(method, params)
  File "/usr/lib64/python2.4/SimpleXMLRPCServer.py", line 406, in _dispatch
    return func(*params)
File "/usr/lib64/python2.4/site-packages/xen/xend/server/XMLRPCServer.py", line 80, in domain_create
    info = XendDomain.instance().domain_create(config)
File "/usr/lib64/python2.4/site-packages/xen/xend/XendDomain.py", line 1001, in domain_create
    dominfo = XendDomainInfo.create(config)
File "/usr/lib64/python2.4/site-packages/xen/xend/XendDomainInfo.py", line 97, in create
    domconfig = XendConfig.XendConfig(sxp_obj = config)
File "/usr/lib64/python2.4/site-packages/xen/xend/XendConfig.py", line 367, in __init__
    self.validate()
File "/usr/lib64/python2.4/site-packages/xen/xend/XendConfig.py", line 558, in validate
    self._platform_sanity_check()
File "/usr/lib64/python2.4/site-packages/xen/xend/XendConfig.py", line 502, in _platform_sanity_check
    if not os.path.exists(self['platform']['device_model']):
  File "/usr/lib64/python2.4/posixpath.py", line 171, in exists
    st = os.stat(path)
TypeError: coercing to Unicode: need string or buffer, NoneType found

This patch raises VmError with message that no valid device model was specified if None type was found in the device_model specification.

It's been tested on non-existing device model where the message is being printed. If an invalid (but existing) device_model is set in the configuration file the domain was destroyed because it crashed. If there is a path specified (i.e. it's not using auxbin path) it bails with error that the device model was not found (which was already implemented there).

Michal

Signed-off-by: Michal Novotny <minovotn@xxxxxxxxxx>

--
Michal Novotny<minovotn@xxxxxxxxxx>, RHCE
Virtualization Team (xen userspace), Red Hat

Attachment: xen-check-for-device-model.patch
Description: Text Data

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] XenD: Check for device model if path is not specified (i.e. using auxbin path), Michal Novotny <=