From db0ac5ff995143992e306fe5246a2375473c8030 Mon Sep 17 00:00:00 2001 From: Matt Thompson Date: Wed, 12 Jun 2013 15:20:02 +0100 Subject: Check libvirt version earlier Running libvirt 0.8 causes an exception to be thrown before has_min_version() is run, resulting in no error message about version being logged. This change moves the version check before the libvirt calls are made. Change-Id: Ifaae18c6686d72fb79fc32081c4087084ae8bbb9 Fixes: bug #1190232 --- nova/virt/libvirt/driver.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'nova') diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index 91d5b1a50..387a1cf48 100755 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -548,9 +548,6 @@ class LibvirtDriver(driver.ComputeDriver): dispatch_thread = eventlet.spawn(self._dispatch_thread) def init_host(self, host): - libvirt.registerErrorHandler(libvirt_error_handler, None) - libvirt.virEventRegisterDefaultImpl() - if not self.has_min_version(MIN_LIBVIRT_VERSION): major = MIN_LIBVIRT_VERSION[0] minor = MIN_LIBVIRT_VERSION[1] @@ -559,6 +556,9 @@ class LibvirtDriver(driver.ComputeDriver): '%(major)i.%(minor)i.%(micro)i or greater.') % locals()) + libvirt.registerErrorHandler(libvirt_error_handler, None) + libvirt.virEventRegisterDefaultImpl() + self._init_events() def _get_connection(self): -- cgit