From 269d25cdeb3acecf0033d6809dd7e23ebbc78ce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Thu, 6 Dec 2018 00:37:35 +0400 Subject: [PATCH] colo: check chardev can switch context MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit COLO uses a worker context (iothread) to drive the chardev. All backends are not able to switch the context, let's report an error in this case. Signed-off-by: Marc-André Lureau Message-Id: <20181205203737.9011-6-marcandre.lureau@redhat.com> Reviewed-by: Li Zhijian Reviewed-by: Zhang Chen Signed-off-by: Markus Armbruster --- net/colo-compare.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/colo-compare.c b/net/colo-compare.c index a39191d522..9156ab3349 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -957,6 +957,12 @@ static int find_and_check_chardev(Chardev **chr, return 1; } + if (!qemu_chr_has_feature(*chr, QEMU_CHAR_FEATURE_GCONTEXT)) { + error_setg(errp, "chardev \"%s\" cannot switch context", + chr_name); + return 1; + } + return 0; }