mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 03:25:20 +00:00
qemu_blockjob: Move active commit failed state handling into a function
Currently, there are only a few lines of code so a separate function was not necessary, but this will change. So instead of putting all the new code under 'case QEMU_BLOCKJOB_TYPE_ACTIVE_COMMIT' create a separate function. Just like every other case has one. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> ACKed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
86289374ef
commit
143a0f8b05
@ -1121,6 +1121,20 @@ qemuBlockJobProcessEventConcludedCopyAbort(virQEMUDriverPtr driver,
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
qemuBlockJobProcessEventFailedActiveCommit(virDomainObjPtr vm,
|
||||
qemuBlockJobDataPtr job)
|
||||
{
|
||||
VIR_DEBUG("active commit job '%s' on VM '%s' failed", job->name, vm->def->name);
|
||||
|
||||
if (!job->disk)
|
||||
return;
|
||||
|
||||
virObjectUnref(job->disk->mirror);
|
||||
job->disk->mirror = NULL;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
qemuBlockJobProcessEventConcludedCreate(virQEMUDriverPtr driver,
|
||||
virDomainObjPtr vm,
|
||||
@ -1211,10 +1225,7 @@ qemuBlockJobEventProcessConcludedTransition(qemuBlockJobDataPtr job,
|
||||
break;
|
||||
|
||||
case QEMU_BLOCKJOB_TYPE_ACTIVE_COMMIT:
|
||||
if (job->disk) {
|
||||
virObjectUnref(job->disk->mirror);
|
||||
job->disk->mirror = NULL;
|
||||
}
|
||||
qemuBlockJobProcessEventFailedActiveCommit(vm, job);
|
||||
break;
|
||||
|
||||
case QEMU_BLOCKJOB_TYPE_CREATE:
|
||||
|
Loading…
Reference in New Issue
Block a user