* [Qemu-devel] [PULL 0/2] Block patches @ 2018-10-12 1:50 Fam Zheng 2018-10-12 1:50 ` [Qemu-devel] [PULL 1/2] iothread: fix crash with invalid properties Fam Zheng ` (2 more replies) 0 siblings, 3 replies; 4+ messages in thread From: Fam Zheng @ 2018-10-12 1:50 UTC (permalink / raw) To: qemu-devel; +Cc: Peter Maydell The following changes since commit 75e50c80e051423a6f55a34ee4a1eec842444a5b: Merge remote-tracking branch 'remotes/armbru/tags/pull-misc-2018-10-10' into staging (2018-10-11 10:43:37 +0100) are available in the Git repository at: git://github.com/famz/qemu.git tags/block-pull-request for you to fetch changes up to 6388147296cd4c841a7d4409ba622c200332a8c7: nvme: correct locking around completion (2018-10-12 09:46:14 +0800) ---------------------------------------------------------------- Block patches One fix from Marc-André for iothread. One fix from Paolo on nvme:// driver. ---------------------------------------------------------------- Marc-André Lureau (1): iothread: fix crash with invalid properties Paolo Bonzini (1): nvme: correct locking around completion block/nvme.c | 2 -- iothread.c | 9 ++++++--- 2 files changed, 6 insertions(+), 5 deletions(-) -- 2.17.1 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] [PULL 1/2] iothread: fix crash with invalid properties 2018-10-12 1:50 [Qemu-devel] [PULL 0/2] Block patches Fam Zheng @ 2018-10-12 1:50 ` Fam Zheng 2018-10-12 1:50 ` [Qemu-devel] [PULL 2/2] nvme: correct locking around completion Fam Zheng 2018-10-12 11:39 ` [Qemu-devel] [PULL 0/2] Block patches Peter Maydell 2 siblings, 0 replies; 4+ messages in thread From: Fam Zheng @ 2018-10-12 1:50 UTC (permalink / raw) To: qemu-devel; +Cc: Peter Maydell From: Marc-André Lureau <marcandre.lureau@redhat.com> -object iothread,id=foo,? will crash qemu: qemu-system-x86_64:qemu-thread-posix.c:128: qemu_cond_destroy: Assertion `cond->initialized' failed. Use thread_id != -1 to check if iothread_complete() finished successfully and the mutex/cond have been initialized. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20180821100716.13803-1-marcandre.lureau@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com> --- iothread.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/iothread.c b/iothread.c index aff1281257..2fb1cdf55d 100644 --- a/iothread.c +++ b/iothread.c @@ -110,6 +110,7 @@ static void iothread_instance_init(Object *obj) IOThread *iothread = IOTHREAD(obj); iothread->poll_max_ns = IOTHREAD_POLL_MAX_NS_DEFAULT; + iothread->thread_id = -1; } static void iothread_instance_finalize(Object *obj) @@ -117,6 +118,11 @@ static void iothread_instance_finalize(Object *obj) IOThread *iothread = IOTHREAD(obj); iothread_stop(iothread); + + if (iothread->thread_id != -1) { + qemu_cond_destroy(&iothread->init_done_cond); + qemu_mutex_destroy(&iothread->init_done_lock); + } /* * Before glib2 2.33.10, there is a glib2 bug that GSource context * pointer may not be cleared even if the context has already been @@ -135,8 +141,6 @@ static void iothread_instance_finalize(Object *obj) g_main_context_unref(iothread->worker_context); iothread->worker_context = NULL; } - qemu_cond_destroy(&iothread->init_done_cond); - qemu_mutex_destroy(&iothread->init_done_lock); } static void iothread_complete(UserCreatable *obj, Error **errp) @@ -147,7 +151,6 @@ static void iothread_complete(UserCreatable *obj, Error **errp) iothread->stopping = false; iothread->running = true; - iothread->thread_id = -1; iothread->ctx = aio_context_new(&local_error); if (!iothread->ctx) { error_propagate(errp, local_error); -- 2.17.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Qemu-devel] [PULL 2/2] nvme: correct locking around completion 2018-10-12 1:50 [Qemu-devel] [PULL 0/2] Block patches Fam Zheng 2018-10-12 1:50 ` [Qemu-devel] [PULL 1/2] iothread: fix crash with invalid properties Fam Zheng @ 2018-10-12 1:50 ` Fam Zheng 2018-10-12 11:39 ` [Qemu-devel] [PULL 0/2] Block patches Peter Maydell 2 siblings, 0 replies; 4+ messages in thread From: Fam Zheng @ 2018-10-12 1:50 UTC (permalink / raw) To: qemu-devel; +Cc: Peter Maydell From: Paolo Bonzini <pbonzini@redhat.com> nvme_poll_queues is already protected by q->lock, and AIO callbacks are invoked outside the AioContext lock. So remove the acquire/release pair in nvme_handle_event. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20180814062739.19640-1-pbonzini@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com> --- block/nvme.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/block/nvme.c b/block/nvme.c index 781d77d6d2..29294038fc 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -489,10 +489,8 @@ static void nvme_handle_event(EventNotifier *n) BDRVNVMeState *s = container_of(n, BDRVNVMeState, irq_notifier); trace_nvme_handle_event(s); - aio_context_acquire(s->aio_context); event_notifier_test_and_clear(n); nvme_poll_queues(s); - aio_context_release(s->aio_context); } static bool nvme_add_io_queue(BlockDriverState *bs, Error **errp) -- 2.17.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PULL 0/2] Block patches 2018-10-12 1:50 [Qemu-devel] [PULL 0/2] Block patches Fam Zheng 2018-10-12 1:50 ` [Qemu-devel] [PULL 1/2] iothread: fix crash with invalid properties Fam Zheng 2018-10-12 1:50 ` [Qemu-devel] [PULL 2/2] nvme: correct locking around completion Fam Zheng @ 2018-10-12 11:39 ` Peter Maydell 2 siblings, 0 replies; 4+ messages in thread From: Peter Maydell @ 2018-10-12 11:39 UTC (permalink / raw) To: Fam Zheng; +Cc: QEMU Developers On 12 October 2018 at 02:50, Fam Zheng <famz@redhat.com> wrote: > The following changes since commit 75e50c80e051423a6f55a34ee4a1eec842444a5b: > > Merge remote-tracking branch 'remotes/armbru/tags/pull-misc-2018-10-10' into staging (2018-10-11 10:43:37 +0100) > > are available in the Git repository at: > > git://github.com/famz/qemu.git tags/block-pull-request > > for you to fetch changes up to 6388147296cd4c841a7d4409ba622c200332a8c7: > > nvme: correct locking around completion (2018-10-12 09:46:14 +0800) > > ---------------------------------------------------------------- > Block patches > > One fix from Marc-André for iothread. > One fix from Paolo on nvme:// driver. > > ---------------------------------------------------------------- > > Marc-André Lureau (1): > iothread: fix crash with invalid properties > > Paolo Bonzini (1): > nvme: correct locking around completion > > block/nvme.c | 2 -- > iothread.c | 9 ++++++--- > 2 files changed, 6 insertions(+), 5 deletions(-) Applied, thanks. -- PMM ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-10-12 11:40 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2018-10-12 1:50 [Qemu-devel] [PULL 0/2] Block patches Fam Zheng 2018-10-12 1:50 ` [Qemu-devel] [PULL 1/2] iothread: fix crash with invalid properties Fam Zheng 2018-10-12 1:50 ` [Qemu-devel] [PULL 2/2] nvme: correct locking around completion Fam Zheng 2018-10-12 11:39 ` [Qemu-devel] [PULL 0/2] Block patches Peter Maydell
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.