From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0070.outbound.protection.outlook.com [104.47.1.70]) by dpdk.org (Postfix) with ESMTP id B8E561B694 for ; Wed, 16 May 2018 05:55:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yCvuyZnm4qZEXrN4r2xk+63Rr4ESF0DpgQeveQ0yq20=; b=f8tLGJUUcNtakh78PWoOs6nMBKsvMXAjVRrL1SkKIrR4sZvEUqEg/LupOvXkD46v3aqPBxSXLZ52dBwTBeVxSMB4ZL2Pestlnw3F+NGx22JBucJCwUIaznLTgrkT+UpFw9Gh7NWuAdRjaXj70L299QrjECdeZUnN0dDt2A3u6pk= Received: from AM4PR08MB0913.eurprd08.prod.outlook.com (10.166.133.135) by AM4PR08MB0802.eurprd08.prod.outlook.com (10.164.82.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.776.11; Wed, 16 May 2018 03:55:40 +0000 Received: from AM4PR08MB0913.eurprd08.prod.outlook.com ([fe80::f960:8c43:9979:cf18]) by AM4PR08MB0913.eurprd08.prod.outlook.com ([fe80::f960:8c43:9979:cf18%6]) with mapi id 15.20.0776.010; Wed, 16 May 2018 03:55:40 +0000 From: Phil Yang To: "Liu, Yong" , "dts@dpdk.org" CC: nd Thread-Topic: [PATCH 1/2] framework/qemu_kvm: fix vm control session failure Thread-Index: AQHT7DRxHg8HBSTsT0qKWCnspdgyH6QxlJOAgAAb3BA= Date: Wed, 16 May 2018 03:55:40 +0000 Message-ID: References: <1526378779-10530-1-git-send-email-phil.yang@arm.com> <86228AFD5BCD8E4EBFD2B90117B5E81E63041953@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <86228AFD5BCD8E4EBFD2B90117B5E81E63041953@SHSMSX103.ccr.corp.intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [113.29.88.7] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM4PR08MB0802; 7:ul8WX3jyJFZ+h4HO+m6KDgM/2OuWSUcf2M1kIWrE4zaZn8WUQM6S4POeA0bRy5CYJLfWGVBSjHUfOXYsVf4QckCurUk9rJjsm/ltcCuFQt0jofoS1ZwBhGwxVxf5NN6Br7y+kK5XMsrGwZHQ3A2Zyuz9L4AVMatd4U7JMYT5C4cTMYY4xy4+RZ6r0vU4SVnKqJ4BEZdSoNjnTv2x2o92vdkqYptGgmOVBm2voVtuuaTf3qqq2FX9UXgCXXR9ds6v x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(5600026)(48565401081)(2017052603328)(7153060)(7193020); SRVR:AM4PR08MB0802; x-ms-traffictypediagnostic: AM4PR08MB0802: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Phil.Yang@arm.com; nodisclaimer: True x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917)(265634631926514)(788757137089)(21532816269658)(228905959029699); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(3231254)(944501410)(52105095)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(6072148)(201708071742011); SRVR:AM4PR08MB0802; BCL:0; PCL:0; RULEID:; SRVR:AM4PR08MB0802; x-forefront-prvs: 0674DC6DD3 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(366004)(376002)(396003)(39860400002)(39380400002)(13464003)(199004)(189003)(5660300001)(6246003)(7736002)(305945005)(55016002)(4326008)(53936002)(81156014)(81166006)(3280700002)(9686003)(8676002)(66066001)(186003)(74316002)(229853002)(8936002)(3660700001)(551544002)(2906002)(97736004)(102836004)(55236004)(26005)(33656002)(6436002)(68736007)(105586002)(106356001)(6506007)(53546011)(59450400001)(7696005)(86362001)(25786009)(76176011)(99286004)(2900100001)(2501003)(478600001)(6116002)(3846002)(14454004)(11346002)(316002)(476003)(486006)(72206003)(110136005)(446003)(5250100002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR08MB0802; H:AM4PR08MB0913.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: LoXZx0hDyVyw5WS3wxSNKKFXO4FAr+NFz+U9GmsBwQkyETU6LZOs7dzzcfa02MY6T6F1Jteg9dQteD5wJgR1DdZFqTEJrBA3cgLGajI4B2uB5uEOPh2vopV9Qki7gycubqwvCt4sg/mTrNO3O0IcO8+eocpD3Bjd/LoFYzlQMlJbUXW32sITyoVj7MWBpgDB spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: f0b00a19-3c3a-495b-5097-08d5bae0e3e6 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: f0b00a19-3c3a-495b-5097-08d5bae0e3e6 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 May 2018 03:55:40.0674 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR08MB0802 Subject: Re: [dts] [PATCH 1/2] framework/qemu_kvm: fix vm control session failure X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 03:55:42 -0000 Hi Marvin, For telnet vm control I've encountered serial connection got no repose afte= r first time login failure. Below is the log. Please check it. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D m] Started Load/Save Random Seed.[\x1b[0;32m OK \x1b[0m] Started Apply Ke= rnel Variables.[\x1b[0;32m OK \x1b[0m] Mounted FUSE Control File System.[= \x1b[0;32m OK \x1b[0m] Mounted Kernel Configuration File System.[\x1b[0;3= 2m OK \x1b[0m] Started Create Static Device Nodes in /dev. Starti= ng udev Kernel Device Manager...[\x1b[0;32m OK \x1b[0m] Reached target Lo= cal File Systems (Pre).[\x1b[0;32m OK \x1b[0m] Started udev Kernel Device= Manager.[\x1b[0;32m OK \x1b[0m] Started Dispatch Password Requests to Co= nsole Directory Watch.[\x1b[0;32m OK \x1b[0m] Reached target Local Encryp= ted Volumes.[\x1b[0;32m OK \x1b[0m] Activated swap /swapfile.[\x1b[0;32m = OK \x1b[0m] Reached target Swap.[\x1b[0;32m OK \x1b[0m] Started Flush J= ournal to Persistent Storage." (Pdb) c [10.169.40.174:vm0] not ready for login dut.10.169.40.174: Can't login [vm0] on [10.169.40.174], retry= 1 times!!! dut.10.169.40.174: lsof -i:7002 | grep telnet | awk '{print $2= }' Exception happened in [lsof -i:7002 | grep telnet | awk '{print $2}'] and o= utput is [lsof -i:7002 | grep telnet | awk '{print $2}' Command not found] Traceback (most recent call last): File "/root/dpdk-dts/framework/virt_base.py", line 284, in start self._start_vm() File "/root/dpdk-dts/framework/qemu_kvm.py", line 1269, in _start_vm self.__wait_vm_ready() TimeoutException: TIMEOUT on lsof -i:7002 | grep telnet | awk '{print $2}' Unhandled expection TestVhostPmdXstats: Failure for Set up VM ENV failed =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D So I added a delay to flush the useless output. Which can resolve this issu= e. BTW, only telnet connection has this defect. This fix is kind of workaround= , but It works. Thanks, Phil Yang > -----Original Message----- > From: Liu, Yong > Sent: Wednesday, May 16, 2018 9:38 AM > To: Phil Yang ; dts@dpdk.org > Cc: nd > Subject: RE: [PATCH 1/2] framework/qemu_kvm: fix vm control session failu= re >=20 > Thanks, Phil. I'm fine with the changes, just one question about the issu= e you > met. > Qemu module should has taken care of the problem that VM maybe can't logi= n > for the first time. > If login action can't be done continuously, I think there may be some kin= d of > issue here. > Could you please check the output of serial session? It may help us to fi= gure out > the problem. >=20 > Regards, > Marvin >=20 > > -----Original Message----- > > From: phil.yang@arm.com [mailto:phil.yang@arm.com] > > Sent: Tuesday, May 15, 2018 6:06 PM > > To: dts@dpdk.org > > Cc: nd@arm.com; phil.yang@arm.com; Liu, Yong > > Subject: [PATCH 1/2] framework/qemu_kvm: fix vm control session > > failure > > > > For telnet vm control, it will continuously fail to login to vm when > > it doesn't read login prompt during first time connection. So extend > > the connection time to get more output each time. > > > > For socket vm control, added LOGIN_PROMPT into the login status check > > for other platform. > > Keep the connection longer to avoid failure and reconnection. > > > > Signed-off-by: Phil Yang > > --- > > framework/qemu_kvm.py | 11 ++++++----- > > 1 file changed, 6 insertions(+), 5 deletions(-) > > > > diff --git a/framework/qemu_kvm.py b/framework/qemu_kvm.py index > > ec33669..57d16f6 100644 > > --- a/framework/qemu_kvm.py > > +++ b/framework/qemu_kvm.py > > @@ -979,7 +979,7 @@ class QEMUKvm(VirtBase): > > Connect to serial port and return connected session for usage > > if connected failed will return None > > """ > > - shell_reg =3D r"(\s*)\[(.*)\]# " > > + shell_reg =3D r"(.*)# " > > try: > > if getattr(self, 'control_session', None) is None: > > self.control_session =3D self.host_session @@ -987,7 > > +987,7 @@ class QEMUKvm(VirtBase): > > self.control_session.send_command("nc -U %s" % > > self.serial_path) > > > > # login message not ouput if timeout too small > > - out =3D self.control_session.send_command("", > > timeout=3D5).replace('\r', '').replace('\n', '') > > + out =3D self.control_session.send_command("", > > timeout=3D15).replace('\r', '').replace('\n', '') > > > > if len(out) =3D=3D 0: > > raise StartVMFailedException("Can't get output from > > [%s:%s]" % (self.host_dut.crb['My IP'], self.vm_name)) @@ -1025,7 > > +1025,7 @@ class QEMUKvm(VirtBase): > > Connect to serial port and return connected session for usage > > if connected failed will return None > > """ > > - shell_reg =3D r"(\s*)\[(.*)\]# " > > + shell_reg =3D r"(.*)# " > > scan_cmd =3D "lsof -i:%d | grep telnet | awk '{print $2}'" % > > self.serial_port > > > > try: > > @@ -1034,9 +1034,10 @@ class QEMUKvm(VirtBase): > > self.control_session =3D self.host_session > > > > self.control_session.send_expect("telnet localhost > > %d" % self.serial_port, "Connected to localhost", > > timeout=3Dself.OPERATION_TIMEOUT) > > + time.sleep(5) > > > > # output will be empty if timeout too small > > - out =3D self.control_session.send_command("", > > timeout=3D5).replace('\r', '').replace('\n', '') > > + out =3D self.control_session.send_command("", > > timeout=3D10).replace('\r', '').replace('\n', '') > > > > # if no output from serial port, either connection close > > or system hang > > if len(out) =3D=3D 0: > > @@ -1058,7 +1059,7 @@ class QEMUKvm(VirtBase): > > return True > > > > # login into Redhat os, not sure can work on all > > distributions > > - if "x86_64 on an x86_64" not in out: > > + if ("x86_64 on an x86_64" not in out) and > > + (self.LOGIN_PROMPT > > not in out): > > print RED("[%s:%s] not ready for login" % > > (self.host_dut.crb['My IP'], self.vm_name)) > > return False > > else: > > -- > > 2.7.4