From patchwork Tue Sep 4 17:09:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Snow X-Patchwork-Id: 10587707 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AF9F4180E for ; Tue, 4 Sep 2018 17:16:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD61129EE3 for ; Tue, 4 Sep 2018 17:16:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A1B8429E93; Tue, 4 Sep 2018 17:16:53 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 32B9329ACE for ; Tue, 4 Sep 2018 17:16:53 +0000 (UTC) Received: from localhost ([::1]:51925 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fxEwe-0004Q2-0K for patchwork-qemu-devel@patchwork.kernel.org; Tue, 04 Sep 2018 13:16:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53125) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fxEpl-0004gm-9w for qemu-devel@nongnu.org; Tue, 04 Sep 2018 13:09:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fxEpj-0001d9-VY for qemu-devel@nongnu.org; Tue, 04 Sep 2018 13:09:45 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:35512 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fxEpf-0001Z9-98; Tue, 04 Sep 2018 13:09:39 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 978DB40216E8; Tue, 4 Sep 2018 17:09:38 +0000 (UTC) Received: from probe.redhat.com (ovpn-121-128.rdu2.redhat.com [10.10.121.128]) by smtp.corp.redhat.com (Postfix) with ESMTP id 012CEA9F03; Tue, 4 Sep 2018 17:09:33 +0000 (UTC) From: John Snow To: qemu-block@nongnu.org, qemu-devel@nongnu.org Date: Tue, 4 Sep 2018 13:09:15 -0400 Message-Id: <20180904170930.28619-1-jsnow@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 04 Sep 2018 17:09:38 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 04 Sep 2018 17:09:38 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jsnow@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v4 00/15] jobs: Job Exit Refactoring Pt 2 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: Kevin Wolf , Markus Armbruster , Jeff Cody , "Dr. David Alan Gilbert" , Max Reitz , John Snow , jtc@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This is part two of a two part series that refactors the exit logic of jobs. This series forces all jobs to use the "finalize" semantics that were introduced previously, but only exposed via the backup jobs. Patches 1-3 add plumbing for the auto-dismiss and auto-finalize flags but do not expose these via QAPI/QMP. Patches 4-7 refactor the .exit() callbacks into the component pieces of .prepare(), .commit(), .abort() and .clean(). Except mirror, which I cheat with. Patches 8-10 remove the last usages of .exit in a test. Patche 11 removes the .exit callback and the machinery to invoke it. Patches 12-14 expose the new QMP options to all of the jobs. Patch 15 is a doc fixup. ==== "V4" ==== Key: [----] : patches are identical [####] : number of functional differences between upstream/downstream patch [down] : patch is downstream-only The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively 001/15:[----] [--] 'block/commit: add block job creation flags' 002/15:[----] [--] 'block/mirror: add block job creation flags' 003/15:[----] [--] 'block/stream: add block job creation flags' 004/15:[----] [--] 'block/commit: refactor commit to use job callbacks' 005/15:[0024] [FC] 'block/mirror: don't install backing chain on abort' 006/15:[0007] [FC] 'block/mirror: conservative mirror_exit refactor' 007/15:[down] 'block/stream: refactor stream to use job callbacks' 008/15:[----] [--] 'tests/blockjob: replace Blockjob with Job' 009/15:[----] [--] 'tests/test-blockjob: remove exit callback' 010/15:[----] [--] 'tests/test-blockjob-txn: move .exit to .clean' 011/15:[----] [--] 'jobs: remove .exit callback' 012/15:[----] [--] 'qapi/block-commit: expose new job properties' 013/15:[----] [--] 'qapi/block-mirror: expose new job properties' 014/15:[----] [--] 'qapi/block-stream: expose new job properties' 015/15:[----] [--] 'block/backup: qapi documentation fixup' 002, 003: Fix typo (Eric) 005: Don't not install the backing chain if we cancel a successful job (Max) 006: Fallout from 005 007: Fixed commit title. (Max) ==== "V3" ==== 000: Fixed my cover letter subject. Phew! 004: Adjusted comment, added R-B 005: New; based on discussions from what is now 006 (was 005) 006: mirror_exit_common returns ret == 0 if we are aborting and it aborts successfully (Max) Added assertion that we aborted successfully (Max) 010: New, minor cleanup before we can actually remove .exit. 011: Removed what's now patch 10, added R-B per Max's comment. ===== "V2": ===== - Split off the first part of the series to Pt.1 - More aggressively refactored .commit() - Went all the way to deleting .exit() callback (Kevin) John Snow (15): block/commit: add block job creation flags block/mirror: add block job creation flags block/stream: add block job creation flags block/commit: refactor commit to use job callbacks block/mirror: don't install backing chain on abort block/mirror: conservative mirror_exit refactor block/stream: refactor stream to use job callbacks tests/blockjob: replace Blockjob with Job tests/test-blockjob: remove exit callback tests/test-blockjob-txn: move .exit to .clean jobs: remove .exit callback qapi/block-commit: expose new job properties qapi/block-mirror: expose new job properties qapi/block-stream: expose new job properties block/backup: qapi documentation fixup block/commit.c | 95 +++++++++++++++++++++----------------- block/mirror.c | 44 ++++++++++++------ block/stream.c | 28 ++++++++---- blockdev.c | 44 ++++++++++++++++-- hmp.c | 5 +- include/block/block_int.h | 15 ++++-- include/qemu/job.h | 11 ----- job.c | 77 ++++++++++++++----------------- qapi/block-core.json | 80 +++++++++++++++++++++++++++----- tests/test-blockjob-txn.c | 4 +- tests/test-blockjob.c | 114 +++++++++++++++++++++++----------------------- 11 files changed, 315 insertions(+), 202 deletions(-)