virt-test icon indicating copy to clipboard operation
virt-test copied to clipboard

virt-test: Distinguish debug output from src/dest qemus in debug.log

Open dagrh opened this issue 11 years ago • 2 comments

I'm debugging migrations, and the deubg.log contains a mix of the debug output from the two qemus. It gets a bit messy to pick the debug from the two sides of the argument out.

The attached (very lightly tested) patch changes the prefix for the destination side; so it has

[qemu/dst output] instead of [qemu output]

Author: Dr. David Alan Gilbert [email protected] Date: Fri Jan 10 11:34:51 2014 +0000

Prefix qemu output differently for destination
diff --git a/virttest/qemu_vm.py b/virttest/qemu_vm.py
index cd92589..035797c 100644
--- a/virttest/qemu_vm.py
+++ b/virttest/qemu_vm.py
@@ -1978,6 +1978,9 @@ class VM(virt_vm.BaseVM):
                                            'Check the log for traceback.')

             # Add migration parameters if required
+            qemu_op_prefix = "qemu"
+            if migration_mode != None:
+                qemu_op_prefix += "/dst"
             if migration_mode in ["tcp", "rdma", "x-rdma"]:
                 self.migration_port = utils_misc.find_free_port(5200, 6000)
                 qemu_command += (" -incoming " + migration_mode +
@@ -2030,7 +2033,7 @@ class VM(virt_vm.BaseVM):
                 self.process = aexpect.run_tail(qemu_command,
                                                 None,
                                                 logging.info,
-                                                "[qemu output] ",
+                                                "["+qemu_op_prefix+" output] ",
                                                 auto_close=False)

             logging.info("Created qemu process with parent PID %d",

dagrh avatar Jan 10 '14 12:01 dagrh

Maybe the instance could be appended to [qemu output], rather than /dst. In case of multiple ping-pong migrations, there will be many /dst VMs, making the distinction not helpful.

lmr avatar Jan 13 '14 11:01 lmr

I tried using the self.name in that same create method which I think should give the opportunity for things to provide a meaningful name; unfortunately at the moment for migration both halves get 'virt-tests-vm1' in the simple migration cases I'm working with, I don't know if ping-pong is more useful on that.

dagrh avatar Jan 13 '14 12:01 dagrh