From nobody Mon Feb 9 17:24:05 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1513790968399358.9294076809433; Wed, 20 Dec 2017 09:29:28 -0800 (PST) Received: from localhost ([::1]:60403 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRiBF-0007Uw-FW for importer@patchew.org; Wed, 20 Dec 2017 12:29:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56326) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRhyG-0004Yp-B6 for qemu-devel@nongnu.org; Wed, 20 Dec 2017 12:15:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRhyF-0007C9-39 for qemu-devel@nongnu.org; Wed, 20 Dec 2017 12:15:56 -0500 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:42349) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eRhyE-0007Bt-SH for qemu-devel@nongnu.org; Wed, 20 Dec 2017 12:15:55 -0500 Received: by mail-wm0-x244.google.com with SMTP id b199so11343496wme.1 for ; Wed, 20 Dec 2017 09:15:54 -0800 (PST) Received: from 640k.lan (dynamic-adsl-78-12-251-125.clienti.tiscali.it. [78.12.251.125]) by smtp.gmail.com with ESMTPSA id f125sm2751101wme.45.2017.12.20.09.15.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Dec 2017 09:15:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Hoj19C8S1lyR9ziZ3omWYJf7/MGKwsfCxM6/WjQnmXg=; b=Rv3cklmwgvWEH2q5UmvLIKNEBPg3u1XwDrXxwU7C8tl4wP2Qnugp1DFzLUBoFdKLL9 d5wzV8XJLlNIGUhHXcnF7XFICFqCn8FabJ2dWDMrrP9y/xVt8jbEpc4hcNNbDr7KFZK6 5gIT5UX/FR+ELa4aRJXJs75C/m7ZHSegccCb2WT0V+gBf4zq7ZOGhS4JqRPKq8MBCQ9g krZXit2hsgj3+hdV2kzaA74vXkCp0iLCQ3qYoXYs4OVLfHV2dAKv3ax0R9f6bV0hatC5 w1wYAM+NROIW7onT4MCAo6cN45OIwgfoqb/qaLY9IZL1RH+3JzcNSa/KK3s7JjRm5/mS gfBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=Hoj19C8S1lyR9ziZ3omWYJf7/MGKwsfCxM6/WjQnmXg=; b=NlvnAQiUbpB/fmtL7aQZtcUYSGglOBexcT0Gqpu7alAOTixQxxqSX43RzAmkD89MxN W1KCV0xZngcZLEU0I24vudCn3i++Wx+q9r2oqXjJdpeSw3cfD0FbpIJWNjzD35t4u8MI fAYxDNRCJr8Trsy/k2muMNNVGMqdjc0X8yGK3okeypzTreWoU8r36LeTtezev79hq7Xm FqJWusgW64WUJhecXoVSh1zXyOGedwXJ0x4Aaz+ItxgXlOOskGjBRUGNDAHpUWGe9+FH 7bpnS0vBmAVtLMUx0OMt9r8fiZLVtiLfvoXEghfwcc/hilvEB6AHlCo12bJIXkCfix1s mW1w== X-Gm-Message-State: AKGB3mIbHZvtWSOvM60Fu0fD8JlabA9nJEUMfUqgQRqOSbdS/MkXboZe cteL1re+0+prE8z7z9xg5OUwCOUj X-Google-Smtp-Source: ACJfBovajlRK58eL9ecVKPBcjZpm4VLASWxGzOOUxIX2JRC+4mQ05QvbuDInvwhl0I8o9fDIplERww== X-Received: by 10.28.55.72 with SMTP id e69mr6931114wma.154.1513790153578; Wed, 20 Dec 2017 09:15:53 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 20 Dec 2017 18:14:30 +0100 Message-Id: <1513790098-9815-19-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1513790098-9815-1-git-send-email-pbonzini@redhat.com> References: <1513790098-9815-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PULL 18/46] tests/boot-serial-test: Make sure that we check the timeout regularly X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Thomas Huth If the guest continuesly writes characters to the UART, we never leave the inner while loop and thus never check whether we've reached the timeout value. So if we fail to find the expected string in the UART output, the test just hangs and never finishs. Use a counter to regularly break out of the while loop to check the timeout. Signed-off-by: Thomas Huth Message-Id: <1512031988-32490-2-git-send-email-thuth@redhat.com> Signed-off-by: Paolo Bonzini --- tests/boot-serial-test.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/boot-serial-test.c b/tests/boot-serial-test.c index c935d69..fa4183d 100644 --- a/tests/boot-serial-test.c +++ b/tests/boot-serial-test.c @@ -43,12 +43,13 @@ static testdef_t tests[] =3D { static void check_guest_output(const testdef_t *test, int fd) { bool output_ok =3D false; - int i, nbr, pos =3D 0; + int i, nbr, pos =3D 0, ccnt; char ch; =20 /* Poll serial output... Wait at most 60 seconds */ for (i =3D 0; i < 6000; ++i) { - while ((nbr =3D read(fd, &ch, 1)) =3D=3D 1) { + ccnt =3D 0; + while ((nbr =3D read(fd, &ch, 1)) =3D=3D 1 && ccnt++ < 512) { if (ch =3D=3D test->expect[pos]) { pos +=3D 1; if (test->expect[pos] =3D=3D '\0') { --=20 1.8.3.1