All of lore.kernel.org
 help / color / mirror / Atom feed
From: Emanuele Giuseppe Esposito <eesposit@redhat.com>
To: qemu-block@nongnu.org
Cc: Emanuele Giuseppe Esposito <eesposit@redhat.com>,
	Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>, John Snow <jsnow@redhat.com>
Subject: [RFC PATCH 0/3] job: split job API in driver and monitor
Date: Thu,  4 Nov 2021 11:31:18 -0400	[thread overview]
Message-ID: <20211104153121.1362449-1-eesposit@redhat.com> (raw)

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

-- 
2.27.0



             reply	other threads:[~2021-11-04 15:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-04 15:31 Emanuele Giuseppe Esposito [this message]
2021-11-04 15:31 ` [RFC PATCH 1/3] jobs: add job-common.h Emanuele Giuseppe Esposito
2021-11-04 15:31 ` [RFC PATCH 2/3] jobs: add job-monitor.h Emanuele Giuseppe Esposito
2021-11-04 15:31 ` [RFC PATCH 3/3] jobs: add job-driver.h Emanuele Giuseppe Esposito

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211104153121.1362449-1-eesposit@redhat.com \
    --to=eesposit@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=vsementsov@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.