[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC PATCH 0/3] job: split job API in driver and monitor

From: Emanuele Giuseppe Esposito
Subject: [RFC PATCH 0/3] job: split job API in driver and monitor
Date: Thu, 4 Nov 2021 11:31:18 -0400

In this series, we split the job API in two headers:
job-driver.h and job-monitor.h.
As explained in job.c, job-monitor are the functions mainly used
by the monitor, and require consistency between the search of
a specific job (job_get) and the actual operation/action on it
(e.g. job_user_cancel). Therefore job-monitor API assume that
the job mutex lock is always held by the caller.

job-driver, on the other side, is the collection of functions
that are used by the job drivers or core block layer. These
functions are not aware of the job mutex, and delegate the
locking to the callee instead.

We also have job-common.h contains the job struct definition
and common functions that are not part of monitor or driver APIs.
job.h is left for legacy and to avoid changing all files that
include it.

RFC: alternative names for the headers: job-locked (was job-monitor)
and job-self-locking (was job-driver). I am open to suggestion for
alternative names.

This serie is based on my previous series "job: replace AioContext
lock with job_mutex".

Based-on: <20211104145334.1346363-1-eesposit@redhat.com>

Emanuele Giuseppe Esposito (3):
  jobs: add job-common.h
  jobs: add job-monitor.h
  jobs: add job-driver.h

 include/qemu/job-common.h  | 336 +++++++++++++++++++
 include/qemu/job-driver.h  | 173 ++++++++++
 include/qemu/job-monitor.h | 282 ++++++++++++++++
 include/qemu/job.h         | 662 +------------------------------------
 job.c                      |   4 +-
 5 files changed, 797 insertions(+), 660 deletions(-)
 create mode 100644 include/qemu/job-common.h
 create mode 100644 include/qemu/job-driver.h
 create mode 100644 include/qemu/job-monitor.h


reply via email to

[Prev in Thread] Current Thread [Next in Thread]