Re: [PATCH] chardev: Don't unregister yank upon async path connection failure

Fabiano Rosas <[email protected]>
Newsgroups gmane.comp.emulators.qemu,gmane.comp.emulators.qemu.stable
Message-ID <[email protected]>
Fabiano Rosas <[email protected]> writes:

> Commit 5c102ac9 ("chardev: Consolidate yank registration") has moved
> yank registration in the tcp_chr_connect_client_async() path to after
> the connection is successful. If qio_channel_socket_connect_sync()
> fails early, there will be no yank registered to be unregistered in
> the error path, leading to assert.
>
> Remove the now-extraneous unregister.
>
> Cc: [email protected]
> Fixes: 5c102ac9 ("chardev: Consolidate yank registration")
> Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3528
> Signed-off-by: Fabiano Rosas <[email protected]>
> ---
>  chardev/char-socket.c | 5 -----
>  1 file changed, 5 deletions(-)
>
> diff --git a/chardev/char-socket.c b/chardev/char-socket.c
> index e064b105c5..99e01a4875 100644
> --- a/chardev/char-socket.c
> +++ b/chardev/char-socket.c
> @@ -1128,11 +1128,6 @@ static void qemu_chr_socket_connected(QIOTask *task, void *opaque)
>  
>      if (qio_task_propagate_error(task, &err)) {
>          tcp_chr_change_state(s, TCP_CHARDEV_STATE_DISCONNECTED);
> -        if (s->registered_yank) {
> -            yank_unregister_function(CHARDEV_YANK_INSTANCE(chr->label),
> -                                     char_socket_yank_iochannel,
> -                                     QIO_CHANNEL(sioc));
> -        }
>          check_report_connect_error(chr, err);
>          goto cleanup;
>      }

ping
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.