Skip to contentSkip to conversation

virt.virt_test_utils: Fix migration message

PATCH New Lucas Meneghel Rodrigues 1 participant 3 messages Aug 11, 2011 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 virt.virt_test_utils: Fix migration message

---
 client/virt/virt_test_utils.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
client/virt/virt_test_utils.py +1 -1
index 26407bc..cf718c4 100644
@@ -575,7 +575,7 @@ def run_autotest(vm, session, control_path, timeout, outputdir, params):
                 bg.start()
 
                 while bg.is_alive():
-                    logging.info("Tests is not ended, start a round of"
+                    logging.info("Autotest job did not end, start a round of "
                                  "migration")
                     vm.migrate(timeout=mig_timeout, protocol=mig_protocol)
             else:
Signature · 1 line
1.7.6
#1 lore raw

PATCH 2/3 KVM test: Omit debug printing from iozone_windows

---
 client/virt/tests/iozone_windows.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
client/virt/tests/iozone_windows.py +1 -1
index 4046106..b4779c6 100644
@@ -27,7 +27,7 @@ def run_iozone_windows(test, params, env):
     c = params.get("iozone_cmd")
     t = int(params.get("iozone_timeout"))
     logging.info("Running IOzone command on guest, timeout %ss", t)
-    results = session.cmd_output(cmd=c, timeout=t, print_func=logging.debug)
+    results = session.cmd_output(cmd=c, timeout=t)
     utils.open_write_close(results_path, results)
 
     # Postprocess the results using the IOzone postprocessing module
Signature · 1 line
1.7.6
#2 lore raw

PATCH 3/3 client.virt.kvm_monitor: Throw less cryptic exceptions

In reply to Lucas Meneghel Rodrigues

Sometimes, when the kvm monitor code tries to verify if there is data available on the monitor socket, a socket.error might be thrown, leading to somewhat cryptic error messages, such as:

raise error(EBADF, 'Bad file descriptor')
error: [Errno 9] Bad file descriptor

So, wrap the select operation on a try block and raise a more comprehensive MonitorSocketError, along with the original exception.

Also, turning the error into a MonitorError makes KVM autotest to not blow when trying to get a screendump from the VM during postprocessing.

---
 client/virt/kvm_monitor.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
client/virt/kvm_monitor.py +4 -1
index c96f062..7e6a055 100644
@@ -120,7 +120,10 @@ class Monitor:
 
     def _data_available(self, timeout=0):
         timeout = max(0, timeout)
-        return bool(select.select([self._socket], [], [], timeout)[0])
+        try:
+            return bool(select.select([self._socket], [], [], timeout)[0])
+        except socket.error, e:
+            raise MonitorSocketError("Verifying data on monitor socket", e)
 
 
     def _recvall(self):
Signature · 1 line
1.7.6