qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] job: split job API in driver and monitor
@ 2022-02-08 14:39 Emanuele Giuseppe Esposito
  2022-02-08 14:39 ` [PATCH v2 1/3] jobs: add job-common.h Emanuele Giuseppe Esposito
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Emanuele Giuseppe Esposito @ 2022-02-08 14:39 UTC (permalink / raw)
  To: qemu-block
  Cc: Emanuele Giuseppe Esposito, Vladimir Sementsov-Ogievskiy,
	qemu-devel, Stefan Hajnoczi, Paolo Bonzini, John Snow

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.

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

Based-on: <20220208143513.1077229-1-eesposit@redhat.com>
---
v2:
 * rebased on new version of job_api

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

 include/qemu/job-common.h  | 357 +++++++++++++++++++
 include/qemu/job-driver.h  | 211 +++++++++++
 include/qemu/job-monitor.h | 249 +++++++++++++
 include/qemu/job.h         | 697 +------------------------------------
 job.c                      |   4 +-
 5 files changed, 823 insertions(+), 695 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

-- 
2.31.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-02-08 17:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-08 14:39 [PATCH v2 0/3] job: split job API in driver and monitor Emanuele Giuseppe Esposito
2022-02-08 14:39 ` [PATCH v2 1/3] jobs: add job-common.h Emanuele Giuseppe Esposito
2022-02-08 14:39 ` [PATCH v2 2/3] jobs: add job-monitor.h Emanuele Giuseppe Esposito
2022-02-08 14:39 ` [PATCH v2 3/3] jobs: add job-driver.h Emanuele Giuseppe Esposito

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).