mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 19:11:16 +00:00
qemu: stop checking virObjectUnref return value
Some, but not all, of the monitor event handlers check the virObjectUnref return value to see if the domain was disposed. It should not be possible for this to happen, since the function already holds a lock on the domain and has only just acquired an extra reference on the domain a few lines earlier. Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
edea0d9894
commit
fd460ef561
@ -307,7 +307,7 @@ qemuProcessHandleMonitorEOF(qemuMonitorPtr mon,
|
|||||||
processEvent->vm = virObjectRef(vm);
|
processEvent->vm = virObjectRef(vm);
|
||||||
|
|
||||||
if (virThreadPoolSendJob(driver->workerPool, 0, processEvent) < 0) {
|
if (virThreadPoolSendJob(driver->workerPool, 0, processEvent) < 0) {
|
||||||
ignore_value(virObjectUnref(vm));
|
virObjectUnref(vm);
|
||||||
qemuProcessEventFree(processEvent);
|
qemuProcessEventFree(processEvent);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -840,14 +840,12 @@ qemuProcessHandleWatchdog(qemuMonitorPtr mon G_GNUC_UNUSED,
|
|||||||
*/
|
*/
|
||||||
processEvent->vm = virObjectRef(vm);
|
processEvent->vm = virObjectRef(vm);
|
||||||
if (virThreadPoolSendJob(driver->workerPool, 0, processEvent) < 0) {
|
if (virThreadPoolSendJob(driver->workerPool, 0, processEvent) < 0) {
|
||||||
if (!virObjectUnref(vm))
|
virObjectUnref(vm);
|
||||||
vm = NULL;
|
|
||||||
qemuProcessEventFree(processEvent);
|
qemuProcessEventFree(processEvent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vm)
|
|
||||||
virObjectUnlock(vm);
|
virObjectUnlock(vm);
|
||||||
virObjectEventStateQueue(driver->domainEventState, watchdogEvent);
|
virObjectEventStateQueue(driver->domainEventState, watchdogEvent);
|
||||||
virObjectEventStateQueue(driver->domainEventState, lifecycleEvent);
|
virObjectEventStateQueue(driver->domainEventState, lifecycleEvent);
|
||||||
@ -977,7 +975,7 @@ qemuProcessHandleBlockJob(qemuMonitorPtr mon G_GNUC_UNUSED,
|
|||||||
processEvent->status = status;
|
processEvent->status = status;
|
||||||
|
|
||||||
if (virThreadPoolSendJob(driver->workerPool, 0, processEvent) < 0) {
|
if (virThreadPoolSendJob(driver->workerPool, 0, processEvent) < 0) {
|
||||||
ignore_value(virObjectUnref(vm));
|
virObjectUnref(vm);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1039,7 +1037,7 @@ qemuProcessHandleJobStatusChange(qemuMonitorPtr mon G_GNUC_UNUSED,
|
|||||||
processEvent->data = virObjectRef(job);
|
processEvent->data = virObjectRef(job);
|
||||||
|
|
||||||
if (virThreadPoolSendJob(driver->workerPool, 0, processEvent) < 0) {
|
if (virThreadPoolSendJob(driver->workerPool, 0, processEvent) < 0) {
|
||||||
ignore_value(virObjectUnref(vm));
|
virObjectUnref(vm);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1342,13 +1340,11 @@ qemuProcessHandleGuestPanic(qemuMonitorPtr mon G_GNUC_UNUSED,
|
|||||||
processEvent->vm = virObjectRef(vm);
|
processEvent->vm = virObjectRef(vm);
|
||||||
|
|
||||||
if (virThreadPoolSendJob(driver->workerPool, 0, processEvent) < 0) {
|
if (virThreadPoolSendJob(driver->workerPool, 0, processEvent) < 0) {
|
||||||
if (!virObjectUnref(vm))
|
virObjectUnref(vm);
|
||||||
vm = NULL;
|
|
||||||
qemuProcessEventFree(processEvent);
|
qemuProcessEventFree(processEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (vm)
|
|
||||||
virObjectUnlock(vm);
|
virObjectUnlock(vm);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -1383,7 +1379,7 @@ qemuProcessHandleDeviceDeleted(qemuMonitorPtr mon G_GNUC_UNUSED,
|
|||||||
processEvent->vm = virObjectRef(vm);
|
processEvent->vm = virObjectRef(vm);
|
||||||
|
|
||||||
if (virThreadPoolSendJob(driver->workerPool, 0, processEvent) < 0) {
|
if (virThreadPoolSendJob(driver->workerPool, 0, processEvent) < 0) {
|
||||||
ignore_value(virObjectUnref(vm));
|
virObjectUnref(vm);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1554,7 +1550,7 @@ qemuProcessHandleNicRxFilterChanged(qemuMonitorPtr mon G_GNUC_UNUSED,
|
|||||||
processEvent->vm = virObjectRef(vm);
|
processEvent->vm = virObjectRef(vm);
|
||||||
|
|
||||||
if (virThreadPoolSendJob(driver->workerPool, 0, processEvent) < 0) {
|
if (virThreadPoolSendJob(driver->workerPool, 0, processEvent) < 0) {
|
||||||
ignore_value(virObjectUnref(vm));
|
virObjectUnref(vm);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1593,7 +1589,7 @@ qemuProcessHandleSerialChanged(qemuMonitorPtr mon G_GNUC_UNUSED,
|
|||||||
processEvent->vm = virObjectRef(vm);
|
processEvent->vm = virObjectRef(vm);
|
||||||
|
|
||||||
if (virThreadPoolSendJob(driver->workerPool, 0, processEvent) < 0) {
|
if (virThreadPoolSendJob(driver->workerPool, 0, processEvent) < 0) {
|
||||||
ignore_value(virObjectUnref(vm));
|
virObjectUnref(vm);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1873,13 +1869,11 @@ qemuProcessHandleGuestCrashloaded(qemuMonitorPtr mon G_GNUC_UNUSED,
|
|||||||
processEvent->vm = virObjectRef(vm);
|
processEvent->vm = virObjectRef(vm);
|
||||||
|
|
||||||
if (virThreadPoolSendJob(driver->workerPool, 0, processEvent) < 0) {
|
if (virThreadPoolSendJob(driver->workerPool, 0, processEvent) < 0) {
|
||||||
if (!virObjectUnref(vm))
|
virObjectUnref(vm);
|
||||||
vm = NULL;
|
|
||||||
qemuProcessEventFree(processEvent);
|
qemuProcessEventFree(processEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (vm)
|
|
||||||
virObjectUnlock(vm);
|
virObjectUnlock(vm);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user