Close log files that are opened one time, such as the
ones opened for file transfers. This helps to reduce
even further the amount of files opened after a given
test job, specially if it involves a lot of file transfers.

With this patch, this test set:

./run -t qemu -g RHEL.6.3.x86_64 --nettype bridge --tests 
"migrate.with_autotest"

Comes from 94 files opened at the end to 43.

CC: Lei Yang <[email protected]>
Signed-off-by: Lucas Meneghel Rodrigues <[email protected]>
---
 virttest/virt_vm.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/virttest/virt_vm.py b/virttest/virt_vm.py
index 43d3bf2..02d601b 100644
--- a/virttest/virt_vm.py
+++ b/virttest/virt_vm.py
@@ -875,6 +875,7 @@ class BaseVM(object):
         remote.copy_files_to(address, client, username, password, port,
                                   host_path, guest_path, limit, log_filename,
                                   verbose, timeout)
+        utils_misc.close_log_file(log_filename)
 
 
     @error.context_aware
@@ -906,6 +907,7 @@ class BaseVM(object):
         remote.copy_files_from(address, client, username, password, port,
                                     guest_path, host_path, limit, log_filename,
                                     verbose, timeout)
+        utils_misc.close_log_file(log_filename)
 
 
     @error.context_aware
-- 
1.8.1.4

_______________________________________________
Virt-test-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virt-test-devel

Reply via email to