From patchwork Sat Jan 27 02:05:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Snow X-Patchwork-Id: 866678 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zSzfd1LWRz9s75 for ; Sat, 27 Jan 2018 13:06:49 +1100 (AEDT) Received: from localhost ([::1]:43652 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1efFtH-0001R9-4e for incoming@patchwork.ozlabs.org; Fri, 26 Jan 2018 21:06:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37171) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1efFs1-0000je-Ua for qemu-devel@nongnu.org; Fri, 26 Jan 2018 21:05:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1efFs0-0008LY-Jb for qemu-devel@nongnu.org; Fri, 26 Jan 2018 21:05:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43020) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1efFrv-0008HH-GP; Fri, 26 Jan 2018 21:05:23 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 899B11490F6; Sat, 27 Jan 2018 02:05:22 +0000 (UTC) Received: from probe.bos.redhat.com (dhcp-17-231.bos.redhat.com [10.18.17.231]) by smtp.corp.redhat.com (Postfix) with ESMTP id DD66B608F7; Sat, 27 Jan 2018 02:05:15 +0000 (UTC) From: John Snow To: qemu-block@nongnu.org Date: Fri, 26 Jan 2018 21:05:01 -0500 Message-Id: <20180127020515.27137-1-jsnow@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Sat, 27 Jan 2018 02:05:22 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [RFC v3 00/14] blockjobs: add explicit job management 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: kwolf@redhat.com, John Snow , pkrempa@redhat.com, jtc@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" For jobs that complete when a monitor isn't looking, there's no way to tell what the job's final return code was. We need to allow jobs to remain in the list until queried for reliable management. Furthermore, it's not viable to have graph changes when the monitor isn't looking either. We need at least another event for that. This series is a rough sketch for the WAITING, PENDING and CONCLUDED events that accompany an expanded job management scheme that a management client can opt-in to. V3: - Added WAITING and PENDING events - Added block_job_finalize verb - Added .pending() callback for jobs - Tweaked how .commit/.abort work V2: - Added tests! - Changed property name (Jeff, Paolo) RFC / Known problems: - I need a lot more tests. - Jobs need to actually implement their .pending callback for this to be of any actual use. - Mirror needs to be refactored to use the commit/abort/pending/clean callbacks to fulfill the promise made by "no graph changes without user authorization" that PENDING is supposed to offer - Jobs beyond backup will be able to opt-in to the new management scheme in the next version. - V4 will include a forced synchronicity for jobs in a transaction; i.e. all jobs will be forced to use either the old or new styles, but not a mix. Please take a look and shout loudly if I'm wandering in the wrong direction.