From nobody Wed Dec 17 05:37:36 2025 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=1560874066; cv=none; d=zoho.com; s=zohoarc; b=PqqEQ4Gb0AFiBRMMASshke+L2VaBfDMx+K8Vs6c6VRQKMaC8TJyuTYLZN5SbaQ+3ySp4pxmuwjMtDWMs9vmuvppSkVp/v06KR5ukWjP/OmGw8emxBzGeZkaOw5OOe1sfZtBcaR49e040SIl4sZBM9d60QFdUJtbF7mPcsPOwbIs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560874066; 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=pk51vX0NvTdcGmq0QvDwqtja3ued5Bqfb1aw/03SRfg=; b=JonoOEGwzFnwonslT/2KPjmKDn+2L9PfFIFMP361FXFCAxZcRwLW16s3LVEZ8q7o22FaoFs11Y0XAe6uNE7E2+iqgblWnAFwTsmPgXo1j4+BNAR1qxxKr6dGMvbl7B3oUs9ZC52YIgw5nicBThXDfWfqQg4Ub9u0C7VU/9JC88s= 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 1560874066618677.93143068489; Tue, 18 Jun 2019 09:07:46 -0700 (PDT) Received: from localhost ([::1]:59330 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdGe4-0002yj-MP for importer@patchew.org; Tue, 18 Jun 2019 12:07:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55922) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdFxV-000822-4H for qemu-devel@nongnu.org; Tue, 18 Jun 2019 11:23:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdFxR-0000gV-6G for qemu-devel@nongnu.org; Tue, 18 Jun 2019 11:23:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42854) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hdFxJ-0000N4-SW; Tue, 18 Jun 2019 11:23:31 -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 7AAEB31628E4; Tue, 18 Jun 2019 15:23:26 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-185.ams2.redhat.com [10.36.116.185]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9398D5BBD2; Tue, 18 Jun 2019 15:23:25 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 18 Jun 2019 17:23:07 +0200 Message-Id: <20190618152318.24953-4-kwolf@redhat.com> In-Reply-To: <20190618152318.24953-1-kwolf@redhat.com> References: <20190618152318.24953-1-kwolf@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.41]); Tue, 18 Jun 2019 15:23:26 +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/14] block/block-backend: blk_iostatus_reset: drop usage of bs->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: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy We are going to remove bs->job pointer. Drop it's usage in blk_iostatus_reset. blk_iostatus_reset() has only two callers: 1. blk_attach_dev(). This doesn't have anything to do with jobs and attaching a new guest device won't solve any problem the job encountered, so no reason to reset the iostatus for the job. 2. qmp_cont(). This resets the iostatus for everything. We can just call block_job_iostatus_reset() for all block jobs instead of going through BlockBackend. Suggested-by: Kevin Wolf Signed-off-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Kevin Wolf --- block/block-backend.c | 4 ---- monitor/qmp-cmds.c | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/block/block-backend.c b/block/block-backend.c index f5d9407d20..a8d160fd5d 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -1073,11 +1073,7 @@ void blk_iostatus_disable(BlockBackend *blk) void blk_iostatus_reset(BlockBackend *blk) { if (blk_iostatus_is_enabled(blk)) { - BlockDriverState *bs =3D blk_bs(blk); blk->iostatus =3D BLOCK_DEVICE_IO_STATUS_OK; - if (bs && bs->job) { - block_job_iostatus_reset(bs->job); - } } } =20 diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c index f1b1e4f08b..01ce77e129 100644 --- a/monitor/qmp-cmds.c +++ b/monitor/qmp-cmds.c @@ -143,6 +143,7 @@ void qmp_x_exit_preconfig(Error **errp) void qmp_cont(Error **errp) { BlockBackend *blk; + BlockJob *job; Error *local_err =3D NULL; =20 /* if there is a dump in background, we should wait until the dump @@ -166,6 +167,10 @@ void qmp_cont(Error **errp) blk_iostatus_reset(blk); } =20 + for (job =3D block_job_next(NULL); job; job =3D block_job_next(job)) { + block_job_iostatus_reset(job); + } + /* Continuing after completed migration. Images have been inactivated = to * allow the destination to take control. Need to get control back now. * --=20 2.20.1