]> git.proxmox.com Git - mirror_qemu.git/commit - chardev/char.c
char: chardevice hotswap
authorAnton Nefedov <anton.nefedov@virtuozzo.com>
Thu, 6 Jul 2017 12:08:50 +0000 (15:08 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 14 Jul 2017 09:04:33 +0000 (11:04 +0200)
commit7bb86085e61befc95551055e26645cb23c3f0b86
treed6727fbff8b5d996a0d1325ec04bfe14d17f3afa
parent81517ba37a6cec59f92396b4722861868eb0a500
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>
chardev/char.c
include/chardev/char.h
qapi-schema.json