Re: [Qemu-devel] [PATCH 14/42] job: Add reference counting

2018-05-16 Thread Eric Blake
On 05/16/2018 03:56 PM, Kevin Wolf wrote: + +void job_unref(Job *job) +{ +if (--job->refcnt == 0) { Should this be free()-like and allow an incoming job == NULL as a no-op? This behaves like block_job_unref() always behavec, and I don't see a single caller having a NULL check before call

Re: [Qemu-devel] [PATCH 14/42] job: Add reference counting

2018-05-16 Thread Kevin Wolf
Am 16.05.2018 um 20:17 hat Eric Blake geschrieben: > On 05/09/2018 11:26 AM, Kevin Wolf wrote: > > This moves reference counting from BlockJob to Job. > > > > In order to keep calling the BlockJob cleanup code when the job is > > deleted via job_unref(), introduce a new JobDriver.free callback. Ev

Re: [Qemu-devel] [PATCH 14/42] job: Add reference counting

2018-05-16 Thread Eric Blake
On 05/09/2018 11:26 AM, Kevin Wolf wrote: This moves reference counting from BlockJob to Job. In order to keep calling the BlockJob cleanup code when the job is deleted via job_unref(), introduce a new JobDriver.free callback. Every block job must use block_job_free() for this callback, this is

Re: [Qemu-devel] [PATCH 14/42] job: Add reference counting

2018-05-15 Thread Kevin Wolf
Am 14.05.2018 um 23:34 hat John Snow geschrieben: > > > On 05/09/2018 12:26 PM, Kevin Wolf wrote: > > This moves reference counting from BlockJob to Job. > > > > In order to keep calling the BlockJob cleanup code when the job is > > deleted via job_unref(), introduce a new JobDriver.free callbac

Re: [Qemu-devel] [PATCH 14/42] job: Add reference counting

2018-05-14 Thread John Snow
On 05/09/2018 12:26 PM, Kevin Wolf wrote: > This moves reference counting from BlockJob to Job. > > In order to keep calling the BlockJob cleanup code when the job is > deleted via job_unref(), introduce a new JobDriver.free callback. Every > block job must use block_job_free() for this callback

Re: [Qemu-devel] [PATCH 14/42] job: Add reference counting

2018-05-14 Thread Max Reitz
On 2018-05-09 18:26, Kevin Wolf wrote: > This moves reference counting from BlockJob to Job. > > In order to keep calling the BlockJob cleanup code when the job is > deleted via job_unref(), introduce a new JobDriver.free callback. Every > block job must use block_job_free() for this callback, thi

[Qemu-devel] [PATCH 14/42] job: Add reference counting

2018-05-09 Thread Kevin Wolf
This moves reference counting from BlockJob to Job. In order to keep calling the BlockJob cleanup code when the job is deleted via job_unref(), introduce a new JobDriver.free callback. Every block job must use block_job_free() for this callback, this is asserted in block_job_create(). Signed-off-