[Qemu-devel] [PATCH 1/3] chardev: use backend chr context when watch for fe

Peter Xu posted 3 patches 7 years, 10 months ago
There is a newer version of this series
[Qemu-devel] [PATCH 1/3] chardev: use backend chr context when watch for fe
Posted by Peter Xu 7 years, 10 months ago
In commit 6bbb6c0644 ("chardev: use per-dev context for
io_add_watch_poll", 2017-09-22) all the chardev watches are converted to
use per-chardev gcontext to support chardev to be run outside default
main thread.  However that's still missing one call from the frontend
code.  Touch that up.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
---
 chardev/char-fe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/chardev/char-fe.c b/chardev/char-fe.c
index ee6d596100..c611b3fa3e 100644
--- a/chardev/char-fe.c
+++ b/chardev/char-fe.c
@@ -356,7 +356,7 @@ guint qemu_chr_fe_add_watch(CharBackend *be, GIOCondition cond,
     }
 
     g_source_set_callback(src, (GSourceFunc)func, user_data, NULL);
-    tag = g_source_attach(src, NULL);
+    tag = g_source_attach(src, s->gcontext);
     g_source_unref(src);
 
     return tag;
-- 
2.14.3


Re: [Qemu-devel] [PATCH 1/3] chardev: use backend chr context when watch for fe
Posted by Marc-André Lureau 7 years, 9 months ago
On Thu, Dec 28, 2017 at 8:29 AM, Peter Xu <peterx@redhat.com> wrote:
> In commit 6bbb6c0644 ("chardev: use per-dev context for
> io_add_watch_poll", 2017-09-22) all the chardev watches are converted to
> use per-chardev gcontext to support chardev to be run outside default
> main thread.  However that's still missing one call from the frontend
> code.  Touch that up.
>
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> Signed-off-by: Peter Xu <peterx@redhat.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


> ---
>  chardev/char-fe.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/chardev/char-fe.c b/chardev/char-fe.c
> index ee6d596100..c611b3fa3e 100644
> --- a/chardev/char-fe.c
> +++ b/chardev/char-fe.c
> @@ -356,7 +356,7 @@ guint qemu_chr_fe_add_watch(CharBackend *be, GIOCondition cond,
>      }
>
>      g_source_set_callback(src, (GSourceFunc)func, user_data, NULL);
> -    tag = g_source_attach(src, NULL);
> +    tag = g_source_attach(src, s->gcontext);
>      g_source_unref(src);
>
>      return tag;
> --
> 2.14.3
>
>



-- 
Marc-André Lureau