From nobody Thu Apr 17 06:50:30 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1613401411877177.90577670606376; Mon, 15 Feb 2021 07:03:31 -0800 (PST) Received: from localhost ([::1]:37736 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+importer=patchew.org@nongnu.org>) id 1lBfPO-0006s0-6Y for importer@patchew.org; Mon, 15 Feb 2021 10:03:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55004) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <kwolf@redhat.com>) id 1lBfNB-0005Jt-BW for qemu-devel@nongnu.org; Mon, 15 Feb 2021 10:01:13 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:56771) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from <kwolf@redhat.com>) id 1lBfN9-0000ck-Kx for qemu-devel@nongnu.org; Mon, 15 Feb 2021 10:01:13 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-293-QRUcDjFpMUO8p0p6t7nvVQ-1; Mon, 15 Feb 2021 10:01:07 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3E5DC1573F; Mon, 15 Feb 2021 15:01:05 +0000 (UTC) Received: from merkur.fritz.box (ovpn-113-28.ams2.redhat.com [10.36.113.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 45D6A5C241; Mon, 15 Feb 2021 15:01:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613401270; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=588gEbBzsw2gnYATRW2WAFMJbcUiJZ8gwk+WOcIFlM8=; b=fln9eL7PxBNBpKzKOzy6N3gKm05jfEgVchCY2rbmlt31/uoN8LYZrigD17XIcVpaEBsPR+ iD7abGRG7FkNxfl7ozuhbMKviVhp3Elzp+BEcL5DnA5VMxxd728+h6Nn81xWkiDZSSOvsl YubdvR89trHE0Xk8bT/Z5GBXurvWBYA= X-MC-Unique: QRUcDjFpMUO8p0p6t7nvVQ-1 From: Kevin Wolf <kwolf@redhat.com> To: qemu-block@nongnu.org Subject: [PULL 01/11] qemu-storage-daemon: Enable object-add Date: Mon, 15 Feb 2021 16:00:50 +0100 Message-Id: <20210215150100.436555-2-kwolf@redhat.com> In-Reply-To: <20210215150100.436555-1-kwolf@redhat.com> References: <20210215150100.436555-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kwolf@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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+importer=patchew.org@nongnu.org> X-ZohoMail-DKIM: pass (identity @redhat.com) As we don't have a fully QAPIfied version of object-add yet and it still has 'gen': false in the schema, it needs to be registered explicitly in init_qmp_commands() to be available for users. Fixes: 2af282ec51a27116d0402cab237b8970800f870c Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20210204072137.19663-1-kwolf@redhat.com> Reviewed-by: Daniel P. Berrang=C3=A9 <berrange@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- storage-daemon/qemu-storage-daemon.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/storage-daemon/qemu-storage-daemon.c b/storage-daemon/qemu-sto= rage-daemon.c index d8d172cc60..9021a46b3a 100644 --- a/storage-daemon/qemu-storage-daemon.c +++ b/storage-daemon/qemu-storage-daemon.c @@ -144,6 +144,8 @@ static void init_qmp_commands(void) qmp_init_marshal(&qmp_commands); qmp_register_command(&qmp_commands, "query-qmp-schema", qmp_query_qmp_schema, QCO_ALLOW_PRECONFIG); + qmp_register_command(&qmp_commands, "object-add", qmp_object_add, + QCO_NO_OPTIONS); =20 QTAILQ_INIT(&qmp_cap_negotiation_commands); qmp_register_command(&qmp_cap_negotiation_commands, "qmp_capabilities", --=20 2.29.2 From nobody Thu Apr 17 06:50:30 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1613401641; cv=none; d=zohomail.com; s=zohoarc; b=CYvFySH88b3NIZDVlFae95DOpuoDne3SRt5EEsP5unrrB5ggZLvXFJ+d6f80kmjiTHLIer637Ut99Nt+8Y+0KSzmoEzecXkLzl3VFQjld/iHCaNDMcdat6E4gtzosHyrdir1uyzZRheY5uSE7GHKr1czevYxqweexhgErX8xfUE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613401641; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4FOfO4A5XEOQp5RAsrSabrfua3b8RE1+jXQbZLO2Uvc=; b=aeCdIU51lP5+k8g0DtcHnBmQ286MfABm+pGvjdQAMhaHD+vil6Yo4Q6BvgJM5frDJCzEnmf/uXamlHoNsPPaUllb1IUK/UR/sztZmVJ9pn4Y8NoPlUZwNedsxoE9HT2xbhx/o8g2pmAmxeSh90xuaCR63+Xz4zF6mKiqJnJd7/k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from=<kwolf@redhat.com> (p=none dis=none) header.from=<kwolf@redhat.com> Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 161340164064591.15732771929811; Mon, 15 Feb 2021 07:07:20 -0800 (PST) Received: from localhost ([::1]:45904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+importer=patchew.org@nongnu.org>) id 1lBfT5-0001tJ-D8 for importer@patchew.org; Mon, 15 Feb 2021 10:07:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55170) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <kwolf@redhat.com>) id 1lBfNM-0005dn-Aq for qemu-devel@nongnu.org; Mon, 15 Feb 2021 10:01:24 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:52826) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from <kwolf@redhat.com>) id 1lBfNJ-0000mB-Mz for qemu-devel@nongnu.org; Mon, 15 Feb 2021 10:01:24 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-598-yl___hIuPku68CRRMUc3mQ-1; Mon, 15 Feb 2021 10:01:07 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7DCF48710ED; Mon, 15 Feb 2021 15:01:06 +0000 (UTC) Received: from merkur.fritz.box (ovpn-113-28.ams2.redhat.com [10.36.113.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 85ED05C241; Mon, 15 Feb 2021 15:01:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613401281; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4FOfO4A5XEOQp5RAsrSabrfua3b8RE1+jXQbZLO2Uvc=; b=L4BgpLZdPvt7iO7PnDVTmu9FXl05NISc7K3e6W6sW+yJZF/H9EVjwSuFDYnHEzkVAUrdlE wiVpTaSlet7/GlCZcN7mBsOe9LQ76WbJBqV/RzgSrZ/xCvqn9wtUnU+uujAYSOnyjG9LJc 8jgkJbcOM073HyI3BJQtyK8lFTDtBc0= X-MC-Unique: yl___hIuPku68CRRMUc3mQ-1 From: Kevin Wolf <kwolf@redhat.com> To: qemu-block@nongnu.org Subject: [PULL 02/11] iotests: Consistent $IMGOPTS boundary matching Date: Mon, 15 Feb 2021 16:00:51 +0100 Message-Id: <20210215150100.436555-3-kwolf@redhat.com> In-Reply-To: <20210215150100.436555-1-kwolf@redhat.com> References: <20210215150100.436555-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=kwolf@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, 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 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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+importer=patchew.org@nongnu.org> X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Max Reitz <mreitz@redhat.com> To disallow certain refcount_bits values, some _unsupported_imgopts invocations look like "refcount_bits=3D1[^0-9]", i.e. they match an integer boundary with [^0-9]. This expression does not match the end of the string, though, so it breaks down when refcount_bits is the last option (which it tends to be after the rewrite of the check script in Python). Those invocations could use \b or \> instead, but those are not portable. They could use something like \([^0-9]\|$\), but that would be cumbersome. To make it simple and keep the existing invocations working, just let _unsupported_imgopts match the regex against $IMGOPTS plus a trailing space. Suggested-by: Eric Blake <eblake@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com> Message-Id: <20210210095128.22732-1-mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- tests/qemu-iotests/common.rc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index 77c37e8312..65cdba5723 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -885,7 +885,9 @@ _unsupported_imgopts() { for bad_opt do - if echo "$IMGOPTS" | grep -q 2>/dev/null "$bad_opt" + # Add a space so tests can match for whitespace that marks the + # end of an option (\b or \> are not portable) + if echo "$IMGOPTS " | grep -q 2>/dev/null "$bad_opt" then _notrun "not suitable for image option: $bad_opt" fi --=20 2.29.2 From nobody Thu Apr 17 06:50:30 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1613401940; cv=none; d=zohomail.com; s=zohoarc; b=GV1H5EHXpXRLGGFMx/pBpgUFo75K5th7eFcfsqEuf6hx+X5d31939/utoa6DtIfpJsp9RtttKKTkgGhfa/3rKh7RGMDir0xpRaZbAdCc6YEWrCBP9bQHna+Mm/L081YdGC0zLrXscTZum9MUxsZSUJVSQhTF3DIBWQpEPxvpi3w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613401940; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gB2c914N453Rav2bP3tPhX9RRzLXU/YZJW0xtRFFYbI=; b=H5aKkZ1GWlwIHrRI7dAXQIdtV0Dx/hOQEf5+4T8ulmGefRdViOwuidsw0x72VgWTlXRB8Ucn1KiJC8jk/2kW1wiwyTghNHv14LQbwFIs3BPqfVQCy2ELYfu0Mwr+EVqusgyd37uBO2R3fIGozphF85Y/vYrj/RGyWwXu1qSFzzM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from=<kwolf@redhat.com> (p=none dis=none) header.from=<kwolf@redhat.com> Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1613401939957362.5455058858133; Mon, 15 Feb 2021 07:12:19 -0800 (PST) Received: from localhost ([::1]:60466 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+importer=patchew.org@nongnu.org>) id 1lBfXu-0007w3-QD for importer@patchew.org; Mon, 15 Feb 2021 10:12:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55172) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <kwolf@redhat.com>) id 1lBfNN-0005fR-4O for qemu-devel@nongnu.org; Mon, 15 Feb 2021 10:01:25 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:36927) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from <kwolf@redhat.com>) id 1lBfNL-0000nU-4z for qemu-devel@nongnu.org; Mon, 15 Feb 2021 10:01:24 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-100-8E9Cek4wMKyzhyaqRnlLwg-1; Mon, 15 Feb 2021 10:01:08 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BEB16801975; Mon, 15 Feb 2021 15:01:07 +0000 (UTC) Received: from merkur.fritz.box (ovpn-113-28.ams2.redhat.com [10.36.113.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id C747C5C241; Mon, 15 Feb 2021 15:01:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613401282; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gB2c914N453Rav2bP3tPhX9RRzLXU/YZJW0xtRFFYbI=; b=cE9FDdK5ZcwC+gOYealvovzlJ2gsy0+UIiWEO2ZS+PeV3z92vQBevwVGRHPX9i3vZgqWbT o2bjTi+b2rrfrMkqoMWRlwfDyp09kcH5Ah6ayqA/KkWV7l5XVEEW/rKiIEfhzehnvcZLvX YSANOL/oyPDBX+1jh0wFR4wCLPeYMvw= X-MC-Unique: 8E9Cek4wMKyzhyaqRnlLwg-1 From: Kevin Wolf <kwolf@redhat.com> To: qemu-block@nongnu.org Subject: [PULL 03/11] blockjob: Fix crash with IOthread when block commit after snapshot Date: Mon, 15 Feb 2021 16:00:52 +0100 Message-Id: <20210215150100.436555-4-kwolf@redhat.com> In-Reply-To: <20210215150100.436555-1-kwolf@redhat.com> References: <20210215150100.436555-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=kwolf@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, 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 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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+importer=patchew.org@nongnu.org> X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Michael Qiu <qiudayu@huayun.com> Currently, if guest has workloads, IO thread will acquire aio_context lock before do io_submit, it leads to segmentfault when do block commit after snapshot. Just like below: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7f7c7d91f700 (LWP 99907)] 0x00005576d0f65aab in bdrv_mirror_top_pwritev at ../block/mirror.c:1437 1437 ../block/mirror.c: No such file or directory. (gdb) p s->job $17 =3D (MirrorBlockJob *) 0x0 (gdb) p s->stop $18 =3D false Call trace of IO thread: 0 0x00005576d0f65aab in bdrv_mirror_top_pwritev at ../block/mirror.c:1437 1 0x00005576d0f7f3ab in bdrv_driver_pwritev at ../block/io.c:1174 2 0x00005576d0f8139d in bdrv_aligned_pwritev at ../block/io.c:1988 3 0x00005576d0f81b65 in bdrv_co_pwritev_part at ../block/io.c:2156 4 0x00005576d0f8e6b7 in blk_do_pwritev_part at ../block/block-backend.c:12= 60 5 0x00005576d0f8e84d in blk_aio_write_entry at ../block/block-backend.c:14= 76 ... Switch to qemu main thread: 0 0x00007f903be704ed in __lll_lock_wait at /lib/../lib64/libpthread.so.0 1 0x00007f903be6bde6 in _L_lock_941 at /lib/../lib64/libpthread.so.0 2 0x00007f903be6bcdf in pthread_mutex_lock at /lib/../lib64/libpthread.so.0 3 0x0000564b21456889 in qemu_mutex_lock_impl at ../util/qemu-thread-posix.c:79 4 0x0000564b213af8a5 in block_job_add_bdrv at ../blockjob.c:224 5 0x0000564b213b00ad in block_job_create at ../blockjob.c:440 6 0x0000564b21357c0a in mirror_start_job at ../block/mirror.c:1622 7 0x0000564b2135a9af in commit_active_start at ../block/mirror.c:1867 8 0x0000564b2133d132 in qmp_block_commit at ../blockdev.c:2768 9 0x0000564b2141fef3 in qmp_marshal_block_commit at qapi/qapi-commands-block-core.c:346 10 0x0000564b214503c9 in do_qmp_dispatch_bh at ../qapi/qmp-dispatch.c:110 11 0x0000564b21451996 in aio_bh_poll at ../util/async.c:164 12 0x0000564b2146018e in aio_dispatch at ../util/aio-posix.c:381 13 0x0000564b2145187e in aio_ctx_dispatch at ../util/async.c:306 14 0x00007f9040239049 in g_main_context_dispatch at /lib/../lib64/libglib-2.0.so.0 15 0x0000564b21447368 in main_loop_wait at ../util/main-loop.c:232 16 0x0000564b21447368 in main_loop_wait at ../util/main-loop.c:255 17 0x0000564b21447368 in main_loop_wait at ../util/main-loop.c:531 18 0x0000564b212304e1 in qemu_main_loop at ../softmmu/runstate.c:721 19 0x0000564b20f7975e in main at ../softmmu/main.c:50 In IO thread when do bdrv_mirror_top_pwritev, the job is NULL, and stop fie= ld is false, this means the MirrorBDSOpaque "s" object has not been initialized yet, and this object is initialized by block_job_create(), but the initiali= ze process is stuck in acquiring the lock. In this situation, IO thread come to bdrv_mirror_top_pwritev(),which means = that mirror-top node is already inserted into block graph, but its bs->opaque->j= ob is not initialized. The root cause is that qemu main thread do release/acquire when hold the lo= ck, at the same time, IO thread get the lock after release stage, and the crash occured. Actually, in this situation, job->job.aio_context will not equal to qemu_get_aio_context(), and will be the same as bs->aio_context, thus, no need to release the lock, becasue bdrv_root_attach_child() will not change the context. This patch fix this issue. Fixes: 132ada80 "block: Adjust AioContexts when attaching nodes" Signed-off-by: Michael Qiu <qiudayu@huayun.com> Message-Id: <20210203024059.52683-1-08005325@163.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- blockjob.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/blockjob.c b/blockjob.c index db3a21699c..f2feff051d 100644 --- a/blockjob.c +++ b/blockjob.c @@ -212,15 +212,19 @@ int block_job_add_bdrv(BlockJob *job, const char *nam= e, BlockDriverState *bs, uint64_t perm, uint64_t shared_perm, Error **errp) { BdrvChild *c; + bool need_context_ops; =20 bdrv_ref(bs); - if (job->job.aio_context !=3D qemu_get_aio_context()) { + + need_context_ops =3D bdrv_get_aio_context(bs) !=3D job->job.aio_contex= t; + + if (need_context_ops && job->job.aio_context !=3D qemu_get_aio_context= ()) { aio_context_release(job->job.aio_context); } c =3D bdrv_root_attach_child(bs, name, &child_job, 0, job->job.aio_context, perm, shared_perm, jo= b, errp); - if (job->job.aio_context !=3D qemu_get_aio_context()) { + if (need_context_ops && job->job.aio_context !=3D qemu_get_aio_context= ()) { aio_context_acquire(job->job.aio_context); } if (c =3D=3D NULL) { --=20 2.29.2 From nobody Thu Apr 17 06:50:30 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 161340182169750.814265001358535; Mon, 15 Feb 2021 07:10:21 -0800 (PST) Received: from localhost ([::1]:54024 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+importer=patchew.org@nongnu.org>) id 1lBfW0-0005BF-Mh for importer@patchew.org; Mon, 15 Feb 2021 10:10:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55070) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <kwolf@redhat.com>) id 1lBfNG-0005QG-4m for qemu-devel@nongnu.org; Mon, 15 Feb 2021 10:01:18 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:25661) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from <kwolf@redhat.com>) id 1lBfNE-0000hp-1a for qemu-devel@nongnu.org; Mon, 15 Feb 2021 10:01:17 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-501-YaWMK2aFMRGPisFtAq1Gkg-1; Mon, 15 Feb 2021 10:01:10 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0BDFE801965; Mon, 15 Feb 2021 15:01:09 +0000 (UTC) Received: from merkur.fritz.box (ovpn-113-28.ams2.redhat.com [10.36.113.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1382A5C233; Mon, 15 Feb 2021 15:01:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613401275; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mFAJGHMTIcqkF9k82J2swaNaaRa6gZ22/9SbNCI0gfs=; b=R6G2atkgji211cKfX/zhBxdr/RL52iGRTG3f8qag7BBNFVOWIs4V0ALWoO/PZScAH0Jg5+ xEAPJiZyNo4zUko2XpKZpc/3iX1inPGYN27tbEvAhnjWsc2aruRh064Vwb2eZX5g6xt6BB yMcKMxN0pc9GpkU0pR3r3M0wLHYdcMY= X-MC-Unique: YaWMK2aFMRGPisFtAq1Gkg-1 From: Kevin Wolf <kwolf@redhat.com> To: qemu-block@nongnu.org Subject: [PULL 04/11] hw/ide/ahci: map cmd_fis as DMA_DIRECTION_TO_DEVICE Date: Mon, 15 Feb 2021 16:00:53 +0100 Message-Id: <20210215150100.436555-5-kwolf@redhat.com> In-Reply-To: <20210215150100.436555-1-kwolf@redhat.com> References: <20210215150100.436555-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kwolf@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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+importer=patchew.org@nongnu.org> X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Alexander Bulekov <alxndr@bu.edu> cmd_fis is mapped as DMA_DIRECTION_FROM_DEVICE, however, it is read from, and not written to anywhere. Fix the DMA_DIRECTION and mark cmd_fis as read-only in the code. Signed-off-by: Alexander Bulekov <alxndr@bu.edu> Message-Id: <20210119164051.89268-1-alxndr@bu.edu> Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- hw/ide/ahci.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 6d50482b8d..f2c5157483 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -700,7 +700,7 @@ static void ahci_reset_port(AHCIState *s, int port) } =20 /* Buffer pretty output based on a raw FIS structure. */ -static char *ahci_pretty_buffer_fis(uint8_t *fis, int cmd_len) +static char *ahci_pretty_buffer_fis(const uint8_t *fis, int cmd_len) { int i; GString *s =3D g_string_new("FIS:"); @@ -1100,11 +1100,11 @@ static void execute_ncq_command(NCQTransferState *n= cq_tfs) } =20 =20 -static void process_ncq_command(AHCIState *s, int port, uint8_t *cmd_fis, +static void process_ncq_command(AHCIState *s, int port, const uint8_t *cmd= _fis, uint8_t slot) { AHCIDevice *ad =3D &s->dev[port]; - NCQFrame *ncq_fis =3D (NCQFrame*)cmd_fis; + const NCQFrame *ncq_fis =3D (NCQFrame *)cmd_fis; uint8_t tag =3D ncq_fis->tag >> 3; NCQTransferState *ncq_tfs =3D &ad->ncq_tfs[tag]; size_t size; @@ -1185,7 +1185,7 @@ static AHCICmdHdr *get_cmd_header(AHCIState *s, uint8= _t port, uint8_t slot) } =20 static void handle_reg_h2d_fis(AHCIState *s, int port, - uint8_t slot, uint8_t *cmd_fis) + uint8_t slot, const uint8_t *cmd_fis) { IDEState *ide_state =3D &s->dev[port].port.ifs[0]; AHCICmdHdr *cmd =3D get_cmd_header(s, port, slot); @@ -1301,7 +1301,7 @@ static int handle_cmd(AHCIState *s, int port, uint8_t= slot) tbl_addr =3D le64_to_cpu(cmd->tbl_addr); cmd_len =3D 0x80; cmd_fis =3D dma_memory_map(s->as, tbl_addr, &cmd_len, - DMA_DIRECTION_FROM_DEVICE); + DMA_DIRECTION_TO_DEVICE); if (!cmd_fis) { trace_handle_cmd_badfis(s, port); return -1; @@ -1326,7 +1326,7 @@ static int handle_cmd(AHCIState *s, int port, uint8_t= slot) } =20 out: - dma_memory_unmap(s->as, cmd_fis, cmd_len, DMA_DIRECTION_FROM_DEVICE, + dma_memory_unmap(s->as, cmd_fis, cmd_len, DMA_DIRECTION_TO_DEVICE, cmd_len); =20 if (s->dev[port].port.ifs[0].status & (BUSY_STAT|DRQ_STAT)) { --=20 2.29.2 From nobody Thu Apr 17 06:50:30 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1613401665; cv=none; d=zohomail.com; s=zohoarc; b=etjEcTuHURqECtSQQ2VzQvVY0e3xlvPt8sGSe0Jec6xLfI3O2CemBUaEY41KcvKiSnLF8Yd1r8X/dJzqIJNtXJoc9ke5Fmv5IYH3Rht4Kkj74YgJhokZPq3vOl5rBcuq5rrWWSO0xHod4QDz6p7sE766LI51WspkQA0Tpv0Qy9Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613401665; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=WbEsh+aZqTJoLF+nmSGGSz31gOUx3qYYW0pgtpMQuSw=; b=AMUso9N1UvrXyCu7x+mQOjgkLUopwd9hnzm3ZHJKbI6AlD8E44B9wFzY0S5eR5LeiAT7/1dUUKN6EQ/cuhSDMeRUAirzCVf7X1lV26qNAMfxUEi3OvQGAsZNO+5MNGFUjdMGj3xhxGM0+fjEZrz7SzfuXFowGVKjkfg1+oqem+k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from=<kwolf@redhat.com> (p=none dis=none) header.from=<kwolf@redhat.com> Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1613401664703127.12765470862394; Mon, 15 Feb 2021 07:07:44 -0800 (PST) Received: from localhost ([::1]:46790 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+importer=patchew.org@nongnu.org>) id 1lBfTT-0002Em-LK for importer@patchew.org; Mon, 15 Feb 2021 10:07:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55064) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <kwolf@redhat.com>) id 1lBfNF-0005OZ-AY for qemu-devel@nongnu.org; Mon, 15 Feb 2021 10:01:17 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:44964) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from <kwolf@redhat.com>) id 1lBfND-0000g5-2a for qemu-devel@nongnu.org; Mon, 15 Feb 2021 10:01:16 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-596-N7K9OlzhOECavQbUjqLAnw-1; Mon, 15 Feb 2021 10:01:11 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4B16A19357B1; Mon, 15 Feb 2021 15:01:10 +0000 (UTC) Received: from merkur.fritz.box (ovpn-113-28.ams2.redhat.com [10.36.113.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 544AE5C241; Mon, 15 Feb 2021 15:01:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613401274; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WbEsh+aZqTJoLF+nmSGGSz31gOUx3qYYW0pgtpMQuSw=; b=iPbhyPrzeb9nMq3oXo8ClSSN1W7XXs2SHit8YHcaw6cH2NmMqo7QNmLCGdC8JQ3UgtEoPq XEq+fV5MPTJeqfgRahLh/znhsYbKpqe6fxMMLZqETc7KVUtGK/2VDSWO8t7MkeFaQGBhik UfcId8V4PLag1HoYnSm5HWjU+4YN3Ag= X-MC-Unique: N7K9OlzhOECavQbUjqLAnw-1 From: Kevin Wolf <kwolf@redhat.com> To: qemu-block@nongnu.org Subject: [PULL 05/11] xen-block: fix reporting of discard feature Date: Mon, 15 Feb 2021 16:00:54 +0100 Message-Id: <20210215150100.436555-6-kwolf@redhat.com> In-Reply-To: <20210215150100.436555-1-kwolf@redhat.com> References: <20210215150100.436555-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=kwolf@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, 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 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+importer=patchew.org@nongnu.org> X-ZohoMail-DKIM: pass (identity @redhat.com) From: Roger Pau Monne <roger.pau@citrix.com> Linux blkfront expects both "discard-granularity" and "discard-alignment" present on xenbus in order to properly enable the feature, not exposing "discard-alignment" left some Linux blkfront versions with a broken discard setup. This has also been addressed in Linux with: https://lore.kernel.org/lkml/20210118151528.81668-1-roger.pau@citrix.com/T/= #u Fix QEMU to report a "discard-alignment" of 0, in order for it to work with older Linux frontends. Reported-by: Arthur Borsboom <arthurborsboom@gmail.com> Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com> Message-Id: <20210118153330.82324-1-roger.pau@citrix.com> Reviewed-by: Paul Durrant <paul@xen.org> Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- hw/block/xen-block.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c index 0e7d66c2a7..a3b69e2709 100644 --- a/hw/block/xen-block.c +++ b/hw/block/xen-block.c @@ -253,6 +253,7 @@ static void xen_block_realize(XenDevice *xendev, Error = **errp) xen_device_backend_printf(xendev, "feature-discard", "%u", 1); xen_device_backend_printf(xendev, "discard-granularity", "%u", conf->discard_granularity); + xen_device_backend_printf(xendev, "discard-alignment", "%u", 0); } =20 xen_device_backend_printf(xendev, "feature-flush-cache", "%u", 1); --=20 2.29.2 From nobody Thu Apr 17 06:50:30 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1613401567; cv=none; d=zohomail.com; s=zohoarc; b=lUxdsxAWsPRjo0NasdHqdbUU5qqXUjmT2Ys63AGKvBxdHiCKvBV2zuzmlPfeyJwNln5QSgnpvY+LSBB9AC3mNv7puewqSiikPvtoNFMWxXgbUtZ3Gup5CAQGsxfgUd+WU9ZaErADDQ4REr/htZTDwq/+3sO/PF2xqpz8oEXRqd8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613401567; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=k35JzbVoR82Qtyuyys0EzEN/KJORTjHaETatD7qz05g=; b=MKabNmrTQ3zo7awrr2MS5ZN8qNa2gKePJqBnscdUZibs5oLMtG4x8FkHVQcAQco01PWv/krDmu5WdoboxafFM4Sts8nPAqQR2LrBY+gZYTORGFFcoWAMz54QWVti1rEdfPRwTyHhUCg8ZIiRf8WaQw32wfRuwikBxa90ZHvYFoU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from=<kwolf@redhat.com> (p=none dis=none) header.from=<kwolf@redhat.com> Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1613401566567591.1304552419241; Mon, 15 Feb 2021 07:06:06 -0800 (PST) Received: from localhost ([::1]:41734 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+importer=patchew.org@nongnu.org>) id 1lBfRt-00007u-AE for importer@patchew.org; Mon, 15 Feb 2021 10:06:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55220) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <kwolf@redhat.com>) id 1lBfNP-0005ip-PM for qemu-devel@nongnu.org; Mon, 15 Feb 2021 10:01:29 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:54225) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from <kwolf@redhat.com>) id 1lBfNN-0000no-Fj for qemu-devel@nongnu.org; Mon, 15 Feb 2021 10:01:27 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-227-myrUuqnHMVGSwrhaAclwLQ-1; Mon, 15 Feb 2021 10:01:18 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8EBCB195D591; Mon, 15 Feb 2021 15:01:11 +0000 (UTC) Received: from merkur.fritz.box (ovpn-113-28.ams2.redhat.com [10.36.113.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9407D5C541; Mon, 15 Feb 2021 15:01:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613401284; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=k35JzbVoR82Qtyuyys0EzEN/KJORTjHaETatD7qz05g=; b=c0wb6JO87lQHAb+9RP8yBUz5UvMw0ecFJFzlMIvbpH055MgE9F8Zvb5LbkTQjInbO4/geH BSXkAHK8AA/mySDDjHmplZ/1izDa2zcRdYfr40T5p0RV2lhwRXD03j7pP/6jWmxAR8jf39 n5iTADjIqPwK0rJLwla2cRQ7na35dqE= X-MC-Unique: myrUuqnHMVGSwrhaAclwLQ-1 From: Kevin Wolf <kwolf@redhat.com> To: qemu-block@nongnu.org Subject: [PULL 06/11] tests/qemu-iotests: Remove test 259 from the "auto" group Date: Mon, 15 Feb 2021 16:00:55 +0100 Message-Id: <20210215150100.436555-7-kwolf@redhat.com> In-Reply-To: <20210215150100.436555-1-kwolf@redhat.com> References: <20210215150100.436555-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kwolf@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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+importer=patchew.org@nongnu.org> X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Thomas Huth <thuth@redhat.com> Tests in the "auto" group should support qcow2 so that they can be run during "make check-block". Test 259 only supports "raw", so it currently always gets skipped when running "make check-block". Let's skip this unnecessary step and remove it from the auto group. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <20210215103835.1129145-1-thuth@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- tests/qemu-iotests/259 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/259 b/tests/qemu-iotests/259 index 76cde429c4..1b15e8fb48 100755 --- a/tests/qemu-iotests/259 +++ b/tests/qemu-iotests/259 @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# group: rw auto quick +# group: rw quick # # Test generic image creation fallback (by using NBD) # --=20 2.29.2 From nobody Thu Apr 17 06:50:30 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1613402017; cv=none; d=zohomail.com; s=zohoarc; b=mRjeJ19eSNwPXgj3r87HcbHELDxk8Yx8VLMMgnyK/u/y1QxbTP+hpvhrpeLT+9gcWJdZtWO5aotolezVCUhsdRlSEpiw4lUZW0LgtdLcdFqVDJDZLBrmQrxYlht6tKw6ldvOlnsgjd2yL+FGg0AmA8+JnzV1HkZcpbs/9O1jxm8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613402017; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Ox/f69FutJ83bJcyl/YFXYEVbFadZao3aKT0i1AU1go=; b=O04V2XnVYiO47KEVt+S1InrjOphyNV8s92jJ/jV47LME+FXKspJiCpvERIpQ53ac1jT7fR7OuGBN4MHHlTOX9m9vycw5CGkYR2xMxtB1rdlLnW0Us31bpltv7SJmNgqm0k34eDfKcpzcb1usKf8x0fGAXtFcgPlHwhwpfnfFxBM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from=<kwolf@redhat.com> (p=none dis=none) header.from=<kwolf@redhat.com> Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1613402017366640.7729647817575; Mon, 15 Feb 2021 07:13:37 -0800 (PST) Received: from localhost ([::1]:37924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+importer=patchew.org@nongnu.org>) id 1lBfZ9-0001m0-WF for importer@patchew.org; Mon, 15 Feb 2021 10:13:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55428) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <kwolf@redhat.com>) id 1lBfNn-0005nV-B6 for qemu-devel@nongnu.org; Mon, 15 Feb 2021 10:01:51 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:32481) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from <kwolf@redhat.com>) id 1lBfNW-0000rh-UY for qemu-devel@nongnu.org; Mon, 15 Feb 2021 10:01:49 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-586-AYGR_aFXOr23ZawhYNVccw-1; Mon, 15 Feb 2021 10:01:22 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D2152189CD30; Mon, 15 Feb 2021 15:01:12 +0000 (UTC) Received: from merkur.fritz.box (ovpn-113-28.ams2.redhat.com [10.36.113.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id D77495C241; Mon, 15 Feb 2021 15:01:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613401294; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ox/f69FutJ83bJcyl/YFXYEVbFadZao3aKT0i1AU1go=; b=RrP4YothTVxb3+dDGzDP+jWex5WS8DOdBPSHPYDfC3TWbc/7DMUvcCFOTx2SoxCXi9N+im 9zVOwKlvGoAwt15shcJ3Qw03ml3lg6XzjFBZXMaqK5Mq3I+wtuY9HI43J9I6/tJDSXA4TG N5ZLzpUTPnbiC8UU9MpkItadSXF225Y= X-MC-Unique: AYGR_aFXOr23ZawhYNVccw-1 From: Kevin Wolf <kwolf@redhat.com> To: qemu-block@nongnu.org Subject: [PULL 07/11] crypto: luks: Fix tiny memory leak Date: Mon, 15 Feb 2021 16:00:56 +0100 Message-Id: <20210215150100.436555-8-kwolf@redhat.com> In-Reply-To: <20210215150100.436555-1-kwolf@redhat.com> References: <20210215150100.436555-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=kwolf@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, 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 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+importer=patchew.org@nongnu.org> X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Maxim Levitsky <mlevitsk@redhat.com> When the underlying block device doesn't support the bdrv_co_delete_file interface, an 'Error' object was leaked. Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <20201217170904.946013-2-mlevitsk@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- block/crypto.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/crypto.c b/block/crypto.c index aef5a5721a..b3a5275132 100644 --- a/block/crypto.c +++ b/block/crypto.c @@ -735,6 +735,8 @@ fail: */ if ((r_del < 0) && (r_del !=3D -ENOTSUP)) { error_report_err(local_delete_err); + } else { + error_free(local_delete_err); } } =20 --=20 2.29.2 From nobody Thu Apr 17 06:50:30 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1613402067; cv=none; d=zohomail.com; s=zohoarc; b=ZulAG6AqJvxVCpVjOKLjEospU4nGgGC/tTCv+V/dmASxMjJIj+FiGvLUaJqde2stXyv7+4B4VMrpJ5wKnbVQ5XbqIaHz2Iw/d/GCHoaeiVpfE9BQRuk2Rx2oaDhO8gAJ8iQYDwtisLXzV7b1whMoy9JnaeBb6NaRasgNPo2KwR0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613402067; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=E3GCvsC8yveEyfHJFXKD8eW8I0U03JjgHVmJiZV9zH8=; b=MbyMNuLV0Wysr+1lVbyMh6t1/gB7ktm2P8zgJUY274cW44ZpOGWcOG8R2FxxuozKNmHf9cid7wIgy+ysQIoyAmJBXeQY6yJc87wJjzEOgQOt5xTxgSoMBEFUn8IXuO0slc4YdBUN2ucaUDtUttXr5mMVYqG3Mr9USrUZfmspjTU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from=<kwolf@redhat.com> (p=none dis=none) header.from=<kwolf@redhat.com> Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1613402067105114.44004542211962; Mon, 15 Feb 2021 07:14:27 -0800 (PST) Received: from localhost ([::1]:41340 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+importer=patchew.org@nongnu.org>) id 1lBfZy-000383-14 for importer@patchew.org; Mon, 15 Feb 2021 10:14:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55378) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <kwolf@redhat.com>) id 1lBfNf-0005lC-Ig for qemu-devel@nongnu.org; Mon, 15 Feb 2021 10:01:47 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:26295) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from <kwolf@redhat.com>) id 1lBfNR-0000pd-CO for qemu-devel@nongnu.org; Mon, 15 Feb 2021 10:01:38 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-481-2YkgHUXuORS8flTVm4CVpQ-1; Mon, 15 Feb 2021 10:01:23 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 224F484F20C; Mon, 15 Feb 2021 15:01:14 +0000 (UTC) Received: from merkur.fritz.box (ovpn-113-28.ams2.redhat.com [10.36.113.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2856E69338; Mon, 15 Feb 2021 15:01:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613401288; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=E3GCvsC8yveEyfHJFXKD8eW8I0U03JjgHVmJiZV9zH8=; b=cxw4ib1e5qZXvWBkUehm9ut2D06n3QYYQJYgLg0vuuneH+eVb8M6pSjUVwsoh6wn1lz4jh N3j3IwK1i1phRBVcEmoXOE0pWdYYw6BlfQoGDq4XXsjYPvCzi3O+xNf5bCCNBoM1KR99xz v4MdFAsxAW8KBC9IJWkAHvhep0vOo6k= X-MC-Unique: 2YkgHUXuORS8flTVm4CVpQ-1 From: Kevin Wolf <kwolf@redhat.com> To: qemu-block@nongnu.org Subject: [PULL 08/11] block: add bdrv_co_delete_file_noerr Date: Mon, 15 Feb 2021 16:00:57 +0100 Message-Id: <20210215150100.436555-9-kwolf@redhat.com> In-Reply-To: <20210215150100.436555-1-kwolf@redhat.com> References: <20210215150100.436555-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kwolf@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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+importer=patchew.org@nongnu.org> X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Maxim Levitsky <mlevitsk@redhat.com> This function wraps bdrv_co_delete_file for the common case of removing a f= ile, which was just created by format driver, on an error condition. It hides the -ENOTSUPP error, and reports all other errors otherwise. Use it in luks driver Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Message-Id: <20201217170904.946013-3-mlevitsk@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- include/block/block.h | 1 + block.c | 22 ++++++++++++++++++++++ block/crypto.c | 15 ++------------- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/include/block/block.h b/include/block/block.h index a9b7f03f11..b3f6e509d4 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -441,6 +441,7 @@ int bdrv_freeze_backing_chain(BlockDriverState *bs, Blo= ckDriverState *base, Error **errp); void bdrv_unfreeze_backing_chain(BlockDriverState *bs, BlockDriverState *b= ase); int coroutine_fn bdrv_co_delete_file(BlockDriverState *bs, Error **errp); +void coroutine_fn bdrv_co_delete_file_noerr(BlockDriverState *bs); =20 =20 typedef struct BdrvCheckResult { diff --git a/block.c b/block.c index c682c3e3b9..a1f3cecd75 100644 --- a/block.c +++ b/block.c @@ -706,6 +706,28 @@ int coroutine_fn bdrv_co_delete_file(BlockDriverState = *bs, Error **errp) return ret; } =20 +void coroutine_fn bdrv_co_delete_file_noerr(BlockDriverState *bs) +{ + Error *local_err =3D NULL; + int ret; + + if (!bs) { + return; + } + + ret =3D bdrv_co_delete_file(bs, &local_err); + /* + * ENOTSUP will happen if the block driver doesn't support + * the 'bdrv_co_delete_file' interface. This is a predictable + * scenario and shouldn't be reported back to the user. + */ + if (ret =3D=3D -ENOTSUP) { + error_free(local_err); + } else if (ret < 0) { + error_report_err(local_err); + } +} + /** * Try to get @bs's logical and physical block size. * On success, store them in @bsz struct and return 0. diff --git a/block/crypto.c b/block/crypto.c index b3a5275132..1d30fde38e 100644 --- a/block/crypto.c +++ b/block/crypto.c @@ -725,19 +725,8 @@ fail: * If an error occurred, delete 'filename'. Even if the file existed * beforehand, it has been truncated and corrupted in the process. */ - if (ret && bs) { - Error *local_delete_err =3D NULL; - int r_del =3D bdrv_co_delete_file(bs, &local_delete_err); - /* - * ENOTSUP will happen if the block driver doesn't support - * the 'bdrv_co_delete_file' interface. This is a predictable - * scenario and shouldn't be reported back to the user. - */ - if ((r_del < 0) && (r_del !=3D -ENOTSUP)) { - error_report_err(local_delete_err); - } else { - error_free(local_delete_err); - } + if (ret) { + bdrv_co_delete_file_noerr(bs); } =20 bdrv_unref(bs); --=20 2.29.2 From nobody Thu Apr 17 06:50:30 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1613401756; cv=none; d=zohomail.com; s=zohoarc; b=QtkdERhjMtYFrkyGnQYRE+p1EcG5K9/vCSIvGG+7hxAerL3H5RCA9eRg98WOUvuQhrKC8bo/T0zuwcYyII2m2v8I9PQmpW7BaRbsK9BFrbRh+dR0SdvfXq9ib/J5ZC4F4xPIIslko6FB7mFJNJPFe3/A2DmBCH5zxPm9DJOH1kI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613401756; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CBTRNqmafznyYCVZMQP0yfudKciY85Jk+uk/dwgJ4n0=; b=FKBzwLjSw9ZLYLvRcTshsLQ31dyADuJSR0bQLsL7XcBN85uGPq0QoiMYQp7m6j+lQcCbcnstWcuC0auqjLsbmoeeL78zNPaL58aXfBNT6NY9dtndqt4w8ioKDG7E5XdVfUKcrUafmQ3Rl2tKoguG9kFu2z1wVjtFiJktiktCq3c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from=<kwolf@redhat.com> (p=none dis=none) header.from=<kwolf@redhat.com> Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1613401755794169.9887163708654; Mon, 15 Feb 2021 07:09:15 -0800 (PST) Received: from localhost ([::1]:50844 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+importer=patchew.org@nongnu.org>) id 1lBfUw-0003sg-H0 for importer@patchew.org; Mon, 15 Feb 2021 10:09:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55342) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <kwolf@redhat.com>) id 1lBfNX-0005ky-4S for qemu-devel@nongnu.org; Mon, 15 Feb 2021 10:01:43 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:43893) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from <kwolf@redhat.com>) id 1lBfNP-0000pH-Ge for qemu-devel@nongnu.org; Mon, 15 Feb 2021 10:01:31 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-578-MQZ0lMWdMBOAjg7vIsbA0w-1; Mon, 15 Feb 2021 10:01:24 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6257E814738; Mon, 15 Feb 2021 15:01:15 +0000 (UTC) Received: from merkur.fritz.box (ovpn-113-28.ams2.redhat.com [10.36.113.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6AF685C233; Mon, 15 Feb 2021 15:01:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613401286; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CBTRNqmafznyYCVZMQP0yfudKciY85Jk+uk/dwgJ4n0=; b=ELnOiotBEXzwB3bXgnj9Pq9lgs2H5Mq4zxJIb7QWu82igPh4sf7vxB5wX3NQanlZbJYiFr w3iTre/lDjG3vk/shLaIgJC62rNnUUcM0y9eIAM3bLOgQH7/48NJu8rzFtNbxQpgxfkljx drrp1fIRvfkPozcP+gpDNOJoGG3ZjcM= X-MC-Unique: MQZ0lMWdMBOAjg7vIsbA0w-1 From: Kevin Wolf <kwolf@redhat.com> To: qemu-block@nongnu.org Subject: [PULL 09/11] block: qcow2: remove the created file on initialization error Date: Mon, 15 Feb 2021 16:00:58 +0100 Message-Id: <20210215150100.436555-10-kwolf@redhat.com> In-Reply-To: <20210215150100.436555-1-kwolf@redhat.com> References: <20210215150100.436555-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=kwolf@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, 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 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+importer=patchew.org@nongnu.org> X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Maxim Levitsky <mlevitsk@redhat.com> If the qcow initialization fails, we should remove the file if it was already created, to avoid leaving stale files around. We already do this for luks raw images. Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Message-Id: <20201217170904.946013-4-mlevitsk@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- block/qcow2.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 5d94f45be9..d9f49a52e7 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -3846,12 +3846,14 @@ static int coroutine_fn qcow2_co_create_opts(BlockD= river *drv, =20 /* Create the qcow2 image (format layer) */ ret =3D qcow2_co_create(create_options, errp); +finish: if (ret < 0) { - goto finish; + bdrv_co_delete_file_noerr(bs); + bdrv_co_delete_file_noerr(data_bs); + } else { + ret =3D 0; } =20 - ret =3D 0; -finish: qobject_unref(qdict); bdrv_unref(bs); bdrv_unref(data_bs); --=20 2.29.2 From nobody Thu Apr 17 06:50:30 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1613401864; cv=none; d=zohomail.com; s=zohoarc; b=UjMdecfMpodFrsjCFtToE7YQW6SgU0Oul0hf8nwC5UBXQjoUC4NH8TgkGHeq+Tiqos3UDzSA+xywmgnqaZ038rVjBOentRvWGNN/n+5IqEOgmEy8hooVyYwWEqCrKy7sZ6anok/ClzClxkaqhr/9ApW72jQkerinzDR92ya96XI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613401864; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LQuK7B1zQjPnR1Or4CfzlmST0ttXFEex4jpU9vIz9uE=; b=Kx8zGr3skLBqPejzpy5L7VJLMExcucR7b52Vc8DKMGpmZjhQahBMG23/uOWTHFcjFvYJXoIdVv3tyFisUVhIYZF5RVQL4R4givQ5Y62NZ1+nAZPd1///K+NVbQPosQC6VzsNg5hLLO8XcH+iXUSLNVV81Kd1s6/dOhEcj49pffg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from=<kwolf@redhat.com> (p=none dis=none) header.from=<kwolf@redhat.com> Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1613401863987417.67964692753435; Mon, 15 Feb 2021 07:11:03 -0800 (PST) Received: from localhost ([::1]:57244 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+importer=patchew.org@nongnu.org>) id 1lBfWg-0006Yl-Jd for importer@patchew.org; Mon, 15 Feb 2021 10:11:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55404) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <kwolf@redhat.com>) id 1lBfNj-0005lY-9J for qemu-devel@nongnu.org; Mon, 15 Feb 2021 10:01:49 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:23127) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from <kwolf@redhat.com>) id 1lBfNR-0000qV-QX for qemu-devel@nongnu.org; Mon, 15 Feb 2021 10:01:45 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-51-DS_ofvzlNrWf9JP_HATm5w-1; Mon, 15 Feb 2021 10:01:25 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B8382107ACED; Mon, 15 Feb 2021 15:01:16 +0000 (UTC) Received: from merkur.fritz.box (ovpn-113-28.ams2.redhat.com [10.36.113.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id AB2A05C233; Mon, 15 Feb 2021 15:01:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613401289; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LQuK7B1zQjPnR1Or4CfzlmST0ttXFEex4jpU9vIz9uE=; b=WhvJU2svNwIsrKNwauZXns5GTCZejar2+vFUHCPawQv3823a2YBUoPI3+jcK0NXcN/WIXd g8+1swcCVkUCXhmME1vgMRLJOStuKeNxK1EG1qH//wNDeCPR/92BuSM9zhPlrMVFjIS+TF qBFlradE2JCi+H5WP5DhJotM9YGPR3k= X-MC-Unique: DS_ofvzlNrWf9JP_HATm5w-1 From: Kevin Wolf <kwolf@redhat.com> To: qemu-block@nongnu.org Subject: [PULL 10/11] monitor: Fix assertion failure on shutdown Date: Mon, 15 Feb 2021 16:00:59 +0100 Message-Id: <20210215150100.436555-11-kwolf@redhat.com> In-Reply-To: <20210215150100.436555-1-kwolf@redhat.com> References: <20210215150100.436555-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kwolf@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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+importer=patchew.org@nongnu.org> X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Commit 357bda95 already tried to fix the order in monitor_cleanup() by moving shutdown of the dispatcher coroutine further to the start. However, it didn't go far enough: iothread_stop() makes sure that all pending work (bottom halves) in the AioContext of the monitor iothread is completed. iothread_destroy() depends on this and fails an assertion if there is still a pending BH. While the dispatcher coroutine is running, it will try to resume the monitor after taking a request out of the queue, which involves a BH. The dispatcher is run until it terminates in the AIO_WAIT_WHILE() loop. However, adding new BHs between iothread_stop() and iothread_destroy() is forbidden. Fix this by stopping the dispatcher first before shutting down the other parts of the monitor. This means we can now receive requests that aren't handled any more when QEMU is shutting down, but this is unlikely to be a problem for QMP clients. Fixes: 357bda9590784ff75803d52de43150d4107ed98e Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20210212172028.288825-2-kwolf@redhat.com> Tested-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- monitor/monitor.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/monitor/monitor.c b/monitor/monitor.c index 1e4a6b3f20..e94f532cf5 100644 --- a/monitor/monitor.c +++ b/monitor/monitor.c @@ -618,16 +618,6 @@ void monitor_data_destroy(Monitor *mon) =20 void monitor_cleanup(void) { - /* - * We need to explicitly stop the I/O thread (but not destroy it), - * clean up the monitor resources, then destroy the I/O thread since - * we need to unregister from chardev below in - * monitor_data_destroy(), and chardev is not thread-safe yet - */ - if (mon_iothread) { - iothread_stop(mon_iothread); - } - /* * The dispatcher needs to stop before destroying the monitor and * the I/O thread. @@ -637,6 +627,11 @@ void monitor_cleanup(void) * eventually terminates. qemu_aio_context is automatically * polled by calling AIO_WAIT_WHILE on it, but we must poll * iohandler_ctx manually. + * + * Letting the iothread continue while shutting down the dispatcher + * means that new requests may still be coming in. This is okay, + * we'll just leave them in the queue without sending a response + * and monitor_data_destroy() will free them. */ qmp_dispatcher_co_shutdown =3D true; if (!qatomic_xchg(&qmp_dispatcher_co_busy, true)) { @@ -647,6 +642,16 @@ void monitor_cleanup(void) (aio_poll(iohandler_get_aio_context(), false), qatomic_mb_read(&qmp_dispatcher_co_busy))); =20 + /* + * We need to explicitly stop the I/O thread (but not destroy it), + * clean up the monitor resources, then destroy the I/O thread since + * we need to unregister from chardev below in + * monitor_data_destroy(), and chardev is not thread-safe yet + */ + if (mon_iothread) { + iothread_stop(mon_iothread); + } + /* Flush output buffers and destroy monitors */ qemu_mutex_lock(&monitor_lock); monitor_destroyed =3D true; --=20 2.29.2 From nobody Thu Apr 17 06:50:30 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1613401826708796.3665863157504; Mon, 15 Feb 2021 07:10:26 -0800 (PST) Received: from localhost ([::1]:54358 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+importer=patchew.org@nongnu.org>) id 1lBfW5-0005JW-HL for importer@patchew.org; Mon, 15 Feb 2021 10:10:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55374) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <kwolf@redhat.com>) id 1lBfNf-0005lA-Iy for qemu-devel@nongnu.org; Mon, 15 Feb 2021 10:01:47 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:34383) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from <kwolf@redhat.com>) id 1lBfNT-0000ql-8W for qemu-devel@nongnu.org; Mon, 15 Feb 2021 10:01:38 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-75-Cw0lJMFhOfq93YRQficYqQ-1; Mon, 15 Feb 2021 10:01:25 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 05236107ACE4; Mon, 15 Feb 2021 15:01:18 +0000 (UTC) Received: from merkur.fritz.box (ovpn-113-28.ams2.redhat.com [10.36.113.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0DB825C241; Mon, 15 Feb 2021 15:01:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613401290; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9AATnQ9oZvmASp229ljJOk0MKvRpqmAD1e9I6Kd58WE=; b=bWjdpj67Q/S5FCd9RRu/tYYP4WbCZww/eG1fAzT8pAAW0bfoX7CDB3qmarjXHMs1QdCZlL TH4RJhYdnL+7PksX8xoqUo6vtooxe8ydR1p7mnba7c2CA47malKNWBYgYEcr4x7xHok9T5 P0n6rK4DFWu1FqBSKTkv8+PL05nsEU8= X-MC-Unique: Cw0lJMFhOfq93YRQficYqQ-1 From: Kevin Wolf <kwolf@redhat.com> To: qemu-block@nongnu.org Subject: [PULL 11/11] monitor/qmp: Stop processing requests when shutdown is requested Date: Mon, 15 Feb 2021 16:01:00 +0100 Message-Id: <20210215150100.436555-12-kwolf@redhat.com> In-Reply-To: <20210215150100.436555-1-kwolf@redhat.com> References: <20210215150100.436555-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kwolf@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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+importer=patchew.org@nongnu.org> X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Before this patch, monitor_qmp_dispatcher_co() used to check whether shutdown is requested only when it would have to wait for new requests. If there were still some queued requests, it would try to execute all of them before shutting down. This can be surprising when the queued QMP commands take long or hang because Ctrl-C may not actually exit QEMU as soon as possible. Change monitor_qmp_dispatcher_co() so that it additionally checks whether shutdown is request before it gets a new request from the queue. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20210212172028.288825-3-kwolf@redhat.com> Tested-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- monitor/qmp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/monitor/qmp.c b/monitor/qmp.c index 43880fa623..2326bd7f9b 100644 --- a/monitor/qmp.c +++ b/monitor/qmp.c @@ -227,6 +227,11 @@ void coroutine_fn monitor_qmp_dispatcher_co(void *data) */ qatomic_mb_set(&qmp_dispatcher_co_busy, false); =20 + /* On shutdown, don't take any more requests from the queue */ + if (qmp_dispatcher_co_shutdown) { + return; + } + while (!(req_obj =3D monitor_qmp_requests_pop_any_with_lock())) { /* * No more requests to process. Wait to be reentered from --=20 2.29.2