From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.3 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,NUMERIC_HTTP_ADDR,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, WEIRD_PORT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DBD3FC433E0 for ; Wed, 3 Feb 2021 08:39:31 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2ACF964F67 for ; Wed, 3 Feb 2021 08:39:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2ACF964F67 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:36278 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7DhB-0000Tw-SL for qemu-devel@archiver.kernel.org; Wed, 03 Feb 2021 03:39:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44482) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7DgO-0008U5-01 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 03:38:40 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:24099) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l7DgK-0000Nz-DD for qemu-devel@nongnu.org; Wed, 03 Feb 2021 03:38:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612341514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=4sGQ+0smv+nIrneWH/NyiW7dqycqJR0Z4YdC1e3apGA=; b=MJee5RzinlDzGGi/mBPf84ggzvnYop6mIRVfsl4MheOtRyRr9lsrVITXwmpks/VKAejyZW 3MxbZ+YHesZZ5VbK5XCI2jNVZ7U3hqhj+4zHUnryAhondxbaVkV3ZBKm6NeWK+3I2nkgtQ J57+XB+fVuXuUF9+mhXp53F2sCaW95E= Received: from mail-io1-f70.google.com (mail-io1-f70.google.com [209.85.166.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-64-zaDua-mBPo2oxcOY-6aVIA-1; Wed, 03 Feb 2021 03:38:31 -0500 X-MC-Unique: zaDua-mBPo2oxcOY-6aVIA-1 Received: by mail-io1-f70.google.com with SMTP id r140so11637250iod.6 for ; Wed, 03 Feb 2021 00:38:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4sGQ+0smv+nIrneWH/NyiW7dqycqJR0Z4YdC1e3apGA=; b=IVaqCRSlPzK1Q1eGp7IZBqKNC9tglCxruYkH3vyXRWaocQuWoFyIqvld541rT2xa42 dKyrv5nZATStQ0pp6Y0iFqGGO1bWIN2YTlBnrICQnisWh6FU15UbsqVZjr+6mCLc3z7p i6zZkupnK+ME/XXP+Vifl4SaXsKQgc0/CNlVOpKMSqAo6uTC0q5bT09v+IOCtzGepT1G EE2nQBJFccbKm2R4sX30nvIkdQFAXMBFYHpkHaYOUZRhTTboZydGLwuGHcKTugDTFONP iQiUUSKunHHx6Ps4Zd+DWqXkPfHZRw1lXFIaztP4pNIl9fzc3OGOrPCwRuvfykSW1NIa 884A== X-Gm-Message-State: AOAM532lpP3UWT3YFmcZ11zxkrH4RyRKWjl4x50McTH79mgPOXSQmj25 7W9Dy91gJMP6d0VezTcwRH+xleuqSDXQoUC1Zn8/UMkuIXcAHstwYzXVwaskEYoF7lM43p0Gv9o DFpNPa/Im9LOTxiJdO+qWnkEyge8Hvdg= X-Received: by 2002:a05:6e02:194a:: with SMTP id x10mr1781500ilu.165.1612341510919; Wed, 03 Feb 2021 00:38:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJxs6tI+fIuAquR800oNQZt9mIX3UN6RM3hSzC8x2NX8o2epyqPctHbuyxal9Lkb0CjScdrbFrZhs+l2pFJeI0w= X-Received: by 2002:a05:6e02:194a:: with SMTP id x10mr1781495ilu.165.1612341510785; Wed, 03 Feb 2021 00:38:30 -0800 (PST) MIME-Version: 1.0 References: <161224971122.79781.8594358970645859667.stgit@pasha-ThinkPad-X280> <1a5d134b-c826-9620-094e-48fc6bb931b0@ispras.ru> <3f9e991e-da3b-1df5-5124-06dc2e1b7e18@ispras.ru> In-Reply-To: <3f9e991e-da3b-1df5-5124-06dc2e1b7e18@ispras.ru> From: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= Date: Wed, 3 Feb 2021 12:38:19 +0400 Message-ID: Subject: Re: [PATCH] char: don't fail when client is not connected To: Pavel Dovgalyuk , "P. Berrange, Daniel" Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mlureau@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="00000000000001e7bd05ba6a8329" Received-SPF: pass client-ip=63.128.21.124; envelope-from=mlureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.386, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, NUMERIC_HTTP_ADDR=1.242, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, WEIRD_PORT=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Bonzini, Paolo" , qemu-devel Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --00000000000001e7bd05ba6a8329 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi On Wed, Feb 3, 2021 at 12:22 PM Pavel Dovgalyuk wrote: > On 03.02.2021 11:13, Marc-Andr=C3=A9 Lureau wrote: > > > Can you provide a reproducer? > > > That was a record/replay scenario. I've used Fedora cloudinit images, > that are used in acceptance tests: > > qemu-system-x86_64 \ > -display none -vga none -machine pc -smp 1 -m 1024 \ > -monitor tcp:127.0.0.1:8081,server,nowait \ > -serial tcp:127.0.0.1:8082,server,nowait \ > -object filter-replay,id=3Dreplay,netdev=3Dhub0port0 \ > -drive > file=3DFedora-Cloud-Base-31-1.9.x86_64.qcow2,snapshot,id=3Ddisk0,if=3Dnon= e \ > -drive driver=3Dblkreplay,id=3Ddisk0-rr,if=3Dnone,image=3Ddisk0 \ > -device virtio-blk-pci,drive=3Ddisk0-rr,ioeventfd=3Dfalse \ > -icount shift=3D1,rr=3Drecord,rrfile=3Dreplay.bin \ > -drive file=3Dcloudinit.iso,snapshot,id=3Ddisk1,if=3Dnone \ > -drive driver=3Dblkreplay,id=3Ddisk1-rr,if=3Dnone,image=3Ddisk1 \ > -device virtio-blk-pci,drive=3Ddisk1-rr,ioeventfd=3Dfalse > > > The failure occurred on replay stage: > > qemu-system-x86_64 \ > -display none -vga none -machine pc -smp 1 -m 1024 \ > -monitor tcp:127.0.0.1:8081,server,nowait \ > -serial tcp:127.0.0.1:8082,server,nowait \ > -object filter-replay,id=3Dreplay,netdev=3Dhub0port0 \ > -drive > file=3DFedora-Cloud-Base-31-1.9.x86_64.qcow2,snapshot,id=3Ddisk0,if=3Dnon= e \ > -drive driver=3Dblkreplay,id=3Ddisk0-rr,if=3Dnone,image=3Ddisk0 \ > -device virtio-blk-pci,drive=3Ddisk0-rr,ioeventfd=3Dfalse \ > -icount shift=3D1,rr=3Dreplay,rrfile=3Dreplay.bin \ > -drive file=3Dcloudinit.iso,snapshot,id=3Ddisk1,if=3Dnone \ > -drive driver=3Dblkreplay,id=3Ddisk1-rr,if=3Dnone,image=3Ddisk1 \ > -device virtio-blk-pci,drive=3Ddisk1-rr,ioeventfd=3Dfalse > Ah, that helps. qemu_chr_write() will return replay_char_write_event_load(), bypassing the current state. If the connected state during replay doesn't match the state during recording, it is possible to reach the bad condition. (there are probably many such corner-cases situations with replay..) Can you update the commit message to explain the relation with replay? with that: Reviewed-by: Marc-Andr=C3=A9 Lureau Daniel, could you review it too? thanks --00000000000001e7bd05ba6a8329 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi

On Wed, Feb 3, 2021 at 12:22 PM Pav= el Dovgalyuk <pavel.dovgaly= uk@ispras.ru> wrote:
On 03.02.2021 11:13, Marc-Andr=C3=A9 Lureau wrote:

> Can you provide a reproducer?


That was a record/replay scenario. I've used Fedora cloudinit images, <= br> that are used in acceptance tests:

qemu-system-x86_64 \
=C2=A0 -display none -vga none -machine pc -smp 1 -m 1024 \
=C2=A0 -monitor tcp:127.0.0.1:8081,server,nowait \
=C2=A0 -serial tcp:127.0.0.1:8082,server,nowait \
=C2=A0 -object filter-replay,id=3Dreplay,netdev=3Dhub0port0 \
=C2=A0 -drive
file=3DFedora-Cloud-Base-31-1.9.x86_64.qcow2,snapshot,id=3Ddisk0,if=3Dnone = \
=C2=A0 -drive driver=3Dblkreplay,id=3Ddisk0-rr,if=3Dnone,image=3Ddisk0 \ =C2=A0 -device virtio-blk-pci,drive=3Ddisk0-rr,ioeventfd=3Dfalse \
=C2=A0 -icount shift=3D1,rr=3Drecord,rrfile=3Dreplay.bin \
=C2=A0 -drive file=3Dcloudinit.iso,snapshot,id=3Ddisk1,if=3Dnone \
=C2=A0 -drive driver=3Dblkreplay,id=3Ddisk1-rr,if=3Dnone,image=3Ddisk1 \ =C2=A0 -device virtio-blk-pci,drive=3Ddisk1-rr,ioeventfd=3Dfalse


The failure occurred on replay stage:

qemu-system-x86_64 \
=C2=A0 -display none -vga none -machine pc -smp 1 -m 1024 \
=C2=A0 -monitor tcp:127.0.0.1:8081,server,nowait \
=C2=A0 -serial tcp:127.0.0.1:8082,server,nowait \
=C2=A0 -object filter-replay,id=3Dreplay,netdev=3Dhub0port0 \
=C2=A0 -drive
file=3DFedora-Cloud-Base-31-1.9.x86_64.qcow2,snapshot,id=3Ddisk0,if=3Dnone = \
=C2=A0 -drive driver=3Dblkreplay,id=3Ddisk0-rr,if=3Dnone,image=3Ddisk0 \ =C2=A0 -device virtio-blk-pci,drive=3Ddisk0-rr,ioeventfd=3Dfalse \
=C2=A0 -icount shift=3D1,rr=3Dreplay,rrfile=3Dreplay.bin \
=C2=A0 -drive file=3Dcloudinit.iso,snapshot,id=3Ddisk1,if=3Dnone \
=C2=A0 -drive driver=3Dblkreplay,id=3Ddisk1-rr,if=3Dnone,image=3Ddisk1 \ =C2=A0 -device virtio-blk-pci,drive=3Ddisk1-rr,ioeventfd=3Dfalse

Ah, that helps. qemu_chr_write() will return repl= ay_char_write_event_load(), bypassing the current state. If the connected s= tate during replay doesn't match the state during recording, it is poss= ible to reach the bad condition. (there are probably many such corner-cases= situations with replay..)

Can you update the comm= it message to explain the relation with replay? with that:
Re= viewed-by: Marc-Andr=C3=A9 Lureau <marcandre.lureau@redhat.com>

Dan= iel, could you review it too?
thanks
--00000000000001e7bd05ba6a8329--