From patchwork Mon Jun 20 14:05:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 9187585 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F2A7B6075E for ; Mon, 20 Jun 2016 14:14:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF0D02711E for ; Mon, 20 Jun 2016 14:14:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D3B2E2780C; Mon, 20 Jun 2016 14:14:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 50C042711E for ; Mon, 20 Jun 2016 14:14:45 +0000 (UTC) Received: from localhost ([::1]:43889 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEzyO-0000sV-1Q for patchwork-qemu-devel@patchwork.kernel.org; Mon, 20 Jun 2016 10:14:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47765) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEzq8-00081N-Oh for qemu-devel@nongnu.org; Mon, 20 Jun 2016 10:06:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bEzq1-00077D-Ih for qemu-devel@nongnu.org; Mon, 20 Jun 2016 10:06:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48087) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEzq1-00076y-AS for qemu-devel@nongnu.org; Mon, 20 Jun 2016 10:06:05 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9D171C00FBCB; Mon, 20 Jun 2016 14:06:04 +0000 (UTC) Received: from localhost (ovpn-112-59.ams2.redhat.com [10.36.112.59]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5KE63fY032410; Mon, 20 Jun 2016 10:06:03 -0400 From: Stefan Hajnoczi To: Date: Mon, 20 Jun 2016 15:05:24 +0100 Message-Id: <1466431531-17806-14-git-send-email-stefanha@redhat.com> In-Reply-To: <1466431531-17806-1-git-send-email-stefanha@redhat.com> References: <1466431531-17806-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 20 Jun 2016 14:06:04 +0000 (UTC) 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 13/20] blockjob: move iostatus reset out of block_job_enter() 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: Peter Maydell , Stefan Hajnoczi Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The QMP block-job-resume command and cancellation may want to reset the job's iostatus. The next patches add a user who does not want to reset iostatus so move it up to block_job_enter() callers. Signed-off-by: Stefan Hajnoczi Reviewed-by: Fam Zheng Reviewed-by: Paolo Bonzini Message-id: 1466096189-6477-2-git-send-email-stefanha@redhat.com --- blockdev.c | 1 + blockjob.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/blockdev.c b/blockdev.c index c9a0068..7299312 100644 --- a/blockdev.c +++ b/blockdev.c @@ -3811,6 +3811,7 @@ void qmp_block_job_resume(const char *device, Error **errp) job->user_paused = false; trace_qmp_block_job_resume(job); + block_job_iostatus_reset(job); block_job_resume(job); aio_context_release(aio_context); } diff --git a/blockjob.c b/blockjob.c index 01b896b..5137dce 100644 --- a/blockjob.c +++ b/blockjob.c @@ -269,7 +269,6 @@ void block_job_resume(BlockJob *job) void block_job_enter(BlockJob *job) { - block_job_iostatus_reset(job); if (job->co && !job->busy) { qemu_coroutine_enter(job->co, NULL); } @@ -278,6 +277,7 @@ void block_job_enter(BlockJob *job) void block_job_cancel(BlockJob *job) { job->cancelled = true; + block_job_iostatus_reset(job); block_job_enter(job); }