[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] iothread: Make iothread_stop() idempotent
From: |
Eduardo Habkost |
Subject: |
[Qemu-devel] [PATCH] iothread: Make iothread_stop() idempotent |
Date: |
Tue, 26 Sep 2017 10:00:28 -0300 |
Currently, iothread_stop_all() makes all iothread objects unsafe
to be destroyed, because qemu_thread_join() ends up being called
twice.
To fix this, make iothread_stop() idempotent by checking
thread->stopped.
Fixes the following crash:
qemu-system-x86_64 -object iothread,id=iothread0 -monitor stdio -display none
QEMU 2.10.50 monitor - type 'help' for more information
(qemu) quit
qemu: qemu_thread_join: No such process
Aborted (core dumped)
Reported-by: Christian Borntraeger <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>
---
iothread.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/iothread.c b/iothread.c
index 44c8944dc4..59d0850988 100644
--- a/iothread.c
+++ b/iothread.c
@@ -85,7 +85,7 @@ static int iothread_stop(Object *object, void *opaque)
IOThread *iothread;
iothread = (IOThread *)object_dynamic_cast(object, TYPE_IOTHREAD);
- if (!iothread || !iothread->ctx) {
+ if (!iothread || !iothread->ctx || iothread->stopping) {
return 0;
}
iothread->stopping = true;
--
2.13.5
- [Qemu-devel] [PULL 00/12] Machine/CPU/NUMA queue, 2017-09-19, Eduardo Habkost, 2017/09/19
- [Qemu-devel] [PULL 01/12] vl: Clean up user-creatable objects when exiting, Eduardo Habkost, 2017/09/19
- Re: [Qemu-devel] [PULL 01/12] vl: Clean up user-creatable objects when exiting, Christian Borntraeger, 2017/09/26
- Re: [Qemu-devel] [PULL 01/12] vl: Clean up user-creatable objects when exiting, Eduardo Habkost, 2017/09/26
- [Qemu-devel] [PATCH] iothread: Make iothread_stop() idempotent,
Eduardo Habkost <=
- Re: [Qemu-devel] [PATCH] iothread: Make iothread_stop() idempotent, Christian Borntraeger, 2017/09/26
- Re: [Qemu-devel] [PATCH] iothread: Make iothread_stop() idempotent, Christian Borntraeger, 2017/09/29
- Re: [Qemu-devel] [PATCH] iothread: Make iothread_stop() idempotent, Paolo Bonzini, 2017/09/29
- Re: [Qemu-devel] [PATCH] iothread: Make iothread_stop() idempotent, Peter Maydell, 2017/09/29
[Qemu-devel] [PULL 02/12] osdep: Define QEMU_MADV_REMOVE, Eduardo Habkost, 2017/09/19
[Qemu-devel] [PULL 03/12] hostmem-file: Add "discard-data" option, Eduardo Habkost, 2017/09/19
[Qemu-devel] [PULL 04/12] qom: cpus: split cpu_generic_init() on feature parsing and cpu creation parts, Eduardo Habkost, 2017/09/19
[Qemu-devel] [PULL 05/12] cpu: make cpu_generic_init() abort QEMU on error, Eduardo Habkost, 2017/09/19
[Qemu-devel] [PULL 06/12] vl.c: convert cpu_model to cpu type and set of global properties before machine_init(), Eduardo Habkost, 2017/09/19
[Qemu-devel] [PULL 07/12] pc: use generic cpu_model parsing, Eduardo Habkost, 2017/09/19