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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 602F5C6FD20 for ; Fri, 24 Mar 2023 19:11:22 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pfmoL-00053D-U3; Fri, 24 Mar 2023 15:10:50 -0400 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 1pfmoJ-00052y-UO for qemu-devel@nongnu.org; Fri, 24 Mar 2023 15:10:48 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pfmoF-0005HF-CU for qemu-devel@nongnu.org; Fri, 24 Mar 2023 15:10:47 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32OHkbuF025425; Fri, 24 Mar 2023 19:10:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=pp1; bh=4tktR3XEtFOBjJpoduKB9rX5fzCpY6wNyMPD6j2f73U=; b=s+vquIF2Op3GnQF+NxtQMrpud4+Io6vWrvK71v2Baw76RrAZYfz2KtoM1LLaDUSwp+zk 8QTEUCo33NIoAYCIweRgRXitSsE8JwyLcJgg3+bMQUl9fHcA5XRwhMwhbiwslQcD64Jh rGhM8DHxuy7M0P14FA3LjVOhVnGT/AdfpHfGl3uYF5m7inoQ6T9A+0n2ATxHuxrx+m1G FIIqEDQhv8rXKQj21tw6gcwdreMLrAubyEQmbGuLUUiJWx/1af+EIuMmeI9i1W1G9nMh lrlSlK2OG8Rx+iA0zgYgNyY36zz4ylQXPE2C+2DG5NKKnFq5V1DXRDkVp/ZrW3erGNac UA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pheexd3k2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 24 Mar 2023 19:10:38 +0000 Received: from m0098399.ppops.net (m0098399.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 32OJ3PEr029306; Fri, 24 Mar 2023 19:10:38 GMT Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pheexd3j1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 24 Mar 2023 19:10:37 +0000 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 32O2vRUb008912; Fri, 24 Mar 2023 19:10:35 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma04fra.de.ibm.com (PPS) with ESMTPS id 3pgy9cgy1y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 24 Mar 2023 19:10:35 +0000 Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32OJAV1618612836 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 24 Mar 2023 19:10:31 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CBA722004D; Fri, 24 Mar 2023 19:10:31 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 091D820040; Fri, 24 Mar 2023 19:10:31 +0000 (GMT) Received: from p-imbrenda (unknown [9.171.58.23]) by smtpav03.fra02v.mail.ibm.com (Postfix) with SMTP; Fri, 24 Mar 2023 19:10:30 +0000 (GMT) Date: Fri, 24 Mar 2023 20:10:29 +0100 From: Claudio Imbrenda To: Thomas Huth Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, david@redhat.com, borntraeger@de.ibm.com, frankja@linux.ibm.com, fiuczy@linux.ibm.com, pasic@linux.ibm.com, nsg@linux.ibm.com, berrange@redhat.com, alex.bennee@linaro.org, armbru@redhat.com Subject: Re: [PATCH v3 1/1] util/async-teardown: wire up query-command-line-options Message-ID: <20230324201029.2864d04e@p-imbrenda> In-Reply-To: References: <20230324174559.44933-1-imbrenda@linux.ibm.com> <20230324174559.44933-2-imbrenda@linux.ibm.com> Organization: IBM X-Mailer: Claws Mail 4.1.1 (GTK 3.24.35; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: r1GdU_iCz5KafgL-uEITh1Xay3_nxq43 X-Proofpoint-ORIG-GUID: NUQukflIxCJHCaOc298uikkVIDLIY7Qu X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-24_11,2023-03-24_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 clxscore=1015 spamscore=0 priorityscore=1501 lowpriorityscore=0 mlxlogscore=999 adultscore=0 phishscore=0 mlxscore=0 suspectscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2303240150 Received-SPF: pass client-ip=148.163.156.1; envelope-from=imbrenda@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org On Fri, 24 Mar 2023 18:56:06 +0100 Thomas Huth wrote: > On 24/03/2023 18.45, Claudio Imbrenda wrote: > > The recently introduced -async-teardown commandline option was not > > wired up properly and did not show up in the output of the QMP command > > query-command-line-options. This means that libvirt will have no way to > > discover whether the feature is supported. > > > > This patch fixes the issue by correctly wiring up the commandline > > option so that it appears in the output of query-command-line-options. > > > > Reported-by: Boris Fiuczynski > > Fixes: c891c24b1a ("os-posix: asynchronous teardown for shutdown on Linux") > > Signed-off-by: Claudio Imbrenda > > --- > > os-posix.c | 14 ++++++++++++++ > > qemu-options.hx | 35 ++++++++++++++++++++++++----------- > > util/async-teardown.c | 21 +++++++++++++++++++++ > > 3 files changed, 59 insertions(+), 11 deletions(-) > > > > diff --git a/os-posix.c b/os-posix.c > > index 5adc69f560..48acd7acf5 100644 > > --- a/os-posix.c > > +++ b/os-posix.c > > @@ -36,6 +36,8 @@ > > #include "qemu/log.h" > > #include "sysemu/runstate.h" > > #include "qemu/cutils.h" > > +#include "qemu/config-file.h" > > +#include "qemu/option.h" > > > > #ifdef CONFIG_LINUX > > #include > > @@ -132,6 +134,8 @@ static bool os_parse_runas_uid_gid(const char *optarg) > > */ > > int os_parse_cmd_args(int index, const char *optarg) > > { > > + QemuOpts *opts; > > + > > switch (index) { > > case QEMU_OPTION_runas: > > user_pwd = getpwnam(optarg); > > @@ -155,6 +159,16 @@ int os_parse_cmd_args(int index, const char *optarg) > > case QEMU_OPTION_asyncteardown: > > init_async_teardown(); > > break; > > + case QEMU_OPTION_teardown: > > + opts = qemu_opts_parse_noisily(qemu_find_opts("teardown"), > > + optarg, false); > > + if (!opts) { > > + return -1; > > + } > > + if (qemu_opt_get_bool(opts, "async", false)) { > > + init_async_teardown(); > > + } > > + break; > > #endif > > default: > > return -1; > > diff --git a/qemu-options.hx b/qemu-options.hx > > index d42f60fb91..8582980b12 100644 > > --- a/qemu-options.hx > > +++ b/qemu-options.hx > > @@ -4766,20 +4766,33 @@ DEF("qtest-log", HAS_ARG, QEMU_OPTION_qtest_log, "", QEMU_ARCH_ALL) > > DEF("async-teardown", 0, QEMU_OPTION_asyncteardown, > > "-async-teardown enable asynchronous teardown\n", > > QEMU_ARCH_ALL) > > -#endif > > SRST > > ``-async-teardown`` > > - Enable asynchronous teardown. A new process called "cleanup/" > > - will be created at startup sharing the address space with the main qemu > > - process, using clone. It will wait for the main qemu process to > > - terminate completely, and then exit. > > - This allows qemu to terminate very quickly even if the guest was > > - huge, leaving the teardown of the address space to the cleanup > > - process. Since the cleanup process shares the same cgroups as the > > - main qemu process, accounting is performed correctly. This only > > - works if the cleanup process is not forcefully killed with SIGKILL > > - before the main qemu process has terminated completely. > > + Equivalent to -teardown async=on > > We should avoid of providing multiple ways of doing the same thing to the > users if there is no real benefit. So I'd vote for either removing the > "-async-teardown" option here directly (since it just has been introduced in > 7.2 and there are no known users out there yet), or at least deprecate it > (put an entry in docs/about/deprecated.rst), so we can remove it again in both are fine for me (although I have a slight preference for removing it altogether) > two releases. > > Thomas >