* [Qemu-devel] [PATCH] iothread: check iothread->ctx before aio_context_unref to avoid assertion
@ 2016-09-26 5:29 Lin Ma
2016-09-26 7:06 ` Paolo Bonzini
2016-09-26 14:25 ` Stefan Hajnoczi
0 siblings, 2 replies; 3+ messages in thread
From: Lin Ma @ 2016-09-26 5:29 UTC (permalink / raw)
To: qemu-devel; +Cc: famz, pbonzini, stefanha
if iothread->ctx is set to NULL, aio_context_unref triggers the assertion:
g_source_unref: assertion 'source != NULL' failed.
The patch fixes it.
Signed-off-by: Lin Ma <lma@suse.com>
---
iothread.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/iothread.c b/iothread.c
index fb08a60..fbeb8de 100644
--- a/iothread.c
+++ b/iothread.c
@@ -75,6 +75,9 @@ static void iothread_instance_finalize(Object *obj)
iothread_stop(obj, NULL);
qemu_cond_destroy(&iothread->init_done_cond);
qemu_mutex_destroy(&iothread->init_done_lock);
+ if (!iothread->ctx) {
+ return;
+ }
aio_context_unref(iothread->ctx);
}
--
2.9.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] iothread: check iothread->ctx before aio_context_unref to avoid assertion
2016-09-26 5:29 [Qemu-devel] [PATCH] iothread: check iothread->ctx before aio_context_unref to avoid assertion Lin Ma
@ 2016-09-26 7:06 ` Paolo Bonzini
2016-09-26 14:25 ` Stefan Hajnoczi
1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2016-09-26 7:06 UTC (permalink / raw)
To: Lin Ma, qemu-devel; +Cc: famz, stefanha
On 26/09/2016 07:29, Lin Ma wrote:
> if iothread->ctx is set to NULL, aio_context_unref triggers the assertion:
> g_source_unref: assertion 'source != NULL' failed.
> The patch fixes it.
>
> Signed-off-by: Lin Ma <lma@suse.com>
> ---
> iothread.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/iothread.c b/iothread.c
> index fb08a60..fbeb8de 100644
> --- a/iothread.c
> +++ b/iothread.c
> @@ -75,6 +75,9 @@ static void iothread_instance_finalize(Object *obj)
> iothread_stop(obj, NULL);
> qemu_cond_destroy(&iothread->init_done_cond);
> qemu_mutex_destroy(&iothread->init_done_lock);
> + if (!iothread->ctx) {
> + return;
> + }
> aio_context_unref(iothread->ctx);
> }
>
>
This only happens if there is an error, but it's theoretically possible.
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] iothread: check iothread->ctx before aio_context_unref to avoid assertion
2016-09-26 5:29 [Qemu-devel] [PATCH] iothread: check iothread->ctx before aio_context_unref to avoid assertion Lin Ma
2016-09-26 7:06 ` Paolo Bonzini
@ 2016-09-26 14:25 ` Stefan Hajnoczi
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2016-09-26 14:25 UTC (permalink / raw)
To: Lin Ma; +Cc: qemu-devel, famz, pbonzini
[-- Attachment #1: Type: text/plain, Size: 417 bytes --]
On Mon, Sep 26, 2016 at 01:29:58PM +0800, Lin Ma wrote:
> if iothread->ctx is set to NULL, aio_context_unref triggers the assertion:
> g_source_unref: assertion 'source != NULL' failed.
> The patch fixes it.
>
> Signed-off-by: Lin Ma <lma@suse.com>
> ---
> iothread.c | 3 +++
> 1 file changed, 3 insertions(+)
Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-09-26 14:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-26 5:29 [Qemu-devel] [PATCH] iothread: check iothread->ctx before aio_context_unref to avoid assertion Lin Ma
2016-09-26 7:06 ` Paolo Bonzini
2016-09-26 14:25 ` Stefan Hajnoczi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.