mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
iothread: add iothread_by_id() API
Encapsulate IOThread QOM object lookup so that callers don't need to know how and where IOThread objects live. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 20171206144550.22295-8-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
5016f21b70
commit
fbcc6923b0
2 changed files with 8 additions and 0 deletions
|
@ -380,3 +380,10 @@ void iothread_destroy(IOThread *iothread)
|
|||
{
|
||||
object_unparent(OBJECT(iothread));
|
||||
}
|
||||
|
||||
/* Lookup IOThread by its id. Only finds user-created objects, not internal
|
||||
* iothread_create() objects. */
|
||||
IOThread *iothread_by_id(const char *id)
|
||||
{
|
||||
return IOTHREAD(object_resolve_path_type(id, TYPE_IOTHREAD, NULL));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue