qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH 08/42] job: Create Job, JobDriver and job_create


From: Kevin Wolf
Subject: Re: [Qemu-block] [PATCH 08/42] job: Create Job, JobDriver and job_create()
Date: Mon, 14 May 2018 14:58:19 +0200
User-agent: Mutt/1.9.1 (2017-09-22)

Am 12.05.2018 um 00:46 hat Max Reitz geschrieben:
> On 2018-05-09 18:26, Kevin Wolf wrote:
> > This is the first step towards creating an infrastructure for generic
> > background jobs that aren't tied to a block device. For now, Job only
> > stores its ID and JobDriver, the rest stays in BlockJob.
> > 
> > The following patches will move over more parts of BlockJob to Job if
> > they are meaningful outside the context of a block job.
> > 
> > Signed-off-by: Kevin Wolf <address@hidden>
> > ---
> >  include/block/blockjob.h     |  9 +++----
> >  include/block/blockjob_int.h |  4 +--
> >  include/qemu/job.h           | 60 
> > ++++++++++++++++++++++++++++++++++++++++++++
> >  block/backup.c               |  4 ++-
> >  block/commit.c               |  4 ++-
> >  block/mirror.c               | 10 +++++---
> >  block/stream.c               |  4 ++-
> >  blockjob.c                   | 46 ++++++++++++++++-----------------
> >  job.c                        | 48 +++++++++++++++++++++++++++++++++++
> >  tests/test-bdrv-drain.c      |  4 ++-
> >  tests/test-blockjob-txn.c    |  4 ++-
> >  tests/test-blockjob.c        | 12 ++++++---
> >  MAINTAINERS                  |  2 ++
> >  Makefile.objs                |  2 +-
> >  14 files changed, 169 insertions(+), 44 deletions(-)
> >  create mode 100644 include/qemu/job.h
> >  create mode 100644 job.c
> > 
> > diff --git a/include/block/blockjob.h b/include/block/blockjob.h
> > index 0b57d53084..8acc1a236a 100644
> > --- a/include/block/blockjob.h
> > +++ b/include/block/blockjob.h
> 
> [...]
> 
> > @@ -40,6 +41,9 @@ typedef struct BlockJobTxn BlockJobTxn;
> >   * Long-running operation on a BlockDriverState.
> >   */
> >  typedef struct BlockJob {
> > +    /** Data belonging to the generic Job infrastructure */
> > +    Job job;
> > +
> >      /** The job type, including the job vtable.  */
> >      const BlockJobDriver *driver;
> 
> Any reason why you keep this field around?  Shouldn't it be just
> DO_UPCAST(const BlockJobDriver, job_driver, job.driver)?

I left it around to avoid unnecessary churn at this point. However, I
intended to remove it at the end of the series, which I seem to have
forgotten. I'll add a patch to this effect.

Kevin

Attachment: signature.asc
Description: PGP signature


reply via email to

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