From patchwork Tue Feb 2 16:28:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 12062215 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-21.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D864FC433E0 for ; Tue, 2 Feb 2021 16:32:40 +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 4913364F72 for ; Tue, 2 Feb 2021 16:32:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4913364F72 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:44942 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6ybX-0008F8-5Y for qemu-devel@archiver.kernel.org; Tue, 02 Feb 2021 11:32:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52344) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6yY2-00052z-Da for qemu-devel@nongnu.org; Tue, 02 Feb 2021 11:29:02 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:51929) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l6yY0-00007e-CE for qemu-devel@nongnu.org; Tue, 02 Feb 2021 11:29:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612283338; 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=o6HA8KRX94IUV2KQn8TjkiJmaisKGKRWWej3xJ7KVkI=; b=c2igILMTJWif4oMJu1d/PEKBRgf2JI8l/tQGaa9lrsrUQEW3zXnUhkdbId9aomar8GLGVL o3i5gMDzj5p8ldH0NOJSjTxuCCfcvzSLBSyj7vOS6bZyIjzXLMDrVQm7P+L1ifM+gENRPO q7l326oQKFnxxRvKb1UB1MqFrRKUOZA= 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-361-Ya0phNSkP120uqHHeSwK9A-1; Tue, 02 Feb 2021 11:28:54 -0500 X-MC-Unique: Ya0phNSkP120uqHHeSwK9A-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 174A719611BC; Tue, 2 Feb 2021 16:28:53 +0000 (UTC) Received: from merkur.fritz.box (ovpn-112-19.ams2.redhat.com [10.36.112.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6C9877EA92; Tue, 2 Feb 2021 16:28:50 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL v2 01/10] MAINTAINERS: Add Vladimir as co-maintainer for Block Jobs Date: Tue, 2 Feb 2021 17:28:25 +0100 Message-Id: <20210202162834.269789-2-kwolf@redhat.com> In-Reply-To: <20210202162834.269789-1-kwolf@redhat.com> References: <20210202162834.269789-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.386, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Vladimir Sementsov-Ogievskiy I'm developing Qemu backup for several years, and finally new backup architecture, including block-copy generic engine and backup-top filter landed upstream, great thanks to reviewers and especially to Max Reitz! I also have plans of moving other block-jobs onto block-copy, so that we finally have one generic block copying path, fast and well-formed. So, now I suggest to bring all parts of backup architecture into "Block Jobs" subsystem (actually, aio_task is shared with qcow2 and qemu-co-shared-resource can be reused somewhere else, but I'd keep an eye on them in context of block-jobs) and add myself as co-maintainer. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20210128144144.27617-1-vsementsov@virtuozzo.com> Reviewed-by: Markus Armbruster Reviewed-by: John Snow Reviewed-by: Max Reitz Signed-off-by: Kevin Wolf --- MAINTAINERS | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index bcd88668bc..00626941f1 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2210,6 +2210,7 @@ F: scsi/* Block Jobs M: John Snow +M: Vladimir Sementsov-Ogievskiy L: qemu-block@nongnu.org S: Supported F: blockjob.c @@ -2222,7 +2223,16 @@ F: block/commit.c F: block/stream.c F: block/mirror.c F: qapi/job.json +F: block/block-copy.c +F: include/block/block-copy.c +F: block/backup-top.h +F: block/backup-top.c +F: include/block/aio_task.h +F: block/aio_task.c +F: util/qemu-co-shared-resource.c +F: include/qemu/co-shared-resource.h T: git https://gitlab.com/jsnow/qemu.git jobs +T: git https://src.openvz.org/scm/~vsementsov/qemu.git jobs Block QAPI, monitor, command line M: Markus Armbruster From patchwork Tue Feb 2 16:28:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 12062275 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5F37C433DB for ; Tue, 2 Feb 2021 16:48:34 +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 1A67364F64 for ; Tue, 2 Feb 2021 16:48:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1A67364F64 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:43520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6yqu-0003hg-Rq for qemu-devel@archiver.kernel.org; Tue, 02 Feb 2021 11:48:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52416) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6yY8-00057Q-Jy for qemu-devel@nongnu.org; Tue, 02 Feb 2021 11:29:09 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:47064) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l6yY1-00009f-TC for qemu-devel@nongnu.org; Tue, 02 Feb 2021 11:29:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612283341; 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=/UPzXrJ27AqJD479c69kO56oBloOrR2rW0hBBE0pdeM=; b=EhxEsFa95x0GZYjPjd+6ZOyO1SwbQPjVaGsaufpn0uoWRFUZ2NSOxfXzxo0vTAtZljSZXo BUXjmDEr4TBQWHlf7o9Sk3S1eLIr/wxhyclsiMiw15DcGtN5PeUmT/bKgKQGsb8nhE9HsX 7ZadmNbrzxQyirEPvfH56vUMWMUjKxk= 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-242-7XRkl_aKM4mOVrlfLzYVIw-1; Tue, 02 Feb 2021 11:28:57 -0500 X-MC-Unique: 7XRkl_aKM4mOVrlfLzYVIw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0839F80B727; Tue, 2 Feb 2021 16:28:56 +0000 (UTC) Received: from merkur.fritz.box (ovpn-112-19.ams2.redhat.com [10.36.112.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6027C5D749; Tue, 2 Feb 2021 16:28:53 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL v2 02/10] block: Avoid processing BDS twice in bdrv_set_aio_context_ignore() Date: Tue, 2 Feb 2021 17:28:26 +0100 Message-Id: <20210202162834.269789-3-kwolf@redhat.com> In-Reply-To: <20210202162834.269789-1-kwolf@redhat.com> References: <20210202162834.269789-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 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: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Sergio Lopez Some graphs may contain an indirect reference to the first BDS in the chain that can be reached while walking it bottom->up from one its children. Doubling-processing of a BDS is especially problematic for the aio_notifiers, as they might attempt to work on both the old and the new AIO contexts. To avoid this problem, add every child and parent to the ignore list before actually processing them. Suggested-by: Kevin Wolf Signed-off-by: Sergio Lopez Message-Id: <20210201125032.44713-2-slp@redhat.com> Signed-off-by: Kevin Wolf --- block.c | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/block.c b/block.c index 91a66d4f3e..5c428e1595 100644 --- a/block.c +++ b/block.c @@ -6439,7 +6439,10 @@ void bdrv_set_aio_context_ignore(BlockDriverState *bs, AioContext *new_context, GSList **ignore) { AioContext *old_context = bdrv_get_aio_context(bs); - BdrvChild *child; + GSList *children_to_process = NULL; + GSList *parents_to_process = NULL; + GSList *entry; + BdrvChild *child, *parent; g_assert(qemu_get_current_aio_context() == qemu_get_aio_context()); @@ -6454,16 +6457,33 @@ void bdrv_set_aio_context_ignore(BlockDriverState *bs, continue; } *ignore = g_slist_prepend(*ignore, child); - bdrv_set_aio_context_ignore(child->bs, new_context, ignore); + children_to_process = g_slist_prepend(children_to_process, child); } - QLIST_FOREACH(child, &bs->parents, next_parent) { - if (g_slist_find(*ignore, child)) { + + QLIST_FOREACH(parent, &bs->parents, next_parent) { + if (g_slist_find(*ignore, parent)) { continue; } - assert(child->klass->set_aio_ctx); - *ignore = g_slist_prepend(*ignore, child); - child->klass->set_aio_ctx(child, new_context, ignore); + *ignore = g_slist_prepend(*ignore, parent); + parents_to_process = g_slist_prepend(parents_to_process, parent); + } + + for (entry = children_to_process; + entry != NULL; + entry = g_slist_next(entry)) { + child = entry->data; + bdrv_set_aio_context_ignore(child->bs, new_context, ignore); + } + g_slist_free(children_to_process); + + for (entry = parents_to_process; + entry != NULL; + entry = g_slist_next(entry)) { + parent = entry->data; + assert(parent->klass->set_aio_ctx); + parent->klass->set_aio_ctx(parent, new_context, ignore); } + g_slist_free(parents_to_process); bdrv_detach_aio_context(bs); From patchwork Tue Feb 2 16:28:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 12062243 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4B4BC433E9 for ; Tue, 2 Feb 2021 16:39:55 +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 3A8BD64F88 for ; Tue, 2 Feb 2021 16:39:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3A8BD64F88 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:60104 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6yiY-0006ey-4Y for qemu-devel@archiver.kernel.org; Tue, 02 Feb 2021 11:39:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52372) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6yY4-00055H-QC for qemu-devel@nongnu.org; Tue, 02 Feb 2021 11:29:04 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:21906) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l6yY2-00009n-Nl for qemu-devel@nongnu.org; Tue, 02 Feb 2021 11:29:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612283342; 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=Gij5QeqtyE8f4Gz34t7KEJ33X71FNsnrFRF6nodtYrk=; b=GkwnHOWnDoNyC75hky3Rg+79okdh2YrIrUeHJolOZEdGUfEMkOKFUAzdBWBkwx1HDgP/qa 4NajGa+qaC7uo4Sr/11/JouIpLRlknMFlKhiD7in3TYMVKPT0FPjdI8seg95vcdIC/BtNr X3yvNG3HZaE5qkTnObybyOZOjUxsk3E= 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-488-k_anpE2DP3yDQUEJTX7ShA-1; Tue, 02 Feb 2021 11:29:00 -0500 X-MC-Unique: k_anpE2DP3yDQUEJTX7ShA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ED46E107ACFB; Tue, 2 Feb 2021 16:28:58 +0000 (UTC) Received: from merkur.fritz.box (ovpn-112-19.ams2.redhat.com [10.36.112.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5255A5D749; Tue, 2 Feb 2021 16:28:56 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL v2 03/10] block: move blk_exp_close_all() to qemu_cleanup() Date: Tue, 2 Feb 2021 17:28:27 +0100 Message-Id: <20210202162834.269789-4-kwolf@redhat.com> In-Reply-To: <20210202162834.269789-1-kwolf@redhat.com> References: <20210202162834.269789-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.386, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Sergio Lopez Move blk_exp_close_all() from bdrv_close() to qemu_cleanup(), before bdrv_drain_all_begin(). Export drivers may have coroutines yielding at some point in the block layer, so we need to shut them down before draining the block layer, as otherwise they may get stuck blk_wait_while_drained(). RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1900505 Signed-off-by: Sergio Lopez Message-Id: <20210201125032.44713-3-slp@redhat.com> Signed-off-by: Kevin Wolf --- block.c | 1 - qemu-nbd.c | 1 + softmmu/runstate.c | 9 +++++++++ storage-daemon/qemu-storage-daemon.c | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/block.c b/block.c index 5c428e1595..4e52b1c588 100644 --- a/block.c +++ b/block.c @@ -4435,7 +4435,6 @@ static void bdrv_close(BlockDriverState *bs) void bdrv_close_all(void) { assert(job_next(NULL) == NULL); - blk_exp_close_all(); /* Drop references from requests still in flight, such as canceled block * jobs whose AIO context has not been polled yet */ diff --git a/qemu-nbd.c b/qemu-nbd.c index 0d513cb38c..608c63e82a 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -503,6 +503,7 @@ static const char *socket_activation_validate_opts(const char *device, static void qemu_nbd_shutdown(void) { job_cancel_sync_all(); + blk_exp_close_all(); bdrv_close_all(); } diff --git a/softmmu/runstate.c b/softmmu/runstate.c index beee050815..a7fcb603f7 100644 --- a/softmmu/runstate.c +++ b/softmmu/runstate.c @@ -25,6 +25,7 @@ #include "qemu/osdep.h" #include "audio/audio.h" #include "block/block.h" +#include "block/export.h" #include "chardev/char.h" #include "crypto/cipher.h" #include "crypto/init.h" @@ -784,6 +785,14 @@ void qemu_cleanup(void) */ migration_shutdown(); + /* + * Close the exports before draining the block layer. The export + * drivers may have coroutines yielding on it, so we need to clean + * them up before the drain, as otherwise they may be get stuck in + * blk_wait_while_drained(). + */ + blk_exp_close_all(); + /* * We must cancel all block jobs while the block layer is drained, * or cancelling will be affected by throttling and thus may block diff --git a/storage-daemon/qemu-storage-daemon.c b/storage-daemon/qemu-storage-daemon.c index e0c87edbdd..d8d172cc60 100644 --- a/storage-daemon/qemu-storage-daemon.c +++ b/storage-daemon/qemu-storage-daemon.c @@ -314,6 +314,7 @@ int main(int argc, char *argv[]) main_loop_wait(false); } + blk_exp_close_all(); bdrv_drain_all_begin(); bdrv_close_all(); From patchwork Tue Feb 2 16:28:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 12062295 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E82DBC433E0 for ; Tue, 2 Feb 2021 16:52:09 +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 5548964E3F for ; Tue, 2 Feb 2021 16:52:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5548964E3F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:51226 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6yuN-0007ax-S0 for qemu-devel@archiver.kernel.org; Tue, 02 Feb 2021 11:52:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52468) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6yYD-00058k-MC for qemu-devel@nongnu.org; Tue, 02 Feb 2021 11:29:13 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:58368) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l6yY8-0000DS-8K for qemu-devel@nongnu.org; Tue, 02 Feb 2021 11:29:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612283347; 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=x+Io9i83GPm6P+bB5eHK+MVUhvNuLf4Qi0NXyUQtYnw=; b=CJQjQ6fqGAeafkVIPKU4QaiSqkfuo+mzMIyXDODASFUcq3dAbR4rChLLZRYS8ulOvb4wPl HYUaEGrH7G21LolwkQzX+EwHeFt3br6goAKqcZcEdoJ7fcnNj4Qt5EqgnFhBLpNwlkwLKV I6SLqo0UaECj1eSXLCUCorcKEKzTcLg= 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-516-h45aB3qsNlWw0FZ0gyochQ-1; Tue, 02 Feb 2021 11:29:03 -0500 X-MC-Unique: h45aB3qsNlWw0FZ0gyochQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0677D80DDF8; Tue, 2 Feb 2021 16:29:02 +0000 (UTC) Received: from merkur.fritz.box (ovpn-112-19.ams2.redhat.com [10.36.112.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 41E915D749; Tue, 2 Feb 2021 16:28:59 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL v2 04/10] iotests/297: pylint: ignore too many statements Date: Tue, 2 Feb 2021 17:28:28 +0100 Message-Id: <20210202162834.269789-5-kwolf@redhat.com> In-Reply-To: <20210202162834.269789-1-kwolf@redhat.com> References: <20210202162834.269789-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.386, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Vladimir Sementsov-Ogievskiy Ignore two complains, which now lead to 297 failure on testenv.py and testrunner.py. Fixes: 2e5a2f57db481f18fcf70be2a36b1417370b8476 Fixes: d74c754c924ca34e90b7c96ce2f5609d82c0e628 Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20210129161323.615027-1-vsementsov@virtuozzo.com> Reviewed-by: John Snow Signed-off-by: Kevin Wolf --- tests/qemu-iotests/pylintrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/qemu-iotests/pylintrc b/tests/qemu-iotests/pylintrc index cd3702e23c..7a6c0a9474 100644 --- a/tests/qemu-iotests/pylintrc +++ b/tests/qemu-iotests/pylintrc @@ -21,6 +21,8 @@ disable=invalid-name, unsubscriptable-object, # These are temporary, and should be removed: missing-docstring, + too-many-return-statements, + too-many-statements [FORMAT] From patchwork Tue Feb 2 16:28:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 12062271 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D07D4C433E0 for ; Tue, 2 Feb 2021 16:43:57 +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 513BF64F7B for ; Tue, 2 Feb 2021 16:43:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 513BF64F7B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:38142 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6ymS-00017c-8A for qemu-devel@archiver.kernel.org; Tue, 02 Feb 2021 11:43:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52470) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6yYD-00058u-Tu for qemu-devel@nongnu.org; Tue, 02 Feb 2021 11:29:13 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:25176) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l6yY8-0000Dp-MW for qemu-devel@nongnu.org; Tue, 02 Feb 2021 11:29:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612283348; 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=9qFHNOE+wMaVxXmCw7gv0O77gRUAN7x+2bg9GawzKbQ=; b=bKqlbjWJcehctxT5mRL4AAc0BfdMY6ndXb9fNa3xoK7TknfO4eY13X40NhwcQQ69z9/gIH IFAdZp2tb8N8/k3BsIfA9DnBoUQg/SCRCaI7jOdFqTzQa4xN0JRp8Bw/D0ZQz3dRHZpsb9 tXU1YJBixK/FL1yfbn7kR7UJvJYP/HU= 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-444-bcGFp4AuOsSReHIqvtsmGA-1; Tue, 02 Feb 2021 11:29:06 -0500 X-MC-Unique: bcGFp4AuOsSReHIqvtsmGA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 080941083E8F; Tue, 2 Feb 2021 16:29:05 +0000 (UTC) Received: from merkur.fritz.box (ovpn-112-19.ams2.redhat.com [10.36.112.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4F1B57EA8A; Tue, 2 Feb 2021 16:29:02 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL v2 05/10] iotests: Revert emulator selection to old behaviour Date: Tue, 2 Feb 2021 17:28:29 +0100 Message-Id: <20210202162834.269789-6-kwolf@redhat.com> In-Reply-To: <20210202162834.269789-1-kwolf@redhat.com> References: <20210202162834.269789-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.386, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" If the qemu-system-{arch} binary for the host architecture can't be found, the old 'check' implementation selected the alphabetically first system emulator binary that it could find. The new Python implementation just uses the first result of glob.iglob(), which has an undefined order. This is a problem that breaks CI because the iotests aren't actually prepared to run on any emulator. They should be, so this is really a bug in the failing test cases that should be fixed there, but as a quick fix, let's revert to the old behaviour to let CI runs succeed again. Signed-off-by: Kevin Wolf Message-Id: <20210202142802.119999-1-kwolf@redhat.com> Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- tests/qemu-iotests/testenv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py index b31275f518..1fbec854c1 100644 --- a/tests/qemu-iotests/testenv.py +++ b/tests/qemu-iotests/testenv.py @@ -135,7 +135,7 @@ class TestEnv(ContextManager['TestEnv']): if not os.path.exists(self.qemu_prog): pattern = root('qemu-system-*') try: - progs = glob.iglob(pattern) + progs = sorted(glob.iglob(pattern)) self.qemu_prog = next(p for p in progs if isxfile(p)) except StopIteration: sys.exit("Not found any Qemu executable binary by pattern " From patchwork Tue Feb 2 16:28:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 12062333 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 779CCC433E0 for ; Tue, 2 Feb 2021 17:02: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 F01EB64E3F for ; Tue, 2 Feb 2021 17:01:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F01EB64E3F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:38072 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6z3u-0006El-TA for qemu-devel@archiver.kernel.org; Tue, 02 Feb 2021 12:01:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52622) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6yYR-0005fQ-34 for qemu-devel@nongnu.org; Tue, 02 Feb 2021 11:29:27 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:56951) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l6yYO-0000Lb-L2 for qemu-devel@nongnu.org; Tue, 02 Feb 2021 11:29:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612283364; 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=cSrh8DpqUPbw6Eh5CY3/TMs7gvPWCQ4tRhHELYHGwMc=; b=PgaX5gOrAxj5B/5IuS6j1v+yoIPdqFB42XLxlVHUPk+QttPlPq4qZCtNeKVe+B6XD60Bo1 C0KuL8DEsXaMVOCYENzonM9SXf/I/U2L9orQZY8NBBZT2dd0oxtFWwsh73hoavq/byk+qA 1Q2UZ7wKhQTihKiw+RA5QT1HEoQ1IKQ= 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-381-T4NlXKHcMVePJ0trkKR_kA-1; Tue, 02 Feb 2021 11:29:09 -0500 X-MC-Unique: T4NlXKHcMVePJ0trkKR_kA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DF7BE107ACE4; Tue, 2 Feb 2021 16:29:07 +0000 (UTC) Received: from merkur.fritz.box (ovpn-112-19.ams2.redhat.com [10.36.112.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 520865D749; Tue, 2 Feb 2021 16:29:05 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL v2 06/10] iotests: check: return 1 on failure Date: Tue, 2 Feb 2021 17:28:30 +0100 Message-Id: <20210202162834.269789-7-kwolf@redhat.com> In-Reply-To: <20210202162834.269789-1-kwolf@redhat.com> References: <20210202162834.269789-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.386, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Vladimir Sementsov-Ogievskiy We should indicate failure by exit code, not only output. Reported-by: Peter Maydell Fixes: f203080bbd9f9e5b31041b1f2afcd6040c5aaec5 Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20210201085041.3079-1-vsementsov@virtuozzo.com> Signed-off-by: Kevin Wolf --- tests/qemu-iotests/testrunner.py | 4 +++- tests/qemu-iotests/check | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/testrunner.py b/tests/qemu-iotests/testrunner.py index 24b3fba115..25754e9a09 100644 --- a/tests/qemu-iotests/testrunner.py +++ b/tests/qemu-iotests/testrunner.py @@ -318,7 +318,7 @@ class TestRunner(ContextManager['TestRunner']): return res - def run_tests(self, tests: List[str]) -> None: + def run_tests(self, tests: List[str]) -> bool: n_run = 0 failed = [] notrun = [] @@ -363,5 +363,7 @@ class TestRunner(ContextManager['TestRunner']): if failed: print('Failures:', ' '.join(failed)) print(f'Failed {len(failed)} of {n_run} iotests') + return False else: print(f'Passed all {n_run} iotests') + return True diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index 5190dee82e..d1c87ceaf1 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -140,4 +140,7 @@ if __name__ == '__main__': else: with TestRunner(env, makecheck=args.makecheck, color=args.color) as tr: - tr.run_tests([os.path.join(env.source_iotests, t) for t in tests]) + paths = [os.path.join(env.source_iotests, t) for t in tests] + ok = tr.run_tests(paths) + if not ok: + sys.exit(1) From patchwork Tue Feb 2 16:28:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 12062313 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2317C433DB for ; Tue, 2 Feb 2021 16:57:03 +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 2CADF64F72 for ; Tue, 2 Feb 2021 16:57:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2CADF64F72 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:60214 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6yz6-0003Jh-G1 for qemu-devel@archiver.kernel.org; Tue, 02 Feb 2021 11:57:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52502) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6yYJ-0005KZ-8I for qemu-devel@nongnu.org; Tue, 02 Feb 2021 11:29:19 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:31976) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l6yYH-0000HV-Hu for qemu-devel@nongnu.org; Tue, 02 Feb 2021 11:29:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612283356; 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=E2W1HGEgCNWOCZS4CT3q/hTS9q/xlepHrVHCPnJh7Cs=; b=UAPV3U5HylB0BsKYL3qd10CCfT4/TmngKGaSm5vLrpLIYVswm//dtLnE25G4a6jZ/Hrsww sG3RjDGUi74J4phBTzhYDQiHOame7TtBykUKpr9jfbR3iTLiiO1ICcpKGtjuLciHyFnaw6 ODsnXNfXcOa/Ts29bO1xt4JCfZp6+kQ= 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-137-1gLX7cI5PEeJYWN_BGqKdg-1; Tue, 02 Feb 2021 11:29:11 -0500 X-MC-Unique: 1gLX7cI5PEeJYWN_BGqKdg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C7F881005501; Tue, 2 Feb 2021 16:29:10 +0000 (UTC) Received: from merkur.fritz.box (ovpn-112-19.ams2.redhat.com [10.36.112.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 35C8F5D749; Tue, 2 Feb 2021 16:29:08 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL v2 07/10] iotests: Fix -makecheck output Date: Tue, 2 Feb 2021 17:28:31 +0100 Message-Id: <20210202162834.269789-8-kwolf@redhat.com> In-Reply-To: <20210202162834.269789-1-kwolf@redhat.com> References: <20210202162834.269789-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.386, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" For -makecheck, the old 'check' implementation skipped the output when starting a test. It only had the condensed output at the end of a test. testrunner.py prints the normal output when starting a test even for -makecheck. This output contains '\r' at the end so that it can be overwritten with the result at the end of the test. However, for -makecheck this is shorter output in a different format, so effectively we end up with garbled output that mixes both output forms. Revert to the old behaviour of only printing a message after the test had completed in -makecheck mode. Fixes: d74c754c924ca34e90b7c96ce2f5609d82c0e628 Signed-off-by: Kevin Wolf Message-Id: <20210201161024.127921-1-kwolf@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Kevin Wolf --- tests/qemu-iotests/testrunner.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/testrunner.py b/tests/qemu-iotests/testrunner.py index 25754e9a09..1fc61fcaa3 100644 --- a/tests/qemu-iotests/testrunner.py +++ b/tests/qemu-iotests/testrunner.py @@ -301,8 +301,10 @@ class TestRunner(ContextManager['TestRunner']): last_el = self.last_elapsed.get(test) start = datetime.datetime.now().strftime('%H:%M:%S') - self.test_print_one_line(test=test, starttime=start, lasttime=last_el, - end='\r', test_field_width=test_field_width) + if not self.makecheck: + self.test_print_one_line(test=test, starttime=start, + lasttime=last_el, end='\r', + test_field_width=test_field_width) res = self.do_run_test(test) From patchwork Tue Feb 2 16:28:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 12062361 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37392C433E0 for ; Tue, 2 Feb 2021 17:11:02 +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 D6C0A64F88 for ; Tue, 2 Feb 2021 17:11:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D6C0A64F88 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:58282 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6zCe-000775-VS for qemu-devel@archiver.kernel.org; Tue, 02 Feb 2021 12:11:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52602) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6yYQ-0005cX-5D for qemu-devel@nongnu.org; Tue, 02 Feb 2021 11:29:26 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:60087) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l6yYO-0000LR-BX for qemu-devel@nongnu.org; Tue, 02 Feb 2021 11:29:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612283363; 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=M/bBH8B3CNQFmyPeGz7p1yGlkAwZeNlSvc8DtMTEvA4=; b=W5JO+dxoKQqEk56p+iYSPg7vA7efGUgFz9syMDo/9ZqHy/O6GoBZ2jLdoUVgpkhzV4Qfve 82PYu/iyGfHVRixHfVaJnuqhMstHnT/gBi2vFISSei5Cn3SoESUHHMYJNebnpX0Gk+sarc 13vMe5sDvqugLiSwbkV5td+y93b9G9w= 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-243-QFydhp6TOqSn2NArN5XyxQ-1; Tue, 02 Feb 2021 11:29:14 -0500 X-MC-Unique: QFydhp6TOqSn2NArN5XyxQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AB53D1083E9C; Tue, 2 Feb 2021 16:29:13 +0000 (UTC) Received: from merkur.fritz.box (ovpn-112-19.ams2.redhat.com [10.36.112.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1F4065D749; Tue, 2 Feb 2021 16:29:10 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL v2 08/10] block/nvme: Properly display doorbell stride length in trace event Date: Tue, 2 Feb 2021 17:28:32 +0100 Message-Id: <20210202162834.269789-9-kwolf@redhat.com> In-Reply-To: <20210202162834.269789-1-kwolf@redhat.com> References: <20210202162834.269789-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.386, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Commit 15b2260bef3 ("block/nvme: Trace controller capabilities") misunderstood the doorbell stride value from the datasheet, use the correct one. The 'doorbell_scale' variable used few lines later is correct. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20210127212137.3482291-2-philmd@redhat.com> Reviewed-by: Klaus Jensen Signed-off-by: Kevin Wolf --- block/nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/nvme.c b/block/nvme.c index 5a6fbacf4a..80c4318d8f 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -745,7 +745,7 @@ static int nvme_init(BlockDriverState *bs, const char *device, int namespace, trace_nvme_controller_capability("Contiguous Queues Required", NVME_CAP_CQR(cap)); trace_nvme_controller_capability("Doorbell Stride", - 2 << (2 + NVME_CAP_DSTRD(cap))); + 1 << (2 + NVME_CAP_DSTRD(cap))); trace_nvme_controller_capability("Subsystem Reset Supported", NVME_CAP_NSSRS(cap)); trace_nvme_controller_capability("Memory Page Size Minimum", From patchwork Tue Feb 2 16:28:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 12062335 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A06A0C433E0 for ; Tue, 2 Feb 2021 17:03:16 +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 183BF64E9A for ; Tue, 2 Feb 2021 17:03:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 183BF64E9A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:40270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6z59-0007c9-8M for qemu-devel@archiver.kernel.org; Tue, 02 Feb 2021 12:03:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52544) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6yYN-0005WN-IW for qemu-devel@nongnu.org; Tue, 02 Feb 2021 11:29:23 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:53410) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l6yYL-0000KK-M7 for qemu-devel@nongnu.org; Tue, 02 Feb 2021 11:29:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612283360; 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=OoOffmGlZF5H1YU4xyF1XXxLlysz1yc5d5doEDU1ClM=; b=CFHfjnbXfY3nqCT0EEsN3e7C6NdOgY/SMZ03q/8FeNLPfHkJJ4B/l7xSNeyumMPZsGmShi 16Y/zHvwYbU7XD5fQFdR+CbbBDJKDErK5Df/HXMiPVt5FsC0TXbJHyH5+zkYiS+5SXm1+P d46jfZRFlqOby8EXghcgniqPlZbOhsc= 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-480-g0Zgy1JwPKmykmnsq3CBkw-1; Tue, 02 Feb 2021 11:29:17 -0500 X-MC-Unique: g0Zgy1JwPKmykmnsq3CBkw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 989D356B38; Tue, 2 Feb 2021 16:29:16 +0000 (UTC) Received: from merkur.fritz.box (ovpn-112-19.ams2.redhat.com [10.36.112.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id F41DB5D763; Tue, 2 Feb 2021 16:29:13 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL v2 09/10] block/nvme: Trace NVMe spec version supported by the controller Date: Tue, 2 Feb 2021 17:28:33 +0100 Message-Id: <20210202162834.269789-10-kwolf@redhat.com> In-Reply-To: <20210202162834.269789-1-kwolf@redhat.com> References: <20210202162834.269789-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.386, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé NVMe controllers implement different versions of the spec, and different features of it. It is useful to gather this information when debugging. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20210127212137.3482291-3-philmd@redhat.com> Reviewed-by: Klaus Jensen Signed-off-by: Kevin Wolf --- block/nvme.c | 6 ++++++ block/trace-events | 1 + 2 files changed, 7 insertions(+) diff --git a/block/nvme.c b/block/nvme.c index 80c4318d8f..2b5421e7aa 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -708,6 +708,7 @@ static int nvme_init(BlockDriverState *bs, const char *device, int namespace, AioContext *aio_context = bdrv_get_aio_context(bs); int ret; uint64_t cap; + uint32_t ver; uint64_t timeout_ms; uint64_t deadline, now; volatile NvmeBar *regs = NULL; @@ -764,6 +765,11 @@ static int nvme_init(BlockDriverState *bs, const char *device, int namespace, bs->bl.request_alignment = s->page_size; timeout_ms = MIN(500 * NVME_CAP_TO(cap), 30000); + ver = le32_to_cpu(regs->vs); + trace_nvme_controller_spec_version(extract32(ver, 16, 16), + extract32(ver, 8, 8), + extract32(ver, 0, 8)); + /* Reset device to get a clean state. */ regs->cc = cpu_to_le32(le32_to_cpu(regs->cc) & 0xFE); /* Wait for CSTS.RDY = 0. */ diff --git a/block/trace-events b/block/trace-events index 8368f4acb0..ecbc32a80a 100644 --- a/block/trace-events +++ b/block/trace-events @@ -136,6 +136,7 @@ qed_aio_write_main(void *s, void *acb, int ret, uint64_t offset, size_t len) "s # nvme.c nvme_controller_capability_raw(uint64_t value) "0x%08"PRIx64 nvme_controller_capability(const char *desc, uint64_t value) "%s: %"PRIu64 +nvme_controller_spec_version(uint32_t mjr, uint32_t mnr, uint32_t ter) "Specification supported: %u.%u.%u" nvme_kick(void *s, unsigned q_index) "s %p q #%u" nvme_dma_flush_queue_wait(void *s) "s %p" nvme_error(int cmd_specific, int sq_head, int sqid, int cid, int status) "cmd_specific %d sq_head %d sqid %d cid %d status 0x%x" From patchwork Tue Feb 2 16:28:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 12062297 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9303BC433E0 for ; Tue, 2 Feb 2021 16:53:21 +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 E586C64E3F for ; Tue, 2 Feb 2021 16:53:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E586C64E3F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:53574 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6yvX-0000AP-Ri for qemu-devel@archiver.kernel.org; Tue, 02 Feb 2021 11:53:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52634) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6yYR-0005hD-Nh for qemu-devel@nongnu.org; Tue, 02 Feb 2021 11:29:27 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:59201) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l6yYP-0000Lv-Bd for qemu-devel@nongnu.org; Tue, 02 Feb 2021 11:29:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612283364; 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=IxiSlDdphZ0zc66jpogV6rnucupgcanPMHWGj106wFA=; b=IeA47WcEk7W9LgvsdTQPdrfRTKNSMcxTv8ssVni+viz5F+un+TN2Ke5c5ulYfSSCSeZJF3 23vG+VYyB7c1YVf9Zfy6jzbK+TzrvsIDT8UmNceLl1Fu4UjnR0Tl0UJkuPwFq36SZNYoBj 55ve9usUeLqqRnmwXharKuSGFqmd/3Q= 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-516-aE8RdfYEP5iynZAXISjZuQ-1; Tue, 02 Feb 2021 11:29:20 -0500 X-MC-Unique: aE8RdfYEP5iynZAXISjZuQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 91CDF8030B3; Tue, 2 Feb 2021 16:29:19 +0000 (UTC) Received: from merkur.fritz.box (ovpn-112-19.ams2.redhat.com [10.36.112.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id E29F46249C; Tue, 2 Feb 2021 16:29:16 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL v2 10/10] block: Fix VM size column width in bdrv_snapshot_dump() Date: Tue, 2 Feb 2021 17:28:34 +0100 Message-Id: <20210202162834.269789-11-kwolf@redhat.com> In-Reply-To: <20210202162834.269789-1-kwolf@redhat.com> References: <20210202162834.269789-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.386, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" size_to_str() can return a size like "4.24 MiB", with a single digit integer part and two fractional digits. This is eight characters, but commit b39847a5 changed the format string to only reserve seven characters for the column. This can result in unaligned columns, which in turn changes the output of iotests case 267 because exceeding the column size defeats the attempt to filter the size out of the output (observed with the ppc64 emulator). The resulting change is only a whitespace change, but since commit f203080b this is enough for iotests to consider the test failed. Taking a character away from the tag name column and adding it to the VM size column doesn't change anything in the common case (the tag name is left justified, the VM size is right justified), but fixes this case. Fixes: b39847a50553b7679d6d7fefbe6a108a17aacf8d Signed-off-by: Kevin Wolf Message-Id: <20210202155911.179865-1-kwolf@redhat.com> Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- block/qapi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/qapi.c b/block/qapi.c index 0a96099e36..84a0aadc09 100644 --- a/block/qapi.c +++ b/block/qapi.c @@ -677,7 +677,7 @@ void bdrv_snapshot_dump(QEMUSnapshotInfo *sn) char *sizing = NULL; if (!sn) { - qemu_printf("%-10s%-18s%7s%20s%13s%11s", + qemu_printf("%-10s%-17s%8s%20s%13s%11s", "ID", "TAG", "VM SIZE", "DATE", "VM CLOCK", "ICOUNT"); } else { ti = sn->date_sec; @@ -696,7 +696,7 @@ void bdrv_snapshot_dump(QEMUSnapshotInfo *sn) snprintf(icount_buf, sizeof(icount_buf), "%"PRId64, sn->icount); } - qemu_printf("%-9s %-17s %7s%20s%13s%11s", + qemu_printf("%-9s %-16s %8s%20s%13s%11s", sn->id_str, sn->name, sizing, date_buf,