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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4915DC433EF for ; Thu, 28 Oct 2021 15:37:00 +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 C5C1B610C7 for ; Thu, 28 Oct 2021 15:36:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C5C1B610C7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:55618 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mg7Sc-0003ux-TY for qemu-devel@archiver.kernel.org; Thu, 28 Oct 2021 11:36:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45696) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mg7Ri-0002VS-CW for qemu-devel@nongnu.org; Thu, 28 Oct 2021 11:36:03 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:26415) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mg7Rg-0003Nc-H9 for qemu-devel@nongnu.org; Thu, 28 Oct 2021 11:36:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635435358; 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=tEH1krRsLg0kW2BYu1RSNtAGYi7A8Q+UN8khxU2TNvk=; b=RsOW3PNYGn6SbGNAIKCsjzK1zQkCKOLv/mTIIF1go0tYx7YuJYCXfEvMa2MB5lpaUYA3r8 3Obn47NG1v5nMC2/V2mBIU0v6KUYzWJzlnt51BkSxeBepCowPcppudwDPwXWex0en3wXv/ ZNfVASMpIJ2ZHMgmVP1Y3aM4K9tpclw= Received: from mail-ua1-f72.google.com (mail-ua1-f72.google.com [209.85.222.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-577-qZnjq-7MO7qySkHNGIarrA-1; Thu, 28 Oct 2021 11:35:53 -0400 X-MC-Unique: qZnjq-7MO7qySkHNGIarrA-1 Received: by mail-ua1-f72.google.com with SMTP id h19-20020ab01353000000b002cb5de63c37so3510350uae.8 for ; Thu, 28 Oct 2021 08:35:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tEH1krRsLg0kW2BYu1RSNtAGYi7A8Q+UN8khxU2TNvk=; b=BI+7fxYOt328xBzr8MrHMFMzeK+96RYZK4aYb8TObuNvB04XcnInr7qVQBQyDGcLAy eDV/7eKr0puvtDL+6bmPp/bk9QT9Ybl14IO1zmUpbFKL0Vd9QaeheZk/GjhiIqS0A6wI fuuG3eoyJe3mdpgxhS2yEheM20Zqwm9J1PkDsidvryb/T+5wBaBjEN8f9XQp5RQvqkbl VcjqzpegYl8N3vuO/3s0LCtxtX374Q1YgXnq0xvwvwRV+Bsn9X44SVBOBhDlznnAZPyz IpIDkm7q7Nvr2xnXbAIWCT9L8XmNx/amUr+tYfLLFXL0l/g1pKndeLTkcj4CZsdvXfLh Wr0Q== X-Gm-Message-State: AOAM532pWh9EcmYmWv+CII9o6GTymzKtczshMyi5YTqBh9jOkTzaxCuZ jHZCxjgunfij+fKc+gdOk5jCjQZ63Cc1zZdh3/goHrq+8GZJi2+NQDV7XdV0vmk/w+gomI7psR4 Lu/vm1eTHs5N6tTA3CtOToxtmaVxqwWw= X-Received: by 2002:a05:6122:c9f:: with SMTP id ba31mr5289607vkb.25.1635435352488; Thu, 28 Oct 2021 08:35:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIr31gZz43H8uEwf3JTzafLMRl2MeSFbBPjy1jkpS2QslwzHcHhQWjI9A+dsMJspSVNjp1Z8gsfs+jMU+kp6k= X-Received: by 2002:a05:6122:c9f:: with SMTP id ba31mr5289569vkb.25.1635435352226; Thu, 28 Oct 2021 08:35:52 -0700 (PDT) MIME-Version: 1.0 References: <20211026175612.4127598-1-jsnow@redhat.com> <20211026175612.4127598-3-jsnow@redhat.com> In-Reply-To: From: John Snow Date: Thu, 28 Oct 2021 11:35:43 -0400 Message-ID: Subject: Re: [PATCH v5 2/8] python/machine: Handle QMP errors on close more meticulously To: Kevin Wolf Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="000000000000390e3805cf6b77a1" Received-SPF: pass client-ip=216.205.24.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-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: Vladimir Sementsov-Ogievskiy , Eduardo Habkost , qemu-block@nongnu.org, qemu-devel , Hanna Reitz , Cleber Rosa Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --000000000000390e3805cf6b77a1 Content-Type: text/plain; charset="UTF-8" On Thu, Oct 28, 2021, 6:01 AM Kevin Wolf wrote: > Am 27.10.2021 um 19:49 hat John Snow geschrieben: > > This reply is long, sorry. > > And after writing half of a very long reply myself, I noticed that I was > just very confused, so sorry for making you write a long text for no > real reason (well, at least for my first point - for the second one, > your explanation was very helpful, so thanks for that). > > Somehow I ended up completely ignoring the context of the code (it's run > as part of shutdown functions) and instead thought of the general > condition of QMP connections going away anywhere in the code. > > I suppose this could be a relevant concern in an actually asynchronous > client that may read from the socket (and encounter an error if the QEMU > process has already gone away and closed the connection) at any time, > but that's not what machine.py is meant for, at least not for now. > > So I'll just delete what I already wrote. This patch should be fine. > > Kevin > No problem. The cleanup path here is quite complex, so it wasn't clear that there *wasn't* a problem. I'd like to upgrade machine.py to use asyncio more natively for the console socket and qmp layers in the future and help break it apart into smaller pieces that are easier to reason about. You're right, though, if/when this part becomes async then needing more precision on when we mark a vm as defunct will become important. Thanks for looking at it! --js > --000000000000390e3805cf6b77a1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Thu, Oct 28, 2021, 6:01 AM Kevin Wolf <kwolf@redhat.com> wrote:
Am 27.10.2021 um 19:49 hat John Snow geschrieben:=
> This reply is long, sorry.

And after writing half of a very long reply myself, I noticed that I was just very confused, so sorry for making you write a long text for no
real reason (well, at least for my first point - for the second one,
your explanation was very helpful, so thanks for that).

Somehow I ended up completely ignoring the context of the code (it's ru= n
as part of shutdown functions) and instead thought of the general
condition of QMP connections going away anywhere in the code.

I suppose this could be a relevant concern in an actually asynchronous
client that may read from the socket (and encounter an error if the QEMU process has already gone away and closed the connection) at any time,
but that's not what machine.py is meant for, at least not for now.

So I'll just delete what I already wrote. This patch should be fine.
Kevin

No problem. The cleanup path here is quite complex, so it wasn't c= lear that there *wasn't* a problem.=C2=A0

I'd like to upgrade machine.py to use asyncio mor= e natively for the console socket and qmp layers in the future and help bre= ak it apart into smaller pieces that are easier to reason about.=C2=A0

You're right, though, if= /when this part becomes async then needing more precision on when we mark a= vm as defunct will become important.

Thanks for looking at it!

--js
--000000000000390e3805cf6b77a1--