mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
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: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
0cb3061943
commit
2624c6d2d2
@ -71,6 +71,14 @@ VIR_ENUM_IMPL(qemuBlockjob,
|
||||
static virClassPtr qemuBlockJobDataClass;
|
||||
|
||||
|
||||
static void
|
||||
qemuBlockJobDataDisposeJobdata(qemuBlockJobDataPtr job)
|
||||
{
|
||||
if (job->type == QEMU_BLOCKJOB_TYPE_CREATE)
|
||||
virObjectUnref(job->data.create.src);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
qemuBlockJobDataDispose(void *obj)
|
||||
{
|
||||
@ -79,8 +87,7 @@ qemuBlockJobDataDispose(void *obj)
|
||||
virObjectUnref(job->chain);
|
||||
virObjectUnref(job->mirrorChain);
|
||||
|
||||
if (job->type == QEMU_BLOCKJOB_TYPE_CREATE)
|
||||
virObjectUnref(job->data.create.src);
|
||||
qemuBlockJobDataDisposeJobdata(job);
|
||||
|
||||
g_free(job->name);
|
||||
g_free(job->errmsg);
|
||||
|
Loading…
x
Reference in New Issue
Block a user