[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC v4 10/21] blockjobs: add NULL state
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [RFC v4 10/21] blockjobs: add NULL state |
Date: |
Wed, 28 Feb 2018 16:42:53 +0100 |
User-agent: |
Mutt/1.9.1 (2017-09-22) |
Am 24.02.2018 um 00:51 hat John Snow geschrieben:
> Add a new state that specifically demarcates when we begin to permanently
> demolish a job after it has performed all work. This makes the transition
> explicit in the STM table and highlights conditions under which a job may
> be demolished.
>
>
> Transitions:
> Created -> Null: Early failure event before the job is started
> Concluded -> Null: Standard transition.
>
> Verbs:
> None. This should not ever be visible to the monitor.
>
> +---------+
> |UNDEFINED|
> +--+------+
> |
> +--v----+
> |CREATED+------------------+
> +--+----+ |
> | |
> +--v----+ +------+ |
> +---------+RUNNING<----->PAUSED| |
> | +--+-+--+ +------+ |
> | | | |
> | | +------------------+ |
> | | | |
> | +--v--+ +-------+ | |
> +---------+READY<------->STANDBY| | |
> | +--+--+ +-------+ | |
> | | | |
> +--v-----+ +--v------+ | |
> |ABORTING+--->CONCLUDED<-------------+ |
> +--------+ +--+------+ |
> | |
> +--v-+ |
> |NULL<---------------------+
> +----+
>
> Signed-off-by: John Snow <address@hidden>
The commit message does not match the code:
> @@ -423,6 +424,7 @@ static void block_job_completed_single(BlockJob *job)
> QLIST_REMOVE(job, txn_list);
> block_job_txn_unref(job->txn);
> block_job_event_concluded(job);
> + block_job_state_transition(job, BLOCK_JOB_STATUS_NULL);
> block_job_unref(job);
> }
>
> @@ -734,9 +736,6 @@ static void block_job_event_completed(BlockJob *job,
> const char *msg)
>
> 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);
> }
Any job that transition to NULL goes first through CONCLUDED. There is
no way to reach NULL directly from CREATED.
The second hunk addresses my comment in the previous patch, so it should
probably be squashed in there.
Kevin
- Re: [Qemu-devel] [RFC v4 12/21] blockjobs: ensure abort is called for cancelled jobs, (continued)
- [Qemu-devel] [RFC v4 08/21] blockjobs: add ABORTING state, John Snow, 2018/02/23
- [Qemu-devel] [RFC v4 20/21] iotests: test manual job dismissal, John Snow, 2018/02/23
- [Qemu-devel] [RFC v4 10/21] blockjobs: add NULL state, John Snow, 2018/02/23
- [Qemu-devel] [RFC v4 01/21] blockjobs: fix set-speed kick, John Snow, 2018/02/23
- [Qemu-devel] [RFC v4 15/21] blockjobs: add prepare callback, John Snow, 2018/02/23
- [Qemu-devel] [RFC v4 14/21] blockjobs: add block_job_txn_apply function, John Snow, 2018/02/23