qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

tests/acceptance: allow console interaction with specific VMs

Console interaction in avocado scripts was possible only with single
default VM.
This patch modifies the function parameters to allow passing a specific
VM as a parameter to interact with it.

Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <159073587933.20809.5122618715976660635.stgit@pasha-ThinkPad-X280>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

authored by

Pavel Dovgalyuk and committed by
Philippe Mathieu-Daudé
a5ba86d4 2c9120a2

+8 -5
+8 -5
tests/acceptance/avocado_qemu/__init__.py
··· 69 69 70 70 71 71 def _console_interaction(test, success_message, failure_message, 72 - send_string, keep_sending=False): 72 + send_string, keep_sending=False, vm=None): 73 73 assert not keep_sending or send_string 74 - console = test.vm.console_socket.makefile() 74 + if vm is None: 75 + vm = test.vm 76 + console = vm.console_socket.makefile() 75 77 console_logger = logging.getLogger('console') 76 78 while True: 77 79 if send_string: 78 - test.vm.console_socket.sendall(send_string.encode()) 80 + vm.console_socket.sendall(send_string.encode()) 79 81 if not keep_sending: 80 82 send_string = None # send only once 81 83 msg = console.readline().strip() ··· 115 117 _console_interaction(test, success_message, failure_message, 116 118 interrupt_string, True) 117 119 118 - def wait_for_console_pattern(test, success_message, failure_message=None): 120 + def wait_for_console_pattern(test, success_message, failure_message=None, 121 + vm=None): 119 122 """ 120 123 Waits for messages to appear on the console, while logging the content 121 124 ··· 125 128 :param success_message: if this message appears, test succeeds 126 129 :param failure_message: if this message appears, test fails 127 130 """ 128 - _console_interaction(test, success_message, failure_message, None) 131 + _console_interaction(test, success_message, failure_message, None, vm=vm) 129 132 130 133 def exec_command_and_wait_for_pattern(test, command, 131 134 success_message, failure_message=None):