[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH v2 02/14] job.h: categorize fields in struct Job
From: |
Stefan Hajnoczi |
Subject: |
Re: [RFC PATCH v2 02/14] job.h: categorize fields in struct Job |
Date: |
Thu, 16 Dec 2021 16:21:44 +0000 |
On Thu, Nov 04, 2021 at 10:53:22AM -0400, Emanuele Giuseppe Esposito wrote:
> Categorize the fields in struct Job to understand which ones
> need to be protected by the job mutex and which don't.
>
> Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
> ---
> include/qemu/job.h | 57 +++++++++++++++++++++++++++-------------------
> 1 file changed, 34 insertions(+), 23 deletions(-)
>
> diff --git a/include/qemu/job.h b/include/qemu/job.h
> index ccf7826426..f7036ac6b3 100644
> --- a/include/qemu/job.h
> +++ b/include/qemu/job.h
> @@ -40,27 +40,52 @@ typedef struct JobTxn JobTxn;
> * Long-running operation.
> */
> typedef struct Job {
> +
> + /* Fields set at initialization (job_create), and never modified */
> +
> /** The ID of the job. May be NULL for internal jobs. */
> char *id;
>
> - /** The type of this job. */
> + /**
> + * The type of this job.
> + * All callbacks are called with job_mutex *not* held.
> + */
> const JobDriver *driver;
>
> - /** Reference count of the block job */
> - int refcnt;
> -
> - /** Current state; See @JobStatus for details. */
> - JobStatus status;
> -
> /** AioContext to run the job coroutine in */
> AioContext *aio_context;
"Fields set at initialization (job_create), and never modified" does not
apply here. blockjob.c:child_job_set_aio_ctx() changes it at runtime.
signature.asc
Description: PGP signature
- Re: [RFC PATCH v2 02/14] job.h: categorize fields in struct Job,
Stefan Hajnoczi <=