From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1er7Pf-0002My-My for qemu-devel@nongnu.org; Wed, 28 Feb 2018 14:29:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1er7Pb-0005BM-IE for qemu-devel@nongnu.org; Wed, 28 Feb 2018 14:29:15 -0500 References: <20180223235142.21501-1-jsnow@redhat.com> <20180223235142.21501-10-jsnow@redhat.com> <20180228153743.GC4855@localhost.localdomain> From: John Snow Message-ID: <1129c06d-1d3d-6568-bfb1-e12e3e84ee34@redhat.com> Date: Wed, 28 Feb 2018 14:29:08 -0500 MIME-Version: 1.0 In-Reply-To: <20180228153743.GC4855@localhost.localdomain> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC v4 09/21] blockjobs: add CONCLUDED state List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: pkrempa@redhat.com, jtc@redhat.com, qemu-devel@nongnu.org, qemu-block@nongnu.org On 02/28/2018 10:37 AM, Kevin Wolf wrote: > Am 24.02.2018 um 00:51 hat John Snow geschrieben: >> add a new state "CONCLUDED" that identifies a job that has ceased all >> operations. The wording was chosen to avoid any phrasing that might >> imply success, error, or cancellation. The task has simply ceased all >> operation and can never again perform any work. >> >> ("finished", "done", and "completed" might all imply success.) >> >> Transitions: >> Running -> Concluded: normal completion >> Ready -> Concluded: normal completion >> Aborting -> Concluded: error and cancellations >> >> Verbs: >> None as of this commit. (a future commit adds 'dismiss') >> >> +---------+ >> |UNDEFINED| >> +--+------+ >> | >> +--v----+ >> |CREATED| >> +--+----+ >> | >> +--v----+ +------+ >> +---------+RUNNING<----->PAUSED| >> | +--+-+--+ +------+ >> | | | >> | | +------------------+ >> | | | >> | +--v--+ +-------+ | >> +---------+READY<------->STANDBY| | >> | +--+--+ +-------+ | >> | | | >> +--v-----+ +--v------+ | >> |ABORTING+--->CONCLUDED<-------------+ >> +--------+ +---------+ >> >> Signed-off-by: John Snow > >> +static void block_job_event_concluded(BlockJob *job) >> +{ >> + if (block_job_is_internal(job) || !job->manual) { >> + return; >> + } >> + block_job_state_transition(job, BLOCK_JOB_STATUS_CONCLUDED); >> +} > > I don't understand why internal or automatic jobs should follow a > different state machine. Sure, they won't be in this state for long The very simple answer is because I overlooked this change from when I did implement separate graphs for the old and new models. > because the job is immediately unref'ed. Though if someone holds an > additional reference, it might be visible - I would consider this a bug > fix because otherwise the job stays in READY and continues to accept the > verbs for that state. > > Kevin >