chardev: Don't unregister yank upon async path connection failure
PATCH 1/1 chardev: Don't unregister yank upon async path connection failure
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.
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3528
--- chardev/char-socket.c | 5 ----- 1 file changed, 5 deletions(-)
chardev/char-socket.c +0 -5
@@ -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; }
Signature · 1 line
2.53.0
Quoted 22 lines · Fabiano Rosas
Commit
5c102ac9("chardev: Consolidate yank registration") has moved yank registration in thetcp_chr_connect_client_async()path to after the connection is successful. Ifqio_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.
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(-)chardev/char-socket.c +0
-0
chardev/char-socket.c static void qemu_chr_socket_connected(QIOTask *task, void *opaque) · line 1131
Quoted 4 lines
chardev/char-socket.c +0
-1@@ -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) {
Is "registered_yank" stalled too? shouldn't be set to false to avoid that path and possibly others?
Quoted 10 lines
chardev/char-socket.c +0
-5-yank_unregister_function (CHARDEV_YANK_INSTANCE (chr->label), - char_socket_yank_iochannel, -QIO_CHANNEL (sioc)); - }check_report_connect_error (chr, err); goto cleanup; } --2.53.0
Quoted 24 lines · Marc-André Lureau
Quoted 23 lines · Fabiano Rosas
Commit
5c102ac9("chardev: Consolidate yank registration") has moved yank registration in thetcp_chr_connect_client_async()path to after the connection is successful. Ifqio_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.
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(-)chardev/char-socket.c +0
-0@@ -1128,11 +1128,6 @@ static void qemu_chr_socket_connected(QIOTask *task, void *opaque)
Quoted 7 lines
chardev/char-socket.c static void qemu_chr_socket_connected(QIOTask *task, void *opaque) · line 1131
Quoted 3 lines
chardev/char-socket.c +0
-1if (qio_task_propagate_error (task, &err)) {tcp_chr_change_state (s,TCP_CHARDEV_STATE_DISCONNECTED ); -if (s->registered_yank) {Is "
registered_yank" stalled too? shouldn't be set to false to avoid that path and possibly others?
No because registered_yank is about the YankInstance. There's no actual tracking of the individual YankFns.
Quoted 10 lines
Quoted 10 lines
chardev/char-socket.c +0
-5-yank_unregister_function (CHARDEV_YANK_INSTANCE (chr->label), - char_socket_yank_iochannel, -QIO_CHANNEL (sioc)); - }check_report_connect_error (chr, err); goto cleanup; } --2.53.0
Quoted 22 lines · Fabiano Rosas
Commit
5c102ac9("chardev: Consolidate yank registration") has moved yank registration in thetcp_chr_connect_client_async()path to after the connection is successful. Ifqio_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.
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(-)chardev/char-socket.c +0
-0@@ -1128,11 +1128,6 @@ static void qemu_chr_socket_connected(QIOTask *task, void *opaque)
chardev/char-socket.c static void qemu_chr_socket_connected(QIOTask *task, void *opaque) · line 1133
Quoted 10 lines
chardev/char-socket.c +0
-5if (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
Quoted 7 lines · Fabiano Rosas
Commit
5c102ac9("chardev: Consolidate yank registration") has moved yank registration in thetcp_chr_connect_client_async()path to after the connection is successful. Ifqio_channel_socket_connect_sync()fails early, there will be no yank registered to be unregistered in the error path, leading to assert.
Quoted 6 lines
Remove the now-extraneous unregister.
Fixes 5c102ac9 ("chardev: Consolidate yank registration")Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3528
Signed-off-by Fabiano Rosas <[email protected]>
Quoted 24 lines
--- chardev/char-socket.c | 5 ----- 1 file changed, 5 deletions(-)chardev/char-socket.c +0
-6@@ -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; } --2.53.0