提交 2624c6d2 编写于 作者: P Peter Krempa

qemu: blockjob: Separate clearing of per-job data

We will need to clear per-job type data when we will be marking a
blockjob as broken in the new way. Extract the code for future reuse.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NCole Robinson <crobinso@redhat.com>
上级 0cb30619
...@@ -71,6 +71,14 @@ VIR_ENUM_IMPL(qemuBlockjob, ...@@ -71,6 +71,14 @@ VIR_ENUM_IMPL(qemuBlockjob,
static virClassPtr qemuBlockJobDataClass; static virClassPtr qemuBlockJobDataClass;
static void
qemuBlockJobDataDisposeJobdata(qemuBlockJobDataPtr job)
{
if (job->type == QEMU_BLOCKJOB_TYPE_CREATE)
virObjectUnref(job->data.create.src);
}
static void static void
qemuBlockJobDataDispose(void *obj) qemuBlockJobDataDispose(void *obj)
{ {
...@@ -79,8 +87,7 @@ qemuBlockJobDataDispose(void *obj) ...@@ -79,8 +87,7 @@ qemuBlockJobDataDispose(void *obj)
virObjectUnref(job->chain); virObjectUnref(job->chain);
virObjectUnref(job->mirrorChain); virObjectUnref(job->mirrorChain);
if (job->type == QEMU_BLOCKJOB_TYPE_CREATE) qemuBlockJobDataDisposeJobdata(job);
virObjectUnref(job->data.create.src);
g_free(job->name); g_free(job->name);
g_free(job->errmsg); g_free(job->errmsg);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册