981b06e7 | 18-Oct-2018 |
Julia Suvorova <jusual@mail.ru> |
chardev: Add websocket support
New option "websocket" added to allow using WebSocket protocol for chardev socket backend. Example: -chardev socket,websocket,server,id=...
Signed-off-by: Julia S
chardev: Add websocket support
New option "websocket" added to allow using WebSocket protocol for chardev socket backend. Example: -chardev socket,websocket,server,id=...
Signed-off-by: Julia Suvorova <jusual@mail.ru> Message-Id: <20181018223501.21683-3-jusual@mail.ru> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
show more ...
|
4493b6a5 | 18-Oct-2018 |
Julia Suvorova <jusual@mail.ru> |
chardev/char-socket: Function headers refactoring
Upcoming websocket support requires additional parameters in function headers that are already overloaded. This patch replaces the bunch of paramete
chardev/char-socket: Function headers refactoring
Upcoming websocket support requires additional parameters in function headers that are already overloaded. This patch replaces the bunch of parameters with a single structure pointer.
Signed-off-by: Julia Suvorova <jusual@mail.ru> Message-Id: <20181018223501.21683-2-jusual@mail.ru> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
4591bd46 | 17-Jul-2018 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
char-socket: make 'fd' incompatible with 'reconnect'
A chardev socket created with the 'fd=' argument is not going to handle reconnection properly by recycling the same fd (or not in a supported way
char-socket: make 'fd' incompatible with 'reconnect'
A chardev socket created with the 'fd=' argument is not going to handle reconnection properly by recycling the same fd (or not in a supported way). Let's forbid this case.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
a7077b8e | 27-Aug-2018 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
chardev: use a child source for qio input source
GLib child source were added with version 2.28. We can use them now that we bumped our requirement to 2.40.
Signed-off-by: Marc-André Lureau <marcan
chardev: use a child source for qio input source
GLib child source were added with version 2.28. We can use them now that we bumped our requirement to 2.40.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
95e30b2a | 22-Aug-2018 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
chardev: mark the calls that allow an implicit mux monitor
This is mostly for readability of the code. Let's make it clear which callers can create an implicit monitor when the chardev is muxed.
Th
chardev: mark the calls that allow an implicit mux monitor
This is mostly for readability of the code. Let's make it clear which callers can create an implicit monitor when the chardev is muxed.
This will also enforce a safer behaviour, as we don't really support creating monitor anywhere/anytime at the moment. Add an assert() to make sure the programmer explicitely wanted that behaviour.
There are documented cases, such as: -serial/-parallel/-virtioconsole and to less extent -debugcon.
Less obvious and questionable ones are -gdb, SLIRP -guestfwd and Xen console. Add a FIXME note for those, but keep the support for now.
Other qemu_chr_new() callers either have a fixed parameter/filename string or do not need it, such as -qtest:
* qtest.c: qtest_init() Afaik, only used by tests/libqtest.c, without mux. I don't think we support it outside of qemu testing: drop support for implicit mux monitor (qemu_chr_new() call: no implicit mux now).
* hw/ All with literal @filename argument that doesn't enable mux monitor.
* tests/ All with @filename argument that doesn't enable mux monitor.
On a related note, the list of monitor creation places:
- the chardev creators listed above: all from command line (except perhaps Xen console?)
- -gdb & hmp gdbserver will create a "GDB monitor command" chardev that is wired to an HMP monitor.
- -mon command line option
From this short study, I would like to think that a monitor may only be created in the main thread today, though I remain skeptical :)
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
425d8a4e | 11-Jul-2018 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
chardev: unref if underlying chardev has no parent
It's possible to write code creating a chardev backend that is not registered. When it is not user-created, it makes sense to keep it hidden. Let t
chardev: unref if underlying chardev has no parent
It's possible to write code creating a chardev backend that is not registered. When it is not user-created, it makes sense to keep it hidden. Let the associated frontend destroy it also in this case.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
43182856 | 14-Jun-2018 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
chardev: remove qemu_chr_fe_read_all() counter
There is no obvious reason to have a loop counter. This limits from reading several megabytes large buffers in one go, since socket read/write usually
chardev: remove qemu_chr_fe_read_all() counter
There is no obvious reason to have a loop counter. This limits from reading several megabytes large buffers in one go, since socket read/write usually have a limit.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
90a6d17b | 04-Jul-2017 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
chardev: avoid crash if no associated address
A socket chardev may not have associated address (when adding client fd manually for example). But on disconnect, updating socket filename expects an ad
chardev: avoid crash if no associated address
A socket chardev may not have associated address (when adding client fd manually for example). But on disconnect, updating socket filename expects an address and may lead to this crash:
Thread 1 "qemu-system-x86" received signal SIGSEGV, Segmentation fault. 0x0000555555d8c70c in SocketAddress_to_str (prefix=0x555556043062 "disconnected:", addr=0x0, is_listen=false, is_telnet=false) at /home/elmarco/src/qq/chardev/char-socket.c:388 388 switch (addr->type) { (gdb) bt #0 0x0000555555d8c70c in SocketAddress_to_str (prefix=0x555556043062 "disconnected:", addr=0x0, is_listen=false, is_telnet=false) at /home/elmarco/src/qq/chardev/char-socket.c:388 #1 0x0000555555d8c8aa in update_disconnected_filename (s=0x555556b1ed00) at /home/elmarco/src/qq/chardev/char-socket.c:419 #2 0x0000555555d8c959 in tcp_chr_disconnect (chr=0x555556b1ed00) at /home/elmarco/src/qq/chardev/char-socket.c:438 #3 0x0000555555d8cba1 in tcp_chr_hup (channel=0x555556b75690, cond=G_IO_HUP, opaque=0x555556b1ed00) at /home/elmarco/src/qq/chardev/char-socket.c:482 #4 0x0000555555da596e in qio_channel_fd_source_dispatch (source=0x555556bb68b0, callback=0x555555d8cb58 <tcp_chr_hup>, user_data=0x555556b1ed00) at /home/elmarco/src/qq/io/channel-watch.c:84
Replace filename with a generic "disconnected:socket" in this case.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
27e18b89 | 22-Aug-2018 |
Paolo Bonzini <pbonzini@redhat.com> |
char-pty: remove unnecessary #ifdef
For some reason __APPLE__ was not checked in pty code. However, the #ifdef is redundant: this file is already compiled only if CONFIG_POSIX, same as util/qemu-op
char-pty: remove unnecessary #ifdef
For some reason __APPLE__ was not checked in pty code. However, the #ifdef is redundant: this file is already compiled only if CONFIG_POSIX, same as util/qemu-openpty.c which it uses.
Reported-by: Roman Bolshakov <r.bolshakov@yadro.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
dfe9ea20 | 17-Aug-2018 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
char-socket: update all ioc handlers when changing context
So far, tcp_chr_update_read_handler() only updated the read handler. Let's also update the hup handler.
Factorize the code while at it. (n
char-socket: update all ioc handlers when changing context
So far, tcp_chr_update_read_handler() only updated the read handler. Let's also update the hup handler.
Factorize the code while at it. (note that s->ioc != NULL when s->connected)
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20180817135224.22971-4-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
5573f98f | 17-Aug-2018 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
Revert "chardev: tcp: postpone async connection setup"
This reverts commit 25679e5d58e258e9950685ffbd0cae4cd40d9cc2.
This commit broke "reconnect socket" chardev that are created after "machine_don
Revert "chardev: tcp: postpone async connection setup"
This reverts commit 25679e5d58e258e9950685ffbd0cae4cd40d9cc2.
This commit broke "reconnect socket" chardev that are created after "machine_done": they no longer try to connect. It broke also vhost-user-test that uses chardev while there is no "machine_done" event.
The goal of this patch was to move the "connect" source to the frontend context. chr->gcontext is set with qemu_chr_fe_set_handlers(). But there is no guarantee that it will be called, so we can't delay connection until then: the chardev should still attempt to connect during open(). qemu_chr_fe_set_handlers() is eventually called later and will update the context.
Unless there is a good reason to not use initially the default context, I think we should revert to the previous state to fix the regressions.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20180817135224.22971-3-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
6f660996 | 17-Apr-2018 |
Peter Maydell <peter.maydell@linaro.org> |
Revert "mux: fix ctrl-a b again"
This reverts commit 1b2503fcf7b5932c5a3779ca2ceb92bd403c4ee7.
Unfortunately this fix regresses console handling on MIPS Malta; since the mux ctrl-a b bug is not a r
Revert "mux: fix ctrl-a b again"
This reverts commit 1b2503fcf7b5932c5a3779ca2ceb92bd403c4ee7.
Unfortunately this fix regresses console handling on MIPS Malta; since the mux ctrl-a b bug is not a regression since 2.11, we take the conservative approach and just drop it from 2.12.
Reported-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
12051d82 | 23-Mar-2018 |
Peter Maydell <peter.maydell@linaro.org> |
chardev/char-fe: Allow NULL chardev in qemu_chr_fe_init()
All the functions in char-fe.c handle the CharBackend having a NULL Chardev pointer, which means that the backend exists but is not connecte
chardev/char-fe: Allow NULL chardev in qemu_chr_fe_init()
All the functions in char-fe.c handle the CharBackend having a NULL Chardev pointer, which means that the backend exists but is not connected to anything. The exception is qemu_chr_fe_init(), which will crash if passed a NULL Chardev pointer argument. This can happen for various boards if they're started with 'nodefaults': arm-softmmu/qemu-system-arm -S -nodefaults -M cubieboard riscv32-softmmu/qemu-system-riscv32 -nodefaults -M sifive_e
Make qemu_chr_fe_init() accept a NULL chardev. This allows UART models to handle NULL chardev properties without generally needing to special case them or to manually create a NullChardev.
Reported-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20180323152948.27048-1-peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|