|
From: | Eric Blake |
Subject: | Re: [Qemu-devel] [PATCH v2 20/40] job: Move single job finalisation to Job |
Date: | Fri, 18 May 2018 13:00:23 -0500 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 |
On 05/18/2018 08:20 AM, Kevin Wolf wrote:
This moves the finalisation of a single job from BlockJob to Job. Some part of this code depends on job transactions, and job transactions call this code, we introduce some temporary calls from Job functions to BlockJob ones. This will be fixed once transactions move to Job, too. Signed-off-by: Kevin Wolf <address@hidden> Reviewed-by: Max Reitz <address@hidden> ---
+++ b/job.c
@@ -449,6 +451,100 @@ void job_user_resume(Job *job, Error **errp) job_resume(job); }+void job_do_dismiss(Job *job)+{ + assert(job); + job->busy = false; + job->paused = false; + job->deferred_to_main_loop = true; + + /* TODO Don't assume it's a BlockJob */ + block_job_txn_del_job((BlockJob*) job);
checkpatch flagged this for style, but it goes away later in the series. But more than just style, this hard-codes the assumption that BlockJob has a Job member at offset 0. So would it be better to use container_of() instead of a bare cast, even though it is transient?
-- 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] |