mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
iothread: add I/O thread object
This is a stand-in for Michael Roth's QContext. I expect this to be replaced once QContext is completed. The IOThread object is an AioContext event loop thread. This patch adds the concept of multiple event loop threads, allowing users to define them. When SMP guests run on SMP hosts it makes sense to instantiate multiple IOThreads. This spreads event loop processing across multiple cores. Note that additional patches are required to actually bind a device to an IOThread. [Andreas Färber <afaerber@suse.de> pointed out that the embedded parent object instance should be called "parent_obj" and have a newline afterwards. This patch has been changed to reflect this. -- Stefan] Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
98563fc3ec
commit
be8d853766
3 changed files with 151 additions and 0 deletions
30
include/sysemu/iothread.h
Normal file
30
include/sysemu/iothread.h
Normal file
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* Event loop thread
|
||||
*
|
||||
* Copyright Red Hat Inc., 2013
|
||||
*
|
||||
* Authors:
|
||||
* Stefan Hajnoczi <stefanha@redhat.com>
|
||||
*
|
||||
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
||||
* See the COPYING file in the top-level directory.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef IOTHREAD_H
|
||||
#define IOTHREAD_H
|
||||
|
||||
#include "block/aio.h"
|
||||
|
||||
#define TYPE_IOTHREAD "iothread"
|
||||
|
||||
typedef struct IOThread IOThread;
|
||||
|
||||
#define IOTHREAD(obj) \
|
||||
OBJECT_CHECK(IOThread, obj, TYPE_IOTHREAD)
|
||||
|
||||
IOThread *iothread_find(const char *id);
|
||||
char *iothread_get_id(IOThread *iothread);
|
||||
AioContext *iothread_get_aio_context(IOThread *iothread);
|
||||
|
||||
#endif /* IOTHREAD_H */
|
Loading…
Add table
Add a link
Reference in a new issue