[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 19/41] char: remove class kind field
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v2 19/41] char: remove class kind field |
Date: |
Tue, 31 Jan 2017 10:32:10 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 |
On 31/01/2017 04:08, Marc-André Lureau wrote:
> Hi
>
> On Tue, Jan 31, 2017 at 12:08 AM Paolo Bonzini <address@hidden
> <mailto:address@hidden>> wrote:
>
>
>
> On 30/01/2017 08:39, Marc-André Lureau wrote:
> > The class kind is necessary to lookup the chardev name in
> > qmp_chardev_add() after calling qemu_chr_new_from_opts() and to set
> > the appropriate ChardevBackend (mainly to free the right
> > fields).
> >
> > qemu_chr_new_from_opts() can be changed to use a non-qmp function
> > using the chardev class typename. Introduce qemu_chardev_add() to be
> > called from qemu_chr_new_from_opts() and remove the class chardev kind
> > field. Set the backend->type in the parse callback (when non-common
> > fields are added).
> >
> > Signed-off-by: Marc-André Lureau <address@hidden
> <mailto:address@hidden>>
> > ---
> > include/sysemu/char.h | 1 -
> > backends/baum.c | 1 -
> > backends/msmouse.c | 1 -
> > backends/testdev.c | 1 -
> > qemu-char.c | 99
> +++++++++++++++++++++++++--------------------------
> > spice-qemu-char.c | 4 +--
> > ui/console.c | 2 +-
> > ui/gtk.c | 1 -
> > 8 files changed, 51 insertions(+), 59 deletions(-)
>
> I am not sure about this patch. Why not remove backend->type
> altogether, and instead look at ChardevClass with object_dynamic_cast?
>
>
> For the reason I gave in the patch summary: qapi_free_ChardevBackend()
> dispatch based on ChardevBackendKind enum, not on Chardev object type.
Oops, I was confusing ChardevBackend and CharBackend!
Paolo
- [Qemu-devel] [PATCH v2 17/41] char: get rid of CharDriver, (continued)
[Qemu-devel] [PATCH v2 21/41] char: create chardev-obj-y, Marc-André Lureau, 2017/01/30
[Qemu-devel] [PATCH v2 22/41] char: make null_chr_write() the default method, Marc-André Lureau, 2017/01/30
[Qemu-devel] [PATCH v2 23/41] char: move null chardev to its own file, Marc-André Lureau, 2017/01/30
[Qemu-devel] [PATCH v2 25/41] char: move ringbuf/memory to its own file, Marc-André Lureau, 2017/01/30
[Qemu-devel] [PATCH v2 24/41] char: move mux to its own file, Marc-André Lureau, 2017/01/30
[Qemu-devel] [PATCH v2 26/41] char: rename and move to header CHR_READ_BUF_LEN, Marc-André Lureau, 2017/01/30
[Qemu-devel] [PATCH v2 27/41] char: remove unused READ_RETRIES, Marc-André Lureau, 2017/01/30