summaryrefslogtreecommitdiffstats
path: root/include/chardev/char.h
diff options
context:
space:
mode:
authorAnton Nefedov2017-07-06 14:08:50 +0200
committerPaolo Bonzini2017-07-14 11:04:33 +0200
commit7bb86085e61befc95551055e26645cb23c3f0b86 (patch)
treed6727fbff8b5d996a0d1325ec04bfe14d17f3afa /include/chardev/char.h
parentchar: add backend hotswap handler (diff)
downloadqemu-7bb86085e61befc95551055e26645cb23c3f0b86.tar.gz
qemu-7bb86085e61befc95551055e26645cb23c3f0b86.tar.xz
qemu-7bb86085e61befc95551055e26645cb23c3f0b86.zip
char: chardevice hotswap
This patch adds a possibility to change a char device without a frontend removal. Ideally, it would have to happen transparently to a frontend, i.e. frontend would continue its regular operation. However, backends are not stateless and are set up by the frontends via qemu_chr_fe_<> functions, and it's not (generally) possible to replay that setup entirely in a backend code, as different chardevs respond to the setup calls differently, so do frontends work differently basing on those setup responses. Moreover, some frontend can generally get and save the backend pointer (qemu_chr_fe_get_driver()), and it will become invalid after backend change. So, a frontend which would like to support chardev hotswap has to register a "backend change" handler, and redo its backend setup there. Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <1499342940-56739-4-git-send-email-anton.nefedov@virtuozzo.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/chardev/char.h')
-rw-r--r--include/chardev/char.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/chardev/char.h b/include/chardev/char.h
index 8a9ade4931..22fd734999 100644
--- a/include/chardev/char.h
+++ b/include/chardev/char.h
@@ -93,6 +93,15 @@ void qemu_chr_parse_common(QemuOpts *opts, ChardevCommon *backend);
Chardev *qemu_chr_new(const char *label, const char *filename);
/**
+ * @qemu_chr_change:
+ *
+ * Change an existing character backend
+ *
+ * @opts the new backend options
+ */
+void qemu_chr_change(QemuOpts *opts, Error **errp);
+
+/**
* @qemu_chr_cleanup:
*
* Delete all chardevs (when leaving qemu)