[dts] [PATCH 2/2] framework/qemu_kvm: replace nc with socat for vm control by socket

Phil Yang phil.yang at arm.com
Tue May 15 12:06:19 CEST 2018


The nc process hang while connecting with unix domian socket.

The problem could be resolved by replacing it with socat tool.

Signed-off-by: Phil Yang <phil.yang at arm.com>
---
 framework/qemu_kvm.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/framework/qemu_kvm.py b/framework/qemu_kvm.py
index 57d16f6..354cb44 100644
--- a/framework/qemu_kvm.py
+++ b/framework/qemu_kvm.py
@@ -984,7 +984,7 @@ class QEMUKvm(VirtBase):
             if getattr(self, 'control_session', None) is None:
                 self.control_session = self.host_session
 
-                self.control_session.send_command("nc -U %s" % self.serial_path)
+                self.control_session.send_command("socat %s STDIO" % self.serial_path)
 
             # login message not ouput if timeout too small
             out = self.control_session.send_command("", timeout=15).replace('\r', '').replace('\n', '')
@@ -1717,7 +1717,7 @@ class QEMUKvm(VirtBase):
         """
         # return control_session to host_session
         if self.control_type == 'socket':
-            scan_cmd = "ps -e -o pid,cmd  |grep 'nc -U %s' |grep -v grep" % self.serial_path
+            scan_cmd = "ps -e -o pid,cmd  |grep 'socat %s STDIO' |grep -v grep" % self.serial_path
             out = self.host_dut.send_expect(scan_cmd, "#")
             proc_info = out.strip().split()
             try:
-- 
2.7.4



More information about the dts mailing list