66626503 | 11-Nov-2021 |
Roman Kagan <rvkagan@yandex-team.ru> |
chardev/char-socket: tcp_chr_sync_read: don't clobber errno
After the return from tcp_chr_recv, tcp_chr_sync_read calls into a function which eventually makes a system call and may clobber errno.
M
chardev/char-socket: tcp_chr_sync_read: don't clobber errno
After the return from tcp_chr_recv, tcp_chr_sync_read calls into a function which eventually makes a system call and may clobber errno.
Make a copy of errno right after tcp_chr_recv and restore the errno on return from tcp_chr_sync_read.
Signed-off-by: Roman Kagan <rvkagan@yandex-team.ru> Message-Id: <20211111153354.18807-4-rvkagan@yandex-team.ru> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
show more ...
|
5eed493d | 22-Jul-2021 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
chardev: remove needless class method
"chr_option_parsed" is only implemented by the "mux" chardev, we can specialize the code there to avoid the needless generic class method.
Signed-off-by: Marc-
chardev: remove needless class method
"chr_option_parsed" is only implemented by the "mux" chardev, we can specialize the code there to avoid the needless generic class method.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
a68403b0 | 04-Aug-2021 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
chardev: report a simpler error about duplicated id
Report: "Chardev with id 'char2' already exists" Rather than: "Failed to add chardev 'char2': duplicate yank instance"
Signed-off-by: Marc-An
chardev: report a simpler error about duplicated id
Report: "Chardev with id 'char2' already exists" Rather than: "Failed to add chardev 'char2': duplicate yank instance"
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
64195b0d | 28-Jul-2021 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
chardev: give some context on chardev-add error
Description from Daniel P. Berrangé: > The original code reported: > > "attempt to add duplicate property 'char2' to object (type 'container')" > > S
chardev: give some context on chardev-add error
Description from Daniel P. Berrangé: > The original code reported: > > "attempt to add duplicate property 'char2' to object (type 'container')" > > Since adding yank support, the current code reports > > "duplicate yank instance" > > With this patch applied it now reports: > > "Failed to add chardev 'char2': duplicate yank instance" > > This is marginally better, but still not great, not that the original > error was great either. > > It would be nice if we could report > > "chardev with id 'char2' already exists"
Related to: https://bugzilla.redhat.com/show_bug.cgi?id=1984721
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
733ba020 | 23-Jul-2021 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
chardev: fix qemu_chr_open_fd() with fd_in==fd_out
The "serial" chardev calls qemu_chr_open_fd() with the same fd. This may lead to double-close as each QIOChannel owns the fd.
Instead, share the r
chardev: fix qemu_chr_open_fd() with fd_in==fd_out
The "serial" chardev calls qemu_chr_open_fd() with the same fd. This may lead to double-close as each QIOChannel owns the fd.
Instead, share the reference to the same QIOChannel.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
46fe3ff6 | 23-Jul-2021 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
chardev: fix qemu_chr_open_fd() being called with fd=-1
The "file" chardev may call qemu_chr_open_fd() with fd_in=-1. This may cause invalid system calls, as the QIOChannel is assumed to be properly
chardev: fix qemu_chr_open_fd() being called with fd=-1
The "file" chardev may call qemu_chr_open_fd() with fd_in=-1. This may cause invalid system calls, as the QIOChannel is assumed to be properly initialized later on.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
bb2b058f | 04-Aug-2021 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
chardev: fix fd_chr_add_watch() when in != out
Create child sources for the different streams, and dispatch on the parent source with the synthesized conditions.
Signed-off-by: Marc-André Lureau <m
chardev: fix fd_chr_add_watch() when in != out
Create child sources for the different streams, and dispatch on the parent source with the synthesized conditions.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
bf7b1eab | 04-Aug-2021 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
chardev: mark explicitly first argument as poisoned
Since commit 9894dc0cdcc397ee5b26370bc53da6d360a363c2 "char: convert from GIOChannel to QIOChannel", the first argument to the watch callback can
chardev: mark explicitly first argument as poisoned
Since commit 9894dc0cdcc397ee5b26370bc53da6d360a363c2 "char: convert from GIOChannel to QIOChannel", the first argument to the watch callback can actually be a QIOChannel, which is not a GIOChannel (but a QEMU Object).
Even though we never used that pointer, change the callback type to warn the users. Possibly a better fix later, we may want to store the callback and call it from intermediary functions.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
f0349f4d | 19-May-2021 |
Gerd Hoffmann <kraxel@redhat.com> |
ui/vdagent: add clipboard support
This patch adds support for clipboard messages to the qemu vdagent implementation, which allows the guest exchange clipboard data with qemu. Clipboard support can
ui/vdagent: add clipboard support
This patch adds support for clipboard messages to the qemu vdagent implementation, which allows the guest exchange clipboard data with qemu. Clipboard support can be enabled/disabled using the new 'clipboard' parameter for the vdagent chardev. Default is off.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 20210519053940.1888907-1-kraxel@redhat.com Message-Id: <20210519053940.1888907-7-kraxel@redhat.com>
show more ...
|
feb774ca | 30-Mar-2021 |
Lukas Straub <lukasstraub2@web.de> |
chardev: Fix yank with the chardev-change case
When changing from chardev-socket (which supports yank) to chardev-socket again, it fails, because the new chardev attempts to register a new yank inst
chardev: Fix yank with the chardev-change case
When changing from chardev-socket (which supports yank) to chardev-socket again, it fails, because the new chardev attempts to register a new yank instance. This in turn fails, as there still is the yank instance from the current chardev. Also, the old chardev shouldn't unregister the yank instance when it is freed.
To fix this, now the new chardev only registers a yank instance if the current chardev doesn't support yank and thus hasn't registered one already. Also, when the old chardev is freed, it now only unregisters the yank instance if the new chardev doesn't need it.
If the initialization of the new chardev fails, it still has chr->handover_yank_instance set and won't unregister the yank instance when it is freed.
s->registered_yank is always true here, as chardev-change only works on user-visible chardevs and those are guraranteed to register a yank instance as they are initialized via chardev_new() qemu_char_open() cc->open() (qmp_chardev_open_socket()).
Signed-off-by: Lukas Straub <lukasstraub2@web.de> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Tested-by: Li Zhang <li.zhang@cloud.ionos.com> Message-Id: <9637888d7591d2971975188478bb707299a1dc04.1617127849.git.lukasstraub2@web.de>
show more ...
|