diff options
| author | Chris Behrens <cbehrens@codestud.com> | 2012-05-16 06:37:28 +0000 |
|---|---|---|
| committer | Chris Behrens <cbehrens@codestud.com> | 2012-05-16 06:37:28 +0000 |
| commit | a3a5f23487e9ca4257551fd3d430d8ebcfca131a (patch) | |
| tree | e81a29d621c22d243dc8fbbe40a427876fc60b1b /nova | |
| parent | 9c71fd6aef64acfc4c026b17e10d6075c03d037e (diff) | |
| download | nova-a3a5f23487e9ca4257551fd3d430d8ebcfca131a.tar.gz nova-a3a5f23487e9ca4257551fd3d430d8ebcfca131a.tar.xz nova-a3a5f23487e9ca4257551fd3d430d8ebcfca131a.zip | |
Remove XenAPI use of eventlet tpool
XenAPI implementation does not block, even with it using SSL, therefore
there's no need to use eventlet's tpool.
Change-Id: I33ef4140068c8af06d27a075f52379581790c647
Diffstat (limited to 'nova')
| -rw-r--r-- | nova/virt/xenapi/connection.py | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/nova/virt/xenapi/connection.py b/nova/virt/xenapi/connection.py index 5d28e25e3..35634ac11 100644 --- a/nova/virt/xenapi/connection.py +++ b/nova/virt/xenapi/connection.py @@ -18,12 +18,6 @@ """ A connection to XenServer or Xen Cloud Platform. -The concurrency model for this class is as follows: - -All XenAPI calls are on a green thread (using eventlet's "tpool" -thread pool). They are remote calls, and so may hang for the usual -reasons. - **Related Flags** :xenapi_connection_url: URL for connection to XenServer/Xen Cloud Platform. @@ -48,10 +42,8 @@ import time import urlparse import xmlrpclib -from eventlet import greenthread from eventlet import queue from eventlet import timeout -from eventlet import tpool from nova import context from nova import db @@ -589,8 +581,7 @@ class XenAPISession(object): def call_xenapi(self, method, *args): """Call the specified XenAPI method on a background thread.""" with self._get_session() as session: - f = session.xenapi_request - return tpool.execute(f, method, args) + return session.xenapi_request(method, args) def call_plugin(self, plugin, fn, args): """Call host.call_plugin on a background thread.""" @@ -605,7 +596,7 @@ class XenAPISession(object): args['host_uuid'] = self.host_uuid with self._get_session() as session: - return tpool.execute(self._unwrap_plugin_exceptions, + return self._unwrap_plugin_exceptions( session.xenapi.host.call_plugin, host, plugin, fn, args) @@ -624,6 +615,7 @@ class XenAPISession(object): exc.details[2] == 'Failure'): params = None try: + # FIXME(comstud): eval is evil. params = eval(exc.details[3]) except Exception: raise exc |
