From nobody Fri May 3 08:24:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563201004; cv=none; d=zoho.com; s=zohoarc; b=PJlRYKtCdLuc9k+AylFCtKf/9aqb8oXhZJSUEkFHLgWYN4Vc5Q8m2OvXGG8Jh/DqAkj4JtJ3uhDFSFkUCVbc89qS/SetDyXUUHEOOVqSqrifzeeqefJrG33qoBQHGdfGkLy9g0eEF7LQnjuClorlZTnOiPkrMveiZHmiTwXpzb8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563201004; 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:ARC-Authentication-Results; bh=vcYzheI4CWo2CNu4PcEvEFUsILxBMCX42+DOmsAj37Y=; b=UTvYqpRFQaP7RI3NEO9grSweyGhGsK806/Ym7M0WpbgMrDr1CuqD0BOTViAdqMQ3SeYIssaqwTwnA/eeR1ebh31mdA/aP4K3tZzV4MpLlGoVo3Atl285JysisrwB+Ni3Xa3FQM0GaSn2TURQoYZXoYkj31IKkoU704OdkyRODs4= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 156320100469396.50793438742426; Mon, 15 Jul 2019 07:30:04 -0700 (PDT) Received: from localhost ([::1]:39436 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hn1zN-0006kj-6j for importer@patchew.org; Mon, 15 Jul 2019 10:30:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34204) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hn1yd-0004AY-T4 for qemu-devel@nongnu.org; Mon, 15 Jul 2019 10:29:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hn1yc-0005s7-QH for qemu-devel@nongnu.org; Mon, 15 Jul 2019 10:29:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60222) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hn1ya-0005q4-34; Mon, 15 Jul 2019 10:29:12 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5C5CF3082DDD; Mon, 15 Jul 2019 14:29:11 +0000 (UTC) Received: from localhost (unknown [10.40.205.59]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E73635D9DE; Mon, 15 Jul 2019 14:29:10 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 15 Jul 2019 16:28:55 +0200 Message-Id: <20190715142905.9078-2-mreitz@redhat.com> In-Reply-To: <20190715142905.9078-1-mreitz@redhat.com> References: <20190715142905.9078-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Mon, 15 Jul 2019 14:29:11 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 01/11] nvme: Set number of queues later in nvme_init() 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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Michal Privoznik When creating the admin queue in nvme_init() the variable that holds the number of queues created is modified before actual queue creation. This is a problem because if creating the queue fails then the variable is left in inconsistent state. This was actually observed when I tried to hotplug a nvme disk. The control got to nvme_file_open() which called nvme_init() which failed and thus nvme_close() was called which in turn called nvme_free_queue_pair() with queue being NULL. This lead to an instant crash: #0 0x000055d9507ec211 in nvme_free_queue_pair (bs=3D0x55d952ddb880, q=3D= 0x0) at block/nvme.c:164 #1 0x000055d9507ee180 in nvme_close (bs=3D0x55d952ddb880) at block/nvme.= c:729 #2 0x000055d9507ee3d5 in nvme_file_open (bs=3D0x55d952ddb880, options=3D= 0x55d952bb1410, flags=3D147456, errp=3D0x7ffd8e19e200) at block/nvme.c:781 #3 0x000055d9507629f3 in bdrv_open_driver (bs=3D0x55d952ddb880, drv=3D0x= 55d95109c1e0 , node_name=3D0x0, options=3D0x55d952bb1410, open_f= lags=3D147456, errp=3D0x7ffd8e19e310) at block.c:1291 #4 0x000055d9507633d6 in bdrv_open_common (bs=3D0x55d952ddb880, file=3D0= x0, options=3D0x55d952bb1410, errp=3D0x7ffd8e19e310) at block.c:1551 #5 0x000055d950766881 in bdrv_open_inherit (filename=3D0x0, reference=3D= 0x0, options=3D0x55d952bb1410, flags=3D32768, parent=3D0x55d9538ce420, chil= d_role=3D0x55d950eaade0 , errp=3D0x7ffd8e19e510) at block.c:3063 #6 0x000055d950765ae4 in bdrv_open_child_bs (filename=3D0x0, options=3D0= x55d9541cdff0, bdref_key=3D0x55d950af33aa "file", parent=3D0x55d9538ce420, = child_role=3D0x55d950eaade0 , allow_none=3Dtrue, errp=3D0x7ffd8= e19e510) at block.c:2712 #7 0x000055d950766633 in bdrv_open_inherit (filename=3D0x0, reference=3D= 0x0, options=3D0x55d9541cdff0, flags=3D0, parent=3D0x0, child_role=3D0x0, e= rrp=3D0x7ffd8e19e908) at block.c:3011 #8 0x000055d950766dba in bdrv_open (filename=3D0x0, reference=3D0x0, opt= ions=3D0x55d953d00390, flags=3D0, errp=3D0x7ffd8e19e908) at block.c:3156 #9 0x000055d9507cb635 in blk_new_open (filename=3D0x0, reference=3D0x0, = options=3D0x55d953d00390, flags=3D0, errp=3D0x7ffd8e19e908) at block/block-= backend.c:389 #10 0x000055d950465ec5 in blockdev_init (file=3D0x0, bs_opts=3D0x55d953d0= 0390, errp=3D0x7ffd8e19e908) at blockdev.c:602 Signed-off-by: Michal Privoznik Message-id: 927aae40b617ba7d4b6c7ffe74e6d7a2595f8e86.1562770546.git.mprivoz= n@redhat.com Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Maxim Levitsky Signed-off-by: Max Reitz --- block/nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/nvme.c b/block/nvme.c index 73ed5fa75f..9896b7f7c6 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -613,12 +613,12 @@ static int nvme_init(BlockDriverState *bs, const char= *device, int namespace, =20 /* Set up admin queue. */ s->queues =3D g_new(NVMeQueuePair *, 1); - s->nr_queues =3D 1; s->queues[0] =3D nvme_create_queue_pair(bs, 0, NVME_QUEUE_SIZE, errp); if (!s->queues[0]) { ret =3D -EINVAL; goto out; } + s->nr_queues =3D 1; QEMU_BUILD_BUG_ON(NVME_QUEUE_SIZE & 0xF000); s->regs->aqa =3D cpu_to_le32((NVME_QUEUE_SIZE << 16) | NVME_QUEUE_SIZE= ); s->regs->asq =3D cpu_to_le64(s->queues[0]->sq.iova); --=20 2.21.0 From nobody Fri May 3 08:24:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563200986; cv=none; d=zoho.com; s=zohoarc; b=d1TMkuFVzTS8y6uC1pRzR815YLddP17YIsOj8aVAPtOYDN9imwL6s0gEKoiR0xk8xSnOuf+JArBA54+NwE39xW+PbqIwFu1PTaB7NsC0xK8GRoikwe0i+QeFZTNj2fzOsE/q7JzayYZPIpOQCnQhfA6WjojgpuCSn6lqLZ4X3uQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563200986; h=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:ARC-Authentication-Results; bh=y6a8o0O38JH8/qQUe7xKhu/SnBj9ordmX+u8RM3bLwg=; b=jyl5DXMx6v0vZOSe9Pgf0W/LB6dz4/vyMrKesygYWfPIvF7XQ4VwUa5HyjxavFALIhH2z6Srvou3iE9ZzITX+tBx4sWtpco9kmkuGryub+NXNoA1DclrMOCYeAw1jFQQerXIco8wvos53RZKAgzM8L0UEadoOst7FUXN6NPSBVk= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1563200986691214.47557296737682; Mon, 15 Jul 2019 07:29:46 -0700 (PDT) Received: from localhost ([::1]:39426 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hn1z6-0005dM-6e for importer@patchew.org; Mon, 15 Jul 2019 10:29:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34251) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hn1yi-0004Rt-2B for qemu-devel@nongnu.org; Mon, 15 Jul 2019 10:29:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hn1yg-0005uB-OS for qemu-devel@nongnu.org; Mon, 15 Jul 2019 10:29:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54578) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hn1yd-0005ry-5t; Mon, 15 Jul 2019 10:29:15 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7835C30C0DCF; Mon, 15 Jul 2019 14:29:14 +0000 (UTC) Received: from localhost (unknown [10.40.205.59]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E72E957A1; Mon, 15 Jul 2019 14:29:13 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 15 Jul 2019 16:28:56 +0200 Message-Id: <20190715142905.9078-3-mreitz@redhat.com> In-Reply-To: <20190715142905.9078-1-mreitz@redhat.com> References: <20190715142905.9078-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Mon, 15 Jul 2019 14:29:14 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 02/11] block: Add BDS.never_freeze 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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" The commit and the mirror block job must be able to drop their filter node at any point. However, this will not be possible if any of the BdrvChild links to them is frozen. Therefore, we need to prevent them from ever becoming frozen. Signed-off-by: Max Reitz Reviewed-by: Andrey Shinkevich Reviewed-by: Alberto Garcia Message-id: 20190703172813.6868-2-mreitz@redhat.com Signed-off-by: Max Reitz --- include/block/block_int.h | 3 +++ block.c | 8 ++++++++ block/commit.c | 4 ++++ block/mirror.c | 4 ++++ 4 files changed, 19 insertions(+) diff --git a/include/block/block_int.h b/include/block/block_int.h index d6415b53c1..50902531b7 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -885,6 +885,9 @@ struct BlockDriverState { =20 /* Only read/written by whoever has set active_flush_req to true. */ unsigned int flushed_gen; /* Flushed write generation */ + + /* BdrvChild links to this node may never be frozen */ + bool never_freeze; }; =20 struct BlockBackendRootState { diff --git a/block.c b/block.c index c139540f2b..6565192b91 100644 --- a/block.c +++ b/block.c @@ -4416,6 +4416,14 @@ int bdrv_freeze_backing_chain(BlockDriverState *bs, = BlockDriverState *base, return -EPERM; } =20 + for (i =3D bs; i !=3D base; i =3D backing_bs(i)) { + if (i->backing && backing_bs(i)->never_freeze) { + error_setg(errp, "Cannot freeze '%s' link to '%s'", + i->backing->name, backing_bs(i)->node_name); + return -EPERM; + } + } + for (i =3D bs; i !=3D base; i =3D backing_bs(i)) { if (i->backing) { i->backing->frozen =3D true; diff --git a/block/commit.c b/block/commit.c index ca7e408b26..2c5a6d4ebc 100644 --- a/block/commit.c +++ b/block/commit.c @@ -298,6 +298,10 @@ void commit_start(const char *job_id, BlockDriverState= *bs, if (!filter_node_name) { commit_top_bs->implicit =3D true; } + + /* So that we can always drop this node */ + commit_top_bs->never_freeze =3D true; + commit_top_bs->total_sectors =3D top->total_sectors; =20 bdrv_append(commit_top_bs, top, &local_err); diff --git a/block/mirror.c b/block/mirror.c index 2fcec70e35..8cb75fb409 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -1551,6 +1551,10 @@ static BlockJob *mirror_start_job( if (!filter_node_name) { mirror_top_bs->implicit =3D true; } + + /* So that we can always drop this node */ + mirror_top_bs->never_freeze =3D true; + mirror_top_bs->total_sectors =3D bs->total_sectors; mirror_top_bs->supported_write_flags =3D BDRV_REQ_WRITE_UNCHANGED; mirror_top_bs->supported_zero_flags =3D BDRV_REQ_WRITE_UNCHANGED | --=20 2.21.0 From nobody Fri May 3 08:24:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563201026; cv=none; d=zoho.com; s=zohoarc; b=CbvtIurR9o/wGR+Dp6a+DTXsBHkvR8HUVLYP7G6LEv7T0D2Lx/hnJ6tGXPxHDr2NX30oIQ1ZcpLqLf8s/rsxEwWodsoHww368Qan6vzkDlhfPDBsoq1SlPMV18OWlQK0qOULVdgmvV0IduqsKUdTdgYXPgEV8i91gHzwAiYU/FU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563201026; h=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:ARC-Authentication-Results; bh=aLShqBVl65DyNRmvYPWE0ZzM1G7hSfYeqToz5enm/lo=; b=D/goriiQXYkdUP4V32LdNdGBGtHHbUyxiEw2Qo6DH6g3PHKaynTPK4mnvu5eOeDtutoCXc8kXzA9JxBH5y3C6Jnb/gGM8FOMmuj9hhVIldynvgzO3qqo6nXD80le8h3Ygm7AXqKnW8+R6a9ZQJFNFN33JB9R0T0WjnExiiIp8Yo= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1563201026901629.9901762375965; Mon, 15 Jul 2019 07:30:26 -0700 (PDT) Received: from localhost ([::1]:39456 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hn1zl-0008Fs-8j for importer@patchew.org; Mon, 15 Jul 2019 10:30:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34290) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hn1yl-0004ft-7t for qemu-devel@nongnu.org; Mon, 15 Jul 2019 10:29:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hn1yi-0005vO-BE for qemu-devel@nongnu.org; Mon, 15 Jul 2019 10:29:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60256) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hn1yg-0005tf-Ap; Mon, 15 Jul 2019 10:29:18 -0400 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 mx1.redhat.com (Postfix) with ESMTPS id A4C083001757; Mon, 15 Jul 2019 14:29:17 +0000 (UTC) Received: from localhost (unknown [10.40.205.59]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3A3885C232; Mon, 15 Jul 2019 14:29:16 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 15 Jul 2019 16:28:57 +0200 Message-Id: <20190715142905.9078-4-mreitz@redhat.com> In-Reply-To: <20190715142905.9078-1-mreitz@redhat.com> References: <20190715142905.9078-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Mon, 15 Jul 2019 14:29:17 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 03/11] block/stream: Fix error path 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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" As of commit c624b015bf14fe01f1e6452a36e63b3ea1ae4998, the stream job only freezes the chain until the overlay of the base node. The error path must consider this. Fixes: c624b015bf14fe01f1e6452a36e63b3ea1ae4998 Signed-off-by: Max Reitz Message-id: 20190703172813.6868-3-mreitz@redhat.com Signed-off-by: Max Reitz --- block/stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/stream.c b/block/stream.c index cd5e2ba9b0..b27e61625d 100644 --- a/block/stream.c +++ b/block/stream.c @@ -284,5 +284,5 @@ fail: if (bs_read_only) { bdrv_reopen_set_read_only(bs, true, NULL); } - bdrv_unfreeze_backing_chain(bs, base); + bdrv_unfreeze_backing_chain(bs, bottom); } --=20 2.21.0 From nobody Fri May 3 08:24:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563201047; cv=none; d=zoho.com; s=zohoarc; b=CsAQALREhcUAko6QagFfBEb1artPKsaTuM2LVPEpgM55ovFM0K0pvkCTrLNIqJ5Mu7F0iTsGmusmZ1bk5Mkc9MLDpz2n5rADdHju133XXXXOsql08MIms3A0RBmv6WBZE2/dDvu7CbcGkqrOozD6P6YOVeLoLEfpoWn1RnUjkIo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563201047; h=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:ARC-Authentication-Results; bh=JJzqJXjtwvE6k2m42VaHteIGHVWKj3m2rVF7zrKfWkM=; b=M3FM12W+oH3Z0qAKKceWOXz40G72B/MPG7VZAl92nLu1EDwMwPnoNj0GyDZguHTQbcUwC9iN7o1Jvu60sZZD+6nEAF7PdBZ5CveQGZQUHYghLzEZMbwhF3s9QT31t0DQZUTjjJ4wTwM7BiZGEFx7Jo5aYtEKmG0qlLkDUZa2TEs= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1563201047191919.8028166541307; Mon, 15 Jul 2019 07:30:47 -0700 (PDT) Received: from localhost ([::1]:39468 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hn205-0001Dc-RF for importer@patchew.org; Mon, 15 Jul 2019 10:30:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34317) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hn1ym-0004la-Nl for qemu-devel@nongnu.org; Mon, 15 Jul 2019 10:29:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hn1yl-0005xO-OA for qemu-devel@nongnu.org; Mon, 15 Jul 2019 10:29:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57622) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hn1yj-0005vd-IG; Mon, 15 Jul 2019 10:29:21 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D5E6D30821E0; Mon, 15 Jul 2019 14:29:20 +0000 (UTC) Received: from localhost (unknown [10.40.205.59]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4AB1E57A1; Mon, 15 Jul 2019 14:29:19 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 15 Jul 2019 16:28:58 +0200 Message-Id: <20190715142905.9078-5-mreitz@redhat.com> In-Reply-To: <20190715142905.9078-1-mreitz@redhat.com> References: <20190715142905.9078-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Mon, 15 Jul 2019 14:29:20 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 04/11] block/stream: Swap backing file change order 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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" bdrv_change_backing_file() can result in yields. Therefore, @base may no longer be the the backing_bs() of s->bottom afterwards. Just swap the order of the two calls to fix this. Signed-off-by: Max Reitz Message-id: 20190703172813.6868-4-mreitz@redhat.com Signed-off-by: Max Reitz --- block/stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/stream.c b/block/stream.c index b27e61625d..6ac1e7bec4 100644 --- a/block/stream.c +++ b/block/stream.c @@ -78,8 +78,8 @@ static int stream_prepare(Job *job) base_fmt =3D base->drv->format_name; } } - ret =3D bdrv_change_backing_file(bs, base_id, base_fmt); bdrv_set_backing_hd(bs, base, &local_err); + ret =3D bdrv_change_backing_file(bs, base_id, base_fmt); if (local_err) { error_report_err(local_err); return -EPERM; --=20 2.21.0 From nobody Fri May 3 08:24:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563201087; cv=none; d=zoho.com; s=zohoarc; b=cMlf/9qkjA3nEzZC7XfXgPzTH2kN8a5o/Kdz8Ss8lm4Tnf1Sb2IOHFzEAVOp2hpvEYHEzqrsQSUuSjpLoDyR7mhREU8Fzvv7XVDdx1NkhvrXrQo02aCLjd629hn4+8/Ve7SVYjTQH2BS6NMQvKhA9CeuO61SZr+Uvc9SzABW5Do= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563201087; h=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:ARC-Authentication-Results; bh=b1sz4uQSRumaPI+FDb3C2ec+WC2yGoaTGxpmFp92+MI=; b=ojaY1LQArFXkjkMF9dkYXl/+ftSfk6ktC9TKXWZ6zgnZ2PL/i3/L2jy8Gg6nm8X2V96FH9+LDNuXEVH+cjGJONEhZoPdIUqhXnDjIfKLxtN9rbA+HmDFcpmxPT9eAVB2jsVSPlh8ONhV7ocZSnHpq5RCe+P3UnzVjSJFWSfJOl8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1563201087286637.8485623317692; Mon, 15 Jul 2019 07:31:27 -0700 (PDT) Received: from localhost ([::1]:39488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hn20j-0003Xw-Jl for importer@patchew.org; Mon, 15 Jul 2019 10:31:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34411) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hn1yt-0005CF-0o for qemu-devel@nongnu.org; Mon, 15 Jul 2019 10:29:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hn1yr-00061H-Va for qemu-devel@nongnu.org; Mon, 15 Jul 2019 10:29:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57668) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hn1ym-0005xi-Jc; Mon, 15 Jul 2019 10:29:24 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DD6913082200; Mon, 15 Jul 2019 14:29:23 +0000 (UTC) Received: from localhost (unknown [10.40.205.59]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5A0FC5D9C6; Mon, 15 Jul 2019 14:29:23 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 15 Jul 2019 16:28:59 +0200 Message-Id: <20190715142905.9078-6-mreitz@redhat.com> In-Reply-To: <20190715142905.9078-1-mreitz@redhat.com> References: <20190715142905.9078-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Mon, 15 Jul 2019 14:29:23 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 05/11] block: Deep-clear inherits_from 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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" BDS.inherits_from does not always point to an immediate parent node. When launching a block job with a filter node, for example, the node directly below the filter will not point to the filter, but keep its old pointee (above the filter). If that pointee goes away while the job is still running, the node's inherits_from will not be updated and thus point to garbage. To fix this, bdrv_unref_child() has to check not only the parent node's immediate children for nodes whose inherits_from needs to be cleared, but its whole subtree. Signed-off-by: Max Reitz Message-id: 20190703172813.6868-7-mreitz@redhat.com Signed-off-by: Max Reitz --- block.c | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/block.c b/block.c index 6565192b91..29e931e217 100644 --- a/block.c +++ b/block.c @@ -2472,18 +2472,20 @@ void bdrv_root_unref_child(BdrvChild *child) bdrv_unref(child_bs); } =20 -void bdrv_unref_child(BlockDriverState *parent, BdrvChild *child) +/** + * Clear all inherits_from pointers from children and grandchildren of + * @root that point to @root, where necessary. + */ +static void bdrv_unset_inherits_from(BlockDriverState *root, BdrvChild *ch= ild) { - if (child =3D=3D NULL) { - return; - } - - if (child->bs->inherits_from =3D=3D parent) { - BdrvChild *c; + BdrvChild *c; =20 - /* Remove inherits_from only when the last reference between paren= t and - * child->bs goes away. */ - QLIST_FOREACH(c, &parent->children, next) { + if (child->bs->inherits_from =3D=3D root) { + /* + * Remove inherits_from only when the last reference between root = and + * child->bs goes away. + */ + QLIST_FOREACH(c, &root->children, next) { if (c !=3D child && c->bs =3D=3D child->bs) { break; } @@ -2493,6 +2495,18 @@ void bdrv_unref_child(BlockDriverState *parent, Bdrv= Child *child) } } =20 + QLIST_FOREACH(c, &child->bs->children, next) { + bdrv_unset_inherits_from(root, c); + } +} + +void bdrv_unref_child(BlockDriverState *parent, BdrvChild *child) +{ + if (child =3D=3D NULL) { + return; + } + + bdrv_unset_inherits_from(parent, child); bdrv_root_unref_child(child); } =20 --=20 2.21.0 From nobody Fri May 3 08:24:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563201117; cv=none; d=zoho.com; s=zohoarc; b=S5h1huii/StkhszjSjvm2y3EZOVNJ0CVh9vwEorw7DplXZnTQFqKKHdg/MEHpYqzxRjsl1HcqYALQvm0JbCYPefqkz3yIyKN3M+rc7gz4YBnyJSQEYcr1QzsvoUtlVIbtNkIHXtlwACsHek4yNljGbrkt/Yv1sIF/GboJ+7xLEQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563201117; h=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:ARC-Authentication-Results; bh=n+6GlqXKkzXM+6nMUtYb5AUecVy258a9z9nvqIxunmo=; b=l2MKQMK82hWnD+rQ0ybwPCmYDa4RcwviyF+T2UlkKCAZp5SiqNK5ozm4oWyQqNbCVNcB9F7HmTuceOJRbSTGtcKsiVdkjbxOj7Gnn4hJeWuYYPyjsEbWv/PtQckoTwkhOWUs64ZWme3hk6yxdnkBpJ02VDHD8/RHhQhzQJaNbKs= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1563201117041961.73439338892; Mon, 15 Jul 2019 07:31:57 -0700 (PDT) Received: from localhost ([::1]:39506 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hn21D-0005nY-VB for importer@patchew.org; Mon, 15 Jul 2019 10:31:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34434) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hn1yu-0005Hd-6c for qemu-devel@nongnu.org; Mon, 15 Jul 2019 10:29:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hn1ys-00061k-Ls for qemu-devel@nongnu.org; Mon, 15 Jul 2019 10:29:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10446) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hn1yp-0005zc-OO; Mon, 15 Jul 2019 10:29:27 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 12F3930B97AA; Mon, 15 Jul 2019 14:29:27 +0000 (UTC) Received: from localhost (unknown [10.40.205.59]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7E9201001B02; Mon, 15 Jul 2019 14:29:26 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 15 Jul 2019 16:29:00 +0200 Message-Id: <20190715142905.9078-7-mreitz@redhat.com> In-Reply-To: <20190715142905.9078-1-mreitz@redhat.com> References: <20190715142905.9078-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Mon, 15 Jul 2019 14:29:27 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 06/11] iotests: Fix throttling in 030 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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Currently, TestParallelOps in 030 creates images that are too small for job throttling to be effective. This is reflected by the fact that it never undoes the throttling. Increase the image size and undo the throttling when the job should be completed. Also, add throttling in test_overlapping_4, or the jobs may not be so overlapping after all. In fact, the error usually emitted here is that node2 simply does not exist, not that overlapping jobs are not allowed -- the fact that this job ignores the exact error messages and just checks the error class is something that should be fixed in a follow-up patch. Signed-off-by: Max Reitz Tested-by: Andrey Shinkevich Reviewed-by: Alberto Garcia Message-id: 20190703172813.6868-8-mreitz@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/030 | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030 index c6311d1825..2cf8d54dc5 100755 --- a/tests/qemu-iotests/030 +++ b/tests/qemu-iotests/030 @@ -154,7 +154,7 @@ class TestSingleDrive(iotests.QMPTestCase): class TestParallelOps(iotests.QMPTestCase): num_ops =3D 4 # Number of parallel block-stream operations num_imgs =3D num_ops * 2 + 1 - image_len =3D num_ops * 512 * 1024 + image_len =3D num_ops * 4 * 1024 * 1024 imgs =3D [] =20 def setUp(self): @@ -176,11 +176,11 @@ class TestParallelOps(iotests.QMPTestCase): # Put data into the images we are copying data from odd_img_indexes =3D [x for x in reversed(range(self.num_imgs)) if = x % 2 =3D=3D 1] for i in range(len(odd_img_indexes)): - # Alternate between 256KB and 512KB. + # Alternate between 2MB and 4MB. # This way jobs will not finish in the same order they were cr= eated - num_kb =3D 256 + 256 * (i % 2) + num_mb =3D 2 + 2 * (i % 2) qemu_io('-f', iotests.imgfmt, - '-c', 'write -P 0xFF %dk %dk' % (i * 512, num_kb), + '-c', 'write -P 0xFF %dM %dM' % (i * 4, num_mb), self.imgs[odd_img_indexes[i]]) =20 # Attach the drive to the VM @@ -213,6 +213,10 @@ class TestParallelOps(iotests.QMPTestCase): result =3D self.vm.qmp('block-stream', device=3Dnode_name, job= _id=3Djob_id, base=3Dself.imgs[i-2], speed=3D512*1024) self.assert_qmp(result, 'return', {}) =20 + for job in pending_jobs: + result =3D self.vm.qmp('block-job-set-speed', device=3Djob, sp= eed=3D0) + self.assert_qmp(result, 'return', {}) + # Wait for all jobs to be finished. while len(pending_jobs) > 0: for event in self.vm.get_qmp_events(wait=3DTrue): @@ -260,6 +264,9 @@ class TestParallelOps(iotests.QMPTestCase): result =3D self.vm.qmp('block-commit', device=3D'drive0', base=3Ds= elf.imgs[0], top=3Dself.imgs[1], job_id=3D'commit-node0') self.assert_qmp(result, 'error/class', 'GenericError') =20 + result =3D self.vm.qmp('block-job-set-speed', device=3D'stream-nod= e4', speed=3D0) + self.assert_qmp(result, 'return', {}) + self.wait_until_completed(drive=3D'stream-node4') self.assert_no_active_block_jobs() =20 @@ -289,6 +296,9 @@ class TestParallelOps(iotests.QMPTestCase): result =3D self.vm.qmp('block-stream', device=3D'drive0', base=3Ds= elf.imgs[5], job_id=3D'stream-drive0') self.assert_qmp(result, 'error/class', 'GenericError') =20 + result =3D self.vm.qmp('block-job-set-speed', device=3D'commit-nod= e3', speed=3D0) + self.assert_qmp(result, 'return', {}) + self.wait_until_completed(drive=3D'commit-node3') =20 # Similar to test_overlapping_2, but here block-commit doesn't use the= 'top' parameter. @@ -309,6 +319,9 @@ class TestParallelOps(iotests.QMPTestCase): self.assert_qmp(event, 'data/type', 'commit') self.assert_qmp_absent(event, 'data/error') =20 + result =3D self.vm.qmp('block-job-set-speed', device=3D'commit-dri= ve0', speed=3D0) + self.assert_qmp(result, 'return', {}) + result =3D self.vm.qmp('block-job-complete', device=3D'commit-driv= e0') self.assert_qmp(result, 'return', {}) =20 @@ -321,13 +334,18 @@ class TestParallelOps(iotests.QMPTestCase): self.assert_no_active_block_jobs() =20 # Commit from node2 into node0 - result =3D self.vm.qmp('block-commit', device=3D'drive0', top=3Dse= lf.imgs[2], base=3Dself.imgs[0]) + result =3D self.vm.qmp('block-commit', device=3D'drive0', + top=3Dself.imgs[2], base=3Dself.imgs[0], + speed=3D1024*1024) self.assert_qmp(result, 'return', {}) =20 # Stream from node2 into node4 result =3D self.vm.qmp('block-stream', device=3D'node4', base_node= =3D'node2', job_id=3D'node4') self.assert_qmp(result, 'error/class', 'GenericError') =20 + result =3D self.vm.qmp('block-job-set-speed', device=3D'drive0', s= peed=3D0) + self.assert_qmp(result, 'return', {}) + self.wait_until_completed() self.assert_no_active_block_jobs() =20 @@ -378,6 +396,10 @@ class TestParallelOps(iotests.QMPTestCase): result =3D self.vm.qmp('block-commit', device=3D'drive0', base=3Ds= elf.imgs[5], speed=3D1024*1024) self.assert_qmp(result, 'return', {}) =20 + for job in ['drive0', 'node4']: + result =3D self.vm.qmp('block-job-set-speed', device=3Djob, sp= eed=3D0) + self.assert_qmp(result, 'return', {}) + # Wait for all jobs to be finished. pending_jobs =3D ['node4', 'drive0'] while len(pending_jobs) > 0: --=20 2.21.0 From nobody Fri May 3 08:24:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563201065; cv=none; d=zoho.com; s=zohoarc; b=H1DolyLtCloYNrpM6B9k8sCjzZ5lR1blZonw38+EhnqMkFYLpRTyjSbalky2nTaxCOmI3ilTN8Sy3REbTjn6BANW82OwUNnysnpAPICuJXuzmANsIP0rrMOz/fgIPeUq1ZvgujqakbM7PX58QyUXC6k6EF/dhHahabH/drt9TCg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563201065; h=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:ARC-Authentication-Results; bh=XE4WA0IfvPOY9MECi4dZUioESgP1s9OLkFr3RiVRHsk=; b=cNwROcn7hVfascWK5oJO3sjM/YHL8iEybqhYa2lppwlevIfOChbUSErVj86WaFH5ljdqkutwkuKLg1IsN8iy0C4KnJCEilQye/65bhvmlh65xjl0n5fSo0aVijbad8TgGjFVfvWiOWRqEQG+LsKOzIgWrS6yoLguscJ1kde3pn8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1563201065852753.2891175063623; Mon, 15 Jul 2019 07:31:05 -0700 (PDT) Received: from localhost ([::1]:39480 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hn20O-0002Fc-Ec for importer@patchew.org; Mon, 15 Jul 2019 10:31:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34498) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hn1yy-0005ar-Mj for qemu-devel@nongnu.org; Mon, 15 Jul 2019 10:29:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hn1yx-000654-00 for qemu-devel@nongnu.org; Mon, 15 Jul 2019 10:29:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40810) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hn1yt-00061b-01; Mon, 15 Jul 2019 10:29:31 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3D2C085541; Mon, 15 Jul 2019 14:29:30 +0000 (UTC) Received: from localhost (unknown [10.40.205.59]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 88C365D9C8; Mon, 15 Jul 2019 14:29:29 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 15 Jul 2019 16:29:01 +0200 Message-Id: <20190715142905.9078-8-mreitz@redhat.com> In-Reply-To: <20190715142905.9078-1-mreitz@redhat.com> References: <20190715142905.9078-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 15 Jul 2019 14:29:30 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 07/11] iotests: Compare error messages in 030 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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Currently, 030 just compares the error class, which does not say anything. Before HEAD^ added throttling to test_overlapping_4, that test actually usually failed because node2 was already gone, not because it was the commit and stream job were not allowed to overlap. Prevent such problems in the future by comparing the error description instead. Signed-off-by: Max Reitz Tested-by: Andrey Shinkevich Reviewed-by: Alberto Garcia Message-id: 20190703172813.6868-9-mreitz@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/030 | 66 +++++++++++++++++++++++++++--------------- 1 file changed, 42 insertions(+), 24 deletions(-) diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030 index 2cf8d54dc5..10fe1de89d 100755 --- a/tests/qemu-iotests/030 +++ b/tests/qemu-iotests/030 @@ -144,11 +144,12 @@ class TestSingleDrive(iotests.QMPTestCase): =20 def test_device_not_found(self): result =3D self.vm.qmp('block-stream', device=3D'nonexistent') - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + 'Cannot find device=3Dnonexistent nor node_name=3Dnonexistent') =20 def test_job_id_missing(self): result =3D self.vm.qmp('block-stream', device=3D'mid') - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', "Invalid job ID ''") =20 =20 class TestParallelOps(iotests.QMPTestCase): @@ -245,24 +246,30 @@ class TestParallelOps(iotests.QMPTestCase): self.assert_qmp(result, 'return', {}) =20 result =3D self.vm.qmp('block-stream', device=3D'node5', job_id=3D= 'stream-node5', base=3Dself.imgs[2]) - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + "Node 'node4' is busy: block device is in use by block job: st= ream") =20 result =3D self.vm.qmp('block-stream', device=3D'node3', job_id=3D= 'stream-node3', base=3Dself.imgs[2]) - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + "Node 'node3' is busy: block device is in use by block job: st= ream") =20 result =3D self.vm.qmp('block-stream', device=3D'node4', job_id=3D= 'stream-node4-v2') - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + "Node 'node4' is busy: block device is in use by block job: st= ream") =20 # block-commit should also fail if it touches nodes used by the st= ream job result =3D self.vm.qmp('block-commit', device=3D'drive0', base=3Ds= elf.imgs[4], job_id=3D'commit-node4') - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + "Node 'node4' is busy: block device is in use by block job: st= ream") =20 result =3D self.vm.qmp('block-commit', device=3D'drive0', base=3Ds= elf.imgs[1], top=3Dself.imgs[3], job_id=3D'commit-node1') - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + "Node 'node3' is busy: block device is in use by block job: st= ream") =20 # This fails because it needs to modify the backing string in node= 2, which is blocked result =3D self.vm.qmp('block-commit', device=3D'drive0', base=3Ds= elf.imgs[0], top=3Dself.imgs[1], job_id=3D'commit-node0') - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + "Node 'node2' is busy: block device is in use by block job: st= ream") =20 result =3D self.vm.qmp('block-job-set-speed', device=3D'stream-nod= e4', speed=3D0) self.assert_qmp(result, 'return', {}) @@ -281,20 +288,25 @@ class TestParallelOps(iotests.QMPTestCase): self.assert_qmp(result, 'return', {}) =20 result =3D self.vm.qmp('block-stream', device=3D'node3', job_id=3D= 'stream-node3') - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + "Node 'node3' is busy: block device is in use by block job: co= mmit") =20 result =3D self.vm.qmp('block-stream', device=3D'node6', base=3Dse= lf.imgs[2], job_id=3D'stream-node6') - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + "Node 'node5' is busy: block device is in use by block job: co= mmit") =20 result =3D self.vm.qmp('block-stream', device=3D'node4', base=3Dse= lf.imgs[2], job_id=3D'stream-node4') - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + "Node 'node4' is busy: block device is in use by block job: co= mmit") =20 result =3D self.vm.qmp('block-stream', device=3D'node6', base=3Dse= lf.imgs[4], job_id=3D'stream-node6-v2') - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + "Node 'node5' is busy: block device is in use by block job: co= mmit") =20 # This fails because block-commit currently blocks the active laye= r even if it's not used result =3D self.vm.qmp('block-stream', device=3D'drive0', base=3Ds= elf.imgs[5], job_id=3D'stream-drive0') - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + "Node 'drive0' is busy: block device is in use by block job: c= ommit") =20 result =3D self.vm.qmp('block-job-set-speed', device=3D'commit-nod= e3', speed=3D0) self.assert_qmp(result, 'return', {}) @@ -312,7 +324,8 @@ class TestParallelOps(iotests.QMPTestCase): self.assert_qmp(result, 'return', {}) =20 result =3D self.vm.qmp('block-stream', device=3D'node5', base=3Dse= lf.imgs[3], job_id=3D'stream-node6') - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + "Node 'node5' is busy: block device is in use by block job: co= mmit") =20 event =3D self.vm.event_wait(name=3D'BLOCK_JOB_READY') self.assert_qmp(event, 'data/device', 'commit-drive0') @@ -328,20 +341,21 @@ class TestParallelOps(iotests.QMPTestCase): self.wait_until_completed(drive=3D'commit-drive0') =20 # In this case the base node of the stream job is the same as the - # top node of commit job. Since block-commit removes the top node - # when it finishes, this is not allowed. + # top node of commit job. Since this results in the commit filter + # node being part of the stream chain, this is not allowed. def test_overlapping_4(self): self.assert_no_active_block_jobs() =20 # Commit from node2 into node0 result =3D self.vm.qmp('block-commit', device=3D'drive0', top=3Dself.imgs[2], base=3Dself.imgs[0], - speed=3D1024*1024) + filter_node_name=3D'commit-filter', speed=3D1= 024*1024) self.assert_qmp(result, 'return', {}) =20 # Stream from node2 into node4 result =3D self.vm.qmp('block-stream', device=3D'node4', base_node= =3D'node2', job_id=3D'node4') - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + "Cannot freeze 'backing' link to 'commit-filter'") =20 result =3D self.vm.qmp('block-job-set-speed', device=3D'drive0', s= peed=3D0) self.assert_qmp(result, 'return', {}) @@ -428,19 +442,23 @@ class TestParallelOps(iotests.QMPTestCase): =20 # Error: the base node does not exist result =3D self.vm.qmp('block-stream', device=3D'node4', base_node= =3D'none', job_id=3D'stream') - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + 'Cannot find device=3D nor node_name=3Dnone') =20 # Error: the base node is not a backing file of the top node result =3D self.vm.qmp('block-stream', device=3D'node4', base_node= =3D'node6', job_id=3D'stream') - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + "Node 'node6' is not a backing image of 'node4'") =20 # Error: the base node is the same as the top node result =3D self.vm.qmp('block-stream', device=3D'node4', base_node= =3D'node4', job_id=3D'stream') - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + "Node 'node4' is not a backing image of 'node4'") =20 # Error: cannot specify 'base' and 'base-node' at the same time result =3D self.vm.qmp('block-stream', device=3D'node4', base=3Dse= lf.imgs[2], base_node=3D'node2', job_id=3D'stream') - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + "'base' and 'base-node' cannot be specified at the same time") =20 # Success: the base node is a backing file of the top node result =3D self.vm.qmp('block-stream', device=3D'node4', base_node= =3D'node2', job_id=3D'stream') @@ -873,7 +891,7 @@ class TestSetSpeed(iotests.QMPTestCase): self.assert_no_active_block_jobs() =20 result =3D self.vm.qmp('block-stream', device=3D'drive0', speed=3D= -1) - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', "Invalid parameter 'speed'") =20 self.assert_no_active_block_jobs() =20 @@ -882,7 +900,7 @@ class TestSetSpeed(iotests.QMPTestCase): self.assert_qmp(result, 'return', {}) =20 result =3D self.vm.qmp('block-job-set-speed', device=3D'drive0', s= peed=3D-1) - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', "Invalid parameter 'speed'") =20 self.cancel_and_wait(resume=3DTrue) =20 --=20 2.21.0 From nobody Fri May 3 08:24:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563201104; cv=none; d=zoho.com; s=zohoarc; b=DTEkY48VC1/uSXUcmX1n8kTXKMnd2Ipmm90U0DcsT+9AbarQ3vCyEGFbMQGzNPgj13NqdNd0wcNj5Jum2354tcBFtg1ijECk39CsPG92B8Spe9I1eCIh9RuyhqN+aOj4gJgIVExyUULWMs3ZaujqRh6CqterkiUVKA6MdUT7vuU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563201104; h=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:ARC-Authentication-Results; bh=GrLu4Y3kkP8vtFVA8HapMr3LwkAeFnvVizR0geQstQQ=; b=KlT0rzGwfm8YK2zc5AoBP5LGUY2WfcKW3zEV6lVPlgtfjrjXq7DVKj28F2HyfTnBYzb/RLqsyWB6k3tWvezLV36gghizTKh/mrdMyrwLkdwd4LVdhqQn4pptV/HM3mOSJPvmR6jFW0tKS0l5X43Z/MMAhaQnS2trkv1vPXX0WsE= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1563201104473121.6739174521017; Mon, 15 Jul 2019 07:31:44 -0700 (PDT) Received: from localhost ([::1]:39499 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hn211-0004qD-6A for importer@patchew.org; Mon, 15 Jul 2019 10:31:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34518) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hn1z0-0005kE-Kv for qemu-devel@nongnu.org; Mon, 15 Jul 2019 10:29:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hn1yz-00066K-KH for qemu-devel@nongnu.org; Mon, 15 Jul 2019 10:29:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57782) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hn1yw-00064D-9w; Mon, 15 Jul 2019 10:29:34 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 840C3307B95F; Mon, 15 Jul 2019 14:29:33 +0000 (UTC) Received: from localhost (unknown [10.40.205.59]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F33FD57B1; Mon, 15 Jul 2019 14:29:32 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 15 Jul 2019 16:29:02 +0200 Message-Id: <20190715142905.9078-9-mreitz@redhat.com> In-Reply-To: <20190715142905.9078-1-mreitz@redhat.com> References: <20190715142905.9078-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Mon, 15 Jul 2019 14:29:33 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 08/11] iotests: Add @use_log to VM.run_job() 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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" unittest-style tests generally do not use the log file, but VM.run_job() can still be useful to them. Add a parameter to it that hides its output from the log file. Signed-off-by: Max Reitz Message-id: 20190703172813.6868-10-mreitz@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/iotests.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 3ecef5bc90..ce74177ab1 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -542,7 +542,7 @@ class VM(qtest.QEMUQtestMachine): =20 # Returns None on success, and an error string on failure def run_job(self, job, auto_finalize=3DTrue, auto_dismiss=3DFalse, - pre_finalize=3DNone, wait=3D60.0): + pre_finalize=3DNone, use_log=3DTrue, wait=3D60.0): match_device =3D {'data': {'device': job}} match_id =3D {'data': {'id': job}} events =3D [ @@ -557,7 +557,8 @@ class VM(qtest.QEMUQtestMachine): while True: ev =3D filter_qmp_event(self.events_wait(events)) if ev['event'] !=3D 'JOB_STATUS_CHANGE': - log(ev) + if use_log: + log(ev) continue status =3D ev['data']['status'] if status =3D=3D 'aborting': @@ -565,13 +566,20 @@ class VM(qtest.QEMUQtestMachine): for j in result['return']: if j['id'] =3D=3D job: error =3D j['error'] - log('Job failed: %s' % (j['error'])) + if use_log: + log('Job failed: %s' % (j['error'])) elif status =3D=3D 'pending' and not auto_finalize: if pre_finalize: pre_finalize() - self.qmp_log('job-finalize', id=3Djob) + if use_log: + self.qmp_log('job-finalize', id=3Djob) + else: + self.qmp('job-finalize', id=3Djob) elif status =3D=3D 'concluded' and not auto_dismiss: - self.qmp_log('job-dismiss', id=3Djob) + if use_log: + self.qmp_log('job-dismiss', id=3Djob) + else: + self.qmp('job-dismiss', id=3Djob) elif status =3D=3D 'null': return error =20 --=20 2.21.0 From nobody Fri May 3 08:24:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563201135; cv=none; d=zoho.com; s=zohoarc; b=jVXo1nl7iphhnCAg7EDsf9hv7ikhJ7ix1T5t7k1daPxUp458HA5XhnGkktrAJgu64aZINWjq+RcG+lz8oTwbspkZ3L4MVgLJr6JtsdWcA0qTi+ywiPOory8s1aCMYfirdoA/6IWpzd2BZ1UViKPtKR7tGRQYiVM77wiipMUs1yU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563201135; h=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:ARC-Authentication-Results; bh=FMar0cYUAkwhlKRoFB7PjjPmXJtZ0nr0SZxMUD6/QoY=; b=JkKd/lM+5+ud1E1JNwFtAbjB7qjDGWZUC7j3rAvLvoNKHan4RnzEuoPspKq32QeKBJvt1o3KnbvM8OqogVOpes9kYubTfbjyteQHKk5i1mUtj8x6O+TEIwzb7Oeajv4+p39m6PDIbg/KW5xK/8vaDUbYOL0Eqdsf9qAxinFDv0E= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1563201135019432.3106417260815; Mon, 15 Jul 2019 07:32:15 -0700 (PDT) Received: from localhost ([::1]:39516 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hn21V-0006jN-Im for importer@patchew.org; Mon, 15 Jul 2019 10:32:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34558) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hn1z3-0005wk-QP for qemu-devel@nongnu.org; Mon, 15 Jul 2019 10:29:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hn1z2-00068A-NL for qemu-devel@nongnu.org; Mon, 15 Jul 2019 10:29:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40034) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hn1z0-00066F-1D; Mon, 15 Jul 2019 10:29:38 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4F30786679; Mon, 15 Jul 2019 14:29:37 +0000 (UTC) Received: from localhost (unknown [10.40.205.59]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 758495D968; Mon, 15 Jul 2019 14:29:36 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 15 Jul 2019 16:29:03 +0200 Message-Id: <20190715142905.9078-10-mreitz@redhat.com> In-Reply-To: <20190715142905.9078-1-mreitz@redhat.com> References: <20190715142905.9078-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 15 Jul 2019 14:29:37 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 09/11] iotests: Add new case to 030 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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" We recently removed the dependency of the stream job on its base node. That makes it OK to use a commit filter node there. Test that. Signed-off-by: Max Reitz Tested-by: Andrey Shinkevich Reviewed-by: Alberto Garcia Message-id: 20190703172813.6868-11-mreitz@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/030 | 25 +++++++++++++++++++++++++ tests/qemu-iotests/030.out | 4 ++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030 index 10fe1de89d..a0397072bc 100755 --- a/tests/qemu-iotests/030 +++ b/tests/qemu-iotests/030 @@ -363,6 +363,31 @@ class TestParallelOps(iotests.QMPTestCase): self.wait_until_completed() self.assert_no_active_block_jobs() =20 + # In this case the base node of the stream job is the commit job's + # filter node. stream does not have a real dependency on its base + # node, so even though commit removes it when it is done, there is + # no conflict. + def test_overlapping_5(self): + self.assert_no_active_block_jobs() + + # Commit from node2 into node0 + result =3D self.vm.qmp('block-commit', device=3D'drive0', + top_node=3D'node2', base_node=3D'node0', + filter_node_name=3D'commit-filter', speed=3D1= 024*1024) + self.assert_qmp(result, 'return', {}) + + # Stream from node2 into node4 + result =3D self.vm.qmp('block-stream', device=3D'node4', + base_node=3D'commit-filter', job_id=3D'node4') + self.assert_qmp(result, 'return', {}) + + result =3D self.vm.qmp('block-job-set-speed', device=3D'drive0', s= peed=3D0) + self.assert_qmp(result, 'return', {}) + + self.vm.run_job(job=3D'drive0', auto_dismiss=3DTrue, use_log=3DFal= se) + self.vm.run_job(job=3D'node4', auto_dismiss=3DTrue, use_log=3DFals= e) + self.assert_no_active_block_jobs() + # Test a block-stream and a block-commit job in parallel # Here the stream job is supposed to finish quickly in order to reprod= uce # the scenario that triggers the bug fixed in 3d5d319e1221 and 1a63a90= 7507 diff --git a/tests/qemu-iotests/030.out b/tests/qemu-iotests/030.out index 4fd1c2dcd2..5eb508de07 100644 --- a/tests/qemu-iotests/030.out +++ b/tests/qemu-iotests/030.out @@ -1,5 +1,5 @@ -......................... +.......................... ---------------------------------------------------------------------- -Ran 25 tests +Ran 26 tests =20 OK --=20 2.21.0 From nobody Fri May 3 08:24:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563201157; cv=none; d=zoho.com; s=zohoarc; b=Q4nyPxhHhg7LtVFvWc/X4xrZIXJkDs6Gh779zywUL0wgAi0Q1+jOmIZHVWwLMSdCugYcaUOlvNJ1fwSFpnMmZhADTm2XkORFGECQ4C/RPrbwlqyBWM6JPnDcTqamB0zOjSJy6agpexH8RYa0pcfCo0j4qOc/3McZuGWt/1AaCnQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563201157; h=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:ARC-Authentication-Results; bh=cZkJFkuZUQsjMjF1DmCInc0vRaivw4drz6smNiGp4eY=; b=frJuAprKn7hTC+ruBe8L8q+h/q0qHoe8P3FFF69VMo4nO3qpWwUguOhGEQbdoF/8pPCvOdlEa8RH5C/GI3ZLTARQzGnzjq6lwEI0nTV+ziU5NumO4XOTx7LEHKzn0ujN2/LVCFRlSKOjqqCCra5Tm2yfn2+8GME4N1XKxFCflow= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1563201157260746.0466856287985; Mon, 15 Jul 2019 07:32:37 -0700 (PDT) Received: from localhost ([::1]:39530 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hn21q-0007md-BX for importer@patchew.org; Mon, 15 Jul 2019 10:32:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34587) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hn1z7-0006EX-Mi for qemu-devel@nongnu.org; Mon, 15 Jul 2019 10:29:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hn1z6-00069y-Gg for qemu-devel@nongnu.org; Mon, 15 Jul 2019 10:29:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34164) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hn1z4-00068c-12; Mon, 15 Jul 2019 10:29:42 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3A4513092640; Mon, 15 Jul 2019 14:29:41 +0000 (UTC) Received: from localhost (unknown [10.40.205.59]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D2BFB5DD6E; Mon, 15 Jul 2019 14:29:39 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 15 Jul 2019 16:29:04 +0200 Message-Id: <20190715142905.9078-11-mreitz@redhat.com> In-Reply-To: <20190715142905.9078-1-mreitz@redhat.com> References: <20190715142905.9078-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Mon, 15 Jul 2019 14:29:41 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 10/11] iotests: Add read-only test case to 030 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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" This tests that the stream job exits cleanly (without abort) when the top node is read-only and cannot be reopened read/write. Signed-off-by: Max Reitz Message-id: 20190703172813.6868-12-mreitz@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/030 | 29 ++++++++++++++++++++++++++++- tests/qemu-iotests/030.out | 4 ++-- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030 index a0397072bc..1b69f318c6 100755 --- a/tests/qemu-iotests/030 +++ b/tests/qemu-iotests/030 @@ -36,7 +36,9 @@ class TestSingleDrive(iotests.QMPTestCase): qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=3D%s'= % mid_img, test_img) qemu_io('-f', 'raw', '-c', 'write -P 0x1 0 512', backing_img) qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0x1 524288 512', mid= _img) - self.vm =3D iotests.VM().add_drive("blkdebug::" + test_img, "backi= ng.node-name=3Dmid") + self.vm =3D iotests.VM().add_drive("blkdebug::" + test_img, + "backing.node-name=3Dmid," + + "backing.backing.node-name=3Dbase= ") self.vm.launch() =20 def tearDown(self): @@ -151,6 +153,31 @@ class TestSingleDrive(iotests.QMPTestCase): result =3D self.vm.qmp('block-stream', device=3D'mid') self.assert_qmp(result, 'error/desc', "Invalid job ID ''") =20 + def test_read_only(self): + # Create a new file that we can attach (we need a read-only top) + with iotests.FilePath('ro-top.img') as ro_top_path: + qemu_img('create', '-f', iotests.imgfmt, ro_top_path, + str(self.image_len)) + + result =3D self.vm.qmp('blockdev-add', + node_name=3D'ro-top', + driver=3Diotests.imgfmt, + read_only=3DTrue, + file=3D{ + 'driver': 'file', + 'filename': ro_top_path, + 'read-only': True + }, + backing=3D'mid') + self.assert_qmp(result, 'return', {}) + + result =3D self.vm.qmp('block-stream', job_id=3D'stream', + device=3D'ro-top', base_node=3D'base') + self.assert_qmp(result, 'error/desc', 'Block node is read-only= ') + + result =3D self.vm.qmp('blockdev-del', node_name=3D'ro-top') + self.assert_qmp(result, 'return', {}) + =20 class TestParallelOps(iotests.QMPTestCase): num_ops =3D 4 # Number of parallel block-stream operations diff --git a/tests/qemu-iotests/030.out b/tests/qemu-iotests/030.out index 5eb508de07..6d9bee1a4b 100644 --- a/tests/qemu-iotests/030.out +++ b/tests/qemu-iotests/030.out @@ -1,5 +1,5 @@ -.......................... +........................... ---------------------------------------------------------------------- -Ran 26 tests +Ran 27 tests =20 OK --=20 2.21.0 From nobody Fri May 3 08:24:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563201028; cv=none; d=zoho.com; s=zohoarc; b=YCvIJzKRT0O4IZUvwgaiY5aWV5ub8sSTZ2rO0Gf5jBab1hT52TElAg8jKNvIYXVoX4Yl6P2ZZNDRkUyF1Pd4lTfyeVdo8X3l53tls3sSM7lm6nb7YoRejsPTOdNDRQxTjSvY2nXLyywM8ByvChMxr1yLkBRDzXJJLcnJAKVhoKc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563201028; h=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:ARC-Authentication-Results; bh=keaHyKHU2B4cdxM62uSPGzceYsLz10p+OVj3sR0wtas=; b=TeeWQdAdTnvJHWs3DEsB+3xAIi2Ks4LsdjXR2Aw++QUwrKsgYQhHaCDf64paet6xcT3CYqdl9dcKRxX3Om2at+zzoDNlEE+n7xjrsjMGzz9FznvH3JjMThPWZEBKw6w19UPCplOjGSU2UuMvX5Ykhbwh70dS2WaZnRMKhJVk8vs= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1563201028181974.3384794070182; Mon, 15 Jul 2019 07:30:28 -0700 (PDT) Received: from localhost ([::1]:39458 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hn1zm-0008LA-MV for importer@patchew.org; Mon, 15 Jul 2019 10:30:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34621) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hn1zC-0006ae-Pd for qemu-devel@nongnu.org; Mon, 15 Jul 2019 10:29:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hn1zA-0006Bp-P9 for qemu-devel@nongnu.org; Mon, 15 Jul 2019 10:29:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41780) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hn1z8-0006Aa-DO; Mon, 15 Jul 2019 10:29:46 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B52ABC057F2B; Mon, 15 Jul 2019 14:29:45 +0000 (UTC) Received: from localhost (unknown [10.40.205.59]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2F4F65F74; Mon, 15 Jul 2019 14:29:44 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 15 Jul 2019 16:29:05 +0200 Message-Id: <20190715142905.9078-12-mreitz@redhat.com> In-Reply-To: <20190715142905.9078-1-mreitz@redhat.com> References: <20190715142905.9078-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 15 Jul 2019 14:29:45 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 11/11] gluster: fix .bdrv_reopen_prepare when backing file is a JSON object 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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Stefano Garzarella When the backing_file is specified as a JSON object, the qemu_gluster_reopen_prepare() fails with this message: invalid URI json:{"server.0.host": ...} In this case, we should call qemu_gluster_init() using the QDict 'state->options' that contains the JSON parameters already parsed. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=3D1542445 Signed-off-by: Stefano Garzarella Message-id: 20190715132844.506584-1-sgarzare@redhat.com Signed-off-by: Max Reitz --- block/gluster.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/block/gluster.c b/block/gluster.c index 62f8ff2147..f64dc5b01e 100644 --- a/block/gluster.c +++ b/block/gluster.c @@ -931,7 +931,17 @@ static int qemu_gluster_reopen_prepare(BDRVReopenState= *state, gconf->has_debug =3D true; gconf->logfile =3D g_strdup(s->logfile); gconf->has_logfile =3D true; - reop_s->glfs =3D qemu_gluster_init(gconf, state->bs->filename, NULL, e= rrp); + + /* + * If 'state->bs->exact_filename' is empty, 'state->options' should co= ntain + * the JSON parameters already parsed. + */ + if (state->bs->exact_filename[0] !=3D '\0') { + reop_s->glfs =3D qemu_gluster_init(gconf, state->bs->exact_filenam= e, NULL, + errp); + } else { + reop_s->glfs =3D qemu_gluster_init(gconf, NULL, state->options, er= rp); + } if (reop_s->glfs =3D=3D NULL) { ret =3D -errno; goto exit; --=20 2.21.0