From nobody Mon Feb 9 00:19:32 2026 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=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1555928470; cv=none; d=zoho.com; s=zohoarc; b=ZsE/ao6kK8PNvshL8mghTd49DSqnClTA2XyzbGpw+l/0YAJpXPaufM8p0WAFTahEaSBMqpngujTy9qt/ZmDXtgb4AroY6pAMqdhIOf7kZq25jBzQaBKqzHFwciqq0nDUcW/F/MzjKfPi6FCNERFaYB5M3S1BDcAHE4qekWlVUVM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555928470; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=+/Leq7fLKgHqU95LXmujhPKSH+jENaMxObEJKmOpvMA=; b=bH9w0oDZFRC8TA9NmQ27RrYbPHD1ii3zMgCUnbnCqAq4L/Xh2zCF0UvJ2/Wrs7VlCa01IcbWVvAslVxEcCp6iGypQH7FiLyicb5uafdPSqlNJ/HZEajITvylkc4fKdzCQam7P5cZHiTqB08hUq6bGgNSWFMK/g4MMlvHKOccSPk= 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 (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1555928470349784.9922042142065; Mon, 22 Apr 2019 03:21:10 -0700 (PDT) Received: from localhost ([127.0.0.1]:35148 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIW4I-0003qd-Iz for importer@patchew.org; Mon, 22 Apr 2019 06:20:58 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57995) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIW2Y-0002xf-7x for qemu-devel@nongnu.org; Mon, 22 Apr 2019 06:19:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hIW2W-0006Y9-RP for qemu-devel@nongnu.org; Mon, 22 Apr 2019 06:19:10 -0400 Received: from relay.sw.ru ([185.231.240.75]:44546) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hIW2W-0006Wg-Jd; Mon, 22 Apr 2019 06:19:08 -0400 Received: from [10.28.8.145] (helo=kvm.sw.ru) by relay.sw.ru with esmtp (Exim 4.91) (envelope-from ) id 1hIW2P-00029b-P8; Mon, 22 Apr 2019 13:19:02 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Mon, 22 Apr 2019 13:18:59 +0300 Message-Id: <20190422101900.13897-3-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190422101900.13897-1-vsementsov@virtuozzo.com> References: <20190422101900.13897-1-vsementsov@virtuozzo.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 185.231.240.75 Subject: [Qemu-devel] [PATCH v5 2/3] block/stream: refactor stream_run: drop goto X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, kwolf@redhat.com, vsementsov@virtuozzo.com, berto@igalia.com, wencongyang2@huawei.com, xiechanglong.d@gmail.com, mreitz@redhat.com, stefanha@redhat.com, andrey.shinkevich@virtuozzo.com, den@openvz.org, jsnow@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The goto is unnecessary in the stream_run() since the common exit code was removed in the commit eb23654dbe43b549ea2a9ebff9d8e: "jobs: utilize job_exit shim". Signed-off-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Andrey Shinkevich Reviewed-by: Alberto Garcia --- block/stream.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/block/stream.c b/block/stream.c index 0920092ed2..e73a3201c8 100644 --- a/block/stream.c +++ b/block/stream.c @@ -122,13 +122,12 @@ static int coroutine_fn stream_run(Job *job, Error **= errp) void *buf; =20 if (!bs->backing) { - goto out; + return 0; } =20 len =3D bdrv_getlength(bs); if (len < 0) { - ret =3D len; - goto out; + return len; } job_progress_set_remaining(&s->common.job, len); =20 @@ -205,14 +204,10 @@ static int coroutine_fn stream_run(Job *job, Error **= errp) bdrv_disable_copy_on_read(bs); } =20 - /* Do not remove the backing file if an error was there but ignored. = */ - ret =3D error; - qemu_vfree(buf); =20 -out: - /* Modify backing chain and close BDSes in main loop */ - return ret; + /* Do not remove the backing file if an error was there but ignored. */ + return error; } =20 static const BlockJobDriver stream_job_driver =3D { --=20 2.18.0