From patchwork Tue Dec 5 20:41:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 750398 Delivered-To: patch@linaro.org Received: by 2002:adf:9b9d:0:b0:333:3a04:f257 with SMTP id d29csp1897300wrc; Tue, 5 Dec 2023 12:43:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IFN5+QZ3VubpIa6ncj9zdAw/wdcr5YxcKEDyRq1lg3j4929WakZsZFfuTgkjxRd30FDAzRe X-Received: by 2002:a05:620a:4090:b0:775:c2a1:1821 with SMTP id f16-20020a05620a409000b00775c2a11821mr2791643qko.26.1701809021286; Tue, 05 Dec 2023 12:43:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701809021; cv=none; d=google.com; s=arc-20160816; b=JtzMMIemCgwUM9PBuVt4EheTCwDirOUUCyARCJ3jiGqcr1jkdT4oZQUXXoo9psckpT 8gSpSMlp4sPM93nE3lHtP+rPXpSngP1foqhpZHEpWhUHCZFPt67j8KmEKt62uotGvW8h qFCCSpFgc98cPM+Ezu2qqiRfoBhJ5bZU+O6iEJZx1q2qCbfAncwjd20sTlYFFC4uL4CQ qbf8dLWo+RkqxvovAx4tmRdPuoyk1NIqbm3qJdUNVRUzYwUXNJ/M7hyFH5cq75T1R70e K2EhV69K7HOML78VBcIr7jI/OOZ3GCLOmLzQSqNEN5qG4eCjRc4+BYBMRQm/mL3giGSo Kn4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xzTR452wuPoh7u/eWoDkJGpRh65Bnf4qmyQcBOguNFQ=; fh=WQskExECjOtS2oBrq9x2ue7OeVr6ye1r4N0aDOSz0G8=; b=BJuY++pNsS3CzfSAsnswsVyj/lzo8RNkRTtEYgu18stJeHCb8ii5f8Snk2Te3Bz/yy xvnvGwFVsHA9u1LFaxMXp3yQbAoUZJ4phYjj9+qqt1JwwRz7FBBkgwbAdL+Lj6tn4li0 nD7bKU01GpByB4ewOrFloDBouf6BLDSIYIAdw/l7e4nslDHoW3qSFHSgg+hgeFZAs+wD C6C3h7z90YYMNBmybr+2SJeoE9Mgkxc6TtjeVtA1uAtjhCLyYg210KpY/gQkrJiyfrUV IOzK9ZscBplND/CL0m0JJ9Uyk9IGPB3+jFVZJy1CcN2DphOBQbh13C1RFN1dB9qgM4td 5aYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tawdAkP4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id cd11-20020a05622a418b00b00423a1efdd71si12919407qtb.97.2023.12.05.12.43.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Dec 2023 12:43:41 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tawdAkP4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rAcEK-0007SD-Tp; Tue, 05 Dec 2023 15:41:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rAcEI-0007RM-Di for qemu-devel@nongnu.org; Tue, 05 Dec 2023 15:41:18 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rAcEG-0002GK-5m for qemu-devel@nongnu.org; Tue, 05 Dec 2023 15:41:17 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-40bd5eaa66eso43531445e9.3 for ; Tue, 05 Dec 2023 12:41:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701808874; x=1702413674; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xzTR452wuPoh7u/eWoDkJGpRh65Bnf4qmyQcBOguNFQ=; b=tawdAkP4wGZb6jY5J+FfTqmk5/+hwJKuk9oVf91ADpOdIN89tC72SBwD0QA5aZNIoT 7vU3/Ap8haNaHJyFKuRZ9ft99RT0tM+J9NCRRkSDhkCh01s55UcS4Opij64qR3BKpGFf 3ju9F3k0sjnhmLkTJv39W4lj1EyL5zqYAgiDWXXtkxZi/i28JrOpB3KDdGmuWmM+KTV1 vZzSFE3QBZ+XlQpFhn+vpuGCmQ/cUGAw1WVb1wAsB535nUJfEkgRI8ZCkyNfcb5TOXsR RBMed36HKuScm1E1EwZZtnB6wIBOfTF5tE9bmyx4u4wCPAidNlVak+Aoo/iXNcvj4ZFH Sngw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701808874; x=1702413674; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xzTR452wuPoh7u/eWoDkJGpRh65Bnf4qmyQcBOguNFQ=; b=niqFmOT+SFq/9/GYSoJXlmGePNoO5InzC2OyLEYFGV81eBcEVM4yTxZfGrZ8hsfJwJ yCYrWIUZyuLjZHpUQIiPj+R8WFP4tBoD+Hy99M5lBl5IfbgfSoCC8Iq+kr+xmDab/7e9 +wQV7+QwtijX6nWKjzZjmow2uIZkJwKXnMj46btauhd0HxR8mgAFW9vDrXSWqjXpleL4 DTioZto8YIR/1px3yIef+CsWc0YI9MIpMR9ZhtPwmlY2KU+A0tx7PJ6deVqXoF6jkjB4 ERP0cEaI4Y5GSj6+wHcI2pqiu4lRMmRzzfC0GXg3Fa9ps0XLcpAmYut9mx5CzjoA6Bbi 8Rwg== X-Gm-Message-State: AOJu0YxDQSbYlEdx5J5E+Vrt9XdTeDHopbDJTY6QmkxaS/F2fnBdiPcx 2+AWCjFiL5a8X+VMxmr5yfDdYg== X-Received: by 2002:a05:600c:2d4c:b0:40b:5e59:e9ea with SMTP id a12-20020a05600c2d4c00b0040b5e59e9eamr988487wmg.137.1701808874602; Tue, 05 Dec 2023 12:41:14 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id d22-20020adfa356000000b0033332df65absm12350639wrb.50.2023.12.05.12.41.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 12:41:09 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id D2F715FBCC; Tue, 5 Dec 2023 20:41:06 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Cleber Rosa , Beraldo Leal , Eduardo Habkost , Richard Henderson , Wainer dos Santos Moschetta , Paolo Bonzini , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Pavel Dovgalyuk , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH 10/11] chardev: force write all when recording replay logs Date: Tue, 5 Dec 2023 20:41:05 +0000 Message-Id: <20231205204106.95531-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231205204106.95531-1-alex.bennee@linaro.org> References: <20231205204106.95531-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This is mostly a problem within avocado as serial generally isn't busy enough to overfill pipes. However the consequences of recording a failed write will haunt us on replay when causing the log to go out of sync. Fixes: https://gitlab.com/qemu-project/qemu/-/issues/2010 Signed-off-by: Alex Bennée Cc: Pavel Dovgalyuk Reviewed-by: Philippe Mathieu-Daudé Acked-by: Pavel Dovgalyuk --- chardev/char.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chardev/char.c b/chardev/char.c index 996a024c7a..6e5b4d7345 100644 --- a/chardev/char.c +++ b/chardev/char.c @@ -171,7 +171,8 @@ int qemu_chr_write(Chardev *s, const uint8_t *buf, int len, bool write_all) return res; } - res = qemu_chr_write_buffer(s, buf, len, &offset, write_all); + res = qemu_chr_write_buffer(s, buf, len, &offset, + replay_mode == REPLAY_MODE_RECORD ? true : write_all); if (qemu_chr_replay(s) && replay_mode == REPLAY_MODE_RECORD) { replay_char_write_event_save(res, offset);