Skip to contentSkip to conversation

virt: Miscelaneous fixes

PATCH New Lucas Meneghel Rodrigues 1 participant 3 messages May 14, 2012 KVM

lore
Share & tools
lore
#0 lore raw

cover virt: Miscelaneous fixes

Here are some fixes found while working on kvm unittests and the multi_disk changes by Lukas.

Lucas Meneghel Rodrigues (2):
virt.kvm_installer: Don't fail a test if virtfs_proxy is not defined virt.virt_env_process: Reorganize screendump thread termination

 client/virt/kvm_installer.py    |    2 +-
 client/virt/virt_env_process.py |   11 ++++++-----
 2 files changed, 7 insertions(+), 6 deletions(-)
Signature · 1 line
1.7.10.1
#1 lore raw

PATCH 1/2 virt.kvm_installer: Don't fail a test if virtfs_proxy is not defined

This userspace program is not shipped on a regular qemu source code checkout, so its absence doesn't need to fail a test.

---
 client/virt/kvm_installer.py |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
client/virt/kvm_installer.py +1 -1
index a5c2747..b975f31 100644
@@ -209,7 +209,7 @@ class KVMBaseInstaller(base_installer.BaseInstaller):
         if qemu_fs_proxy_bin is not None:
             os.symlink(qemu_fs_proxy_bin, qemu_fs_proxy_dst)
         else:
-            raise error.TestError('Invalid qemu fs proxy path')
+            logging.warning('Qemu fs proxy path %s not found on source dir')
 
 
     def _install_phase_init(self):
Signature · 1 line
1.7.10.1
#2 lore raw

PATCH 2/2 virt.virt_env_process: Reorganize screendump thread termination

In reply to Lucas Meneghel Rodrigues

Simplify the check for screendump termination thread event, and also avoid a bug where we try to set a delay to a None object.

Fixes the following bug that happens when running the multi-disk test:

Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib64/python2.7/threading.py", line 551, in
__bootstrap_inner

     self.run()
   File "/usr/lib64/python2.7/threading.py", line 504, in run
     self.__target(*self.__args, **self.__kwargs)

File
"/home/lmr/Code/autotest.git/autotest/client/virt/virt_env_process.py", line 549, in _take_screendumps
_screendump_thread_termination_event.wait(delay)
AttributeError: 'NoneType' object has no attribute 'wait'

---
 client/virt/virt_env_process.py |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
client/virt/virt_env_process.py +6 -5
index 816e0f7..4f9e19f 100644
@@ -542,8 +542,9 @@ def _take_screendumps(test, params, env):
                 except NameError:
                     pass
             os.unlink(temp_filename)
-        if (_screendump_thread_termination_event is not None and
-            _screendump_thread_termination_event.isSet()):
-            _screendump_thread_termination_event = None
-            break
-        _screendump_thread_termination_event.wait(delay)
+
+        if _screendump_thread_termination_event is not None:
+            if _screendump_thread_termination_event.isSet():
+                _screendump_thread_termination_event = None
+                break
+            _screendump_thread_termination_event.wait(delay)
Signature · 1 line
1.7.10.1