[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 03/13] char: chardevice hotswap
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v5 03/13] char: chardevice hotswap |
Date: |
Wed, 5 Jul 2017 17:09:47 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 |
On 05/07/2017 16:01, Anton Nefedov wrote:
> This patch adds a possibility to change a char device without a frontend
> removal.
>
> 1. 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.
>
> 2. Write path can be used by multiple threads and thus protected with
> chr_write_lock.
> So hotswap also has to be protected so write functions won't access
> a backend being replaced.
Does this matter in practice? CharBackend thread safety can be left to
the front-end.
Paolo
- [Qemu-devel] [PATCH v5 00/13] chardevice hotswap, Anton Nefedov, 2017/07/05
- [Qemu-devel] [PATCH v5 05/13] char: avoid chardevice direct access, Anton Nefedov, 2017/07/05
- [Qemu-devel] [PATCH v5 01/13] char: move QemuOpts->ChardevBackend translation to a separate func, Anton Nefedov, 2017/07/05
- [Qemu-devel] [PATCH v5 04/13] char: forbid direct chardevice access for hotswap devices, Anton Nefedov, 2017/07/05
- [Qemu-devel] [PATCH v5 07/13] test-char: split char_udp_test, Anton Nefedov, 2017/07/05
- [Qemu-devel] [PATCH v5 02/13] char: add backend hotswap handler, Anton Nefedov, 2017/07/05
- [Qemu-devel] [PATCH v5 09/13] test-char: add hotswap test, Anton Nefedov, 2017/07/05
- [Qemu-devel] [PATCH v5 06/13] test-char: destroy chardev-udp after test, Anton Nefedov, 2017/07/05
- [Qemu-devel] [PATCH v5 08/13] test-char: split char_file_test, Anton Nefedov, 2017/07/05