diff options
author | Yonghee Han <onstudy@samsung.com> | 2016-07-27 16:40:17 +0900 |
---|---|---|
committer | Yonghee Han <onstudy@samsung.com> | 2016-07-27 00:53:56 -0700 |
commit | 3158f4a51894e46ecb593bffbfd12824e1d6534a (patch) | |
tree | 2bef7f0238e687c5de65f48b5995ee124a95d157 /iothread.c | |
parent | a3b133b0ea0696e42fd876b9a803e28bc6ef5299 (diff) | |
download | qemu-upstream/2.4.1.tar.gz qemu-upstream/2.4.1.tar.bz2 qemu-upstream/2.4.1.zip |
Imported Upstream version 2.4.1upstream/2.4.1
Change-Id: I0b584f569cb0e0f4eac13cdb79e110c2dbc34bfc
Diffstat (limited to 'iothread.c')
-rw-r--r-- | iothread.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/iothread.c b/iothread.c index 342a23fcb..da6ce7b30 100644 --- a/iothread.c +++ b/iothread.c @@ -18,8 +18,7 @@ #include "sysemu/iothread.h" #include "qmp-commands.h" #include "qemu/error-report.h" - -#define IOTHREADS_PATH "/objects" +#include "qemu/rcu.h" typedef ObjectClass IOThreadClass; @@ -33,6 +32,8 @@ static void *iothread_run(void *opaque) IOThread *iothread = opaque; bool blocking; + rcu_register_thread(); + qemu_mutex_lock(&iothread->init_done_lock); iothread->thread_id = qemu_get_thread_id(); qemu_cond_signal(&iothread->init_done_cond); @@ -47,6 +48,8 @@ static void *iothread_run(void *opaque) } aio_context_release(iothread->ctx); } + + rcu_unregister_thread(); return NULL; } @@ -121,18 +124,6 @@ static void iothread_register_types(void) type_init(iothread_register_types) -IOThread *iothread_find(const char *id) -{ - Object *container = container_get(object_get_root(), IOTHREADS_PATH); - Object *child; - - child = object_property_get_link(container, id, NULL); - if (!child) { - return NULL; - } - return (IOThread *)object_dynamic_cast(child, TYPE_IOTHREAD); -} - char *iothread_get_id(IOThread *iothread) { return object_get_canonical_path_component(OBJECT(iothread)); @@ -172,7 +163,7 @@ IOThreadInfoList *qmp_query_iothreads(Error **errp) { IOThreadInfoList *head = NULL; IOThreadInfoList **prev = &head; - Object *container = container_get(object_get_root(), IOTHREADS_PATH); + Object *container = object_get_objects_root(); object_child_foreach(container, query_one_iothread, &prev); return head; |