aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2018-12-06 00:37:35 +0400
committerMarkus Armbruster <armbru@redhat.com>2018-12-12 09:55:57 +0100
commit269d25cdeb3acecf0033d6809dd7e23ebbc78ce9 (patch)
treeae8b8f804c878d02ceef6f6e941b40524c4d7885 /net
parenta9a0d9b99a347b1413728992726f2bacf76d48ce (diff)
downloadqemu-269d25cdeb3acecf0033d6809dd7e23ebbc78ce9.zip
qemu-269d25cdeb3acecf0033d6809dd7e23ebbc78ce9.tar.gz
qemu-269d25cdeb3acecf0033d6809dd7e23ebbc78ce9.tar.bz2
colo: check chardev can switch context
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 <marcandre.lureau@redhat.com> Message-Id: <20181205203737.9011-6-marcandre.lureau@redhat.com> Reviewed-by: Li Zhijian <lizhiian@cn.fujitsu.com> Reviewed-by: Zhang Chen <zhangckid@gmail.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'net')
-rw-r--r--net/colo-compare.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/colo-compare.c b/net/colo-compare.c
index a39191d..9156ab3 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;
}