|
| From: | Eric Blake |
| Subject: | Re: [Qemu-devel] [PATCH 14/42] job: Add reference counting |
| Date: | Wed, 16 May 2018 13:17:45 -0500 |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 |
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 asserted in block_job_create(). Signed-off-by: Kevin Wolf <address@hidden> ---
+++ b/job.c
+
+void job_unref(Job *job)
+{
+ if (--job->refcnt == 0) {
Should this be free()-like and allow an incoming job == NULL as a no-op? -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
| [Prev in Thread] | Current Thread | [Next in Thread] |