From bcd4dfd6852361361d6622de7e67f94e2b475d27 Mon Sep 17 00:00:00 2001 From: Mao Zhongyi Date: Mon, 4 Sep 2017 22:35:39 +0800 Subject: net/net: Convert parse_host_port() to Error Cc: berrange@redhat.com Cc: kraxel@redhat.com Cc: pbonzini@redhat.com Cc: jasowang@redhat.com Cc: armbru@redhat.com Cc: eblake@redhat.com Signed-off-by: Mao Zhongyi Reviewed-by: Markus Armbruster Signed-off-by: Jason Wang --- include/qemu/sockets.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/qemu/sockets.h b/include/qemu/sockets.h index 639cc07..4f7311b 100644 --- a/include/qemu/sockets.h +++ b/include/qemu/sockets.h @@ -45,7 +45,8 @@ void socket_listen_cleanup(int fd, Error **errp); int socket_dgram(SocketAddress *remote, SocketAddress *local, Error **errp); /* Old, ipv4 only bits. Don't use for new code. */ -int parse_host_port(struct sockaddr_in *saddr, const char *str); +int parse_host_port(struct sockaddr_in *saddr, const char *str, + Error **errp); int socket_init(void); /** -- cgit v1.1 From 329163cbe64a615b4edf6c40f2fff8c79dbc8fb4 Mon Sep 17 00:00:00 2001 From: Wang Yong Date: Tue, 29 Aug 2017 15:22:37 +0800 Subject: qemu-iothread: IOThread supports the GMainContext event loop IOThread uses AioContext event loop and does not run a GMainContext. Therefore,chardev cannot work in IOThread,such as the chardev is used for colo-compare packets reception. This patch makes the IOThread run the GMainContext event loop, chardev and IOThread can work together. Reviewed-by: Fam Zheng Signed-off-by: Wang Yong Signed-off-by: Wang Guang Signed-off-by: Jason Wang --- include/sysemu/iothread.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/sysemu/iothread.h b/include/sysemu/iothread.h index e6da1a4..d2985b3 100644 --- a/include/sysemu/iothread.h +++ b/include/sysemu/iothread.h @@ -24,6 +24,9 @@ typedef struct { QemuThread thread; AioContext *ctx; + GMainContext *worker_context; + GMainLoop *main_loop; + GOnce once; QemuMutex init_done_lock; QemuCond init_done_cond; /* is thread initialization done? */ bool stopping; @@ -41,5 +44,6 @@ typedef struct { char *iothread_get_id(IOThread *iothread); AioContext *iothread_get_aio_context(IOThread *iothread); void iothread_stop_all(void); +GMainContext *iothread_get_g_main_context(IOThread *iothread); #endif /* IOTHREAD_H */ -- cgit v1.1