qemu-nbd: remove unnecessary qemu_notify_event()
PATCH 1/1 qemu-nbd: remove unnecessary qemu_notify_event()
This was needed when qemu-nbd was using qemu_set_fd_handler2. It is not needed anymore now that nbd_update_server_fd_handler is called whenever nbd_can_accept() can change from false to true. nbd_update_server_fd_handler will call qemu_set_fd_handler(), which will call qemu_notify_event().
--- qemu-nbd.c | 1 - 1 file changed, 1 deletion(-)
qemu-nbd.c +0 -1
@@ -362,7 +362,6 @@ static void nbd_client_closed(NBDClient *client) state =TERMINATE ; }nbd_update_server_fd_handler (server_fd); -qemu_notify_event ();nbd_client_put (client); }
Signature · 1 line
2.4.3
Quoted 16 lines · Paolo Bonzini
This was needed when qemu-nbd was using
qemu_set_fd_handler2. It is not needed anymore now thatnbd_update_server_fd_handleris called whenevernbd_can_accept()can change from false to true.nbd_update_server_fd_handlerwill callqemu_set_fd_handler(), which will callqemu_notify_event().Signed-off-by Paolo Bonzini <[email protected]>--- qemu-nbd.c | 1 - 1 file changed, 1 deletion(-)qemu-nbd.c +0
-0
qemu-nbd.c static void nbd_client_closed(NBDClient *client) · line 366
Quoted 6 lines
qemu-nbd.c +0
-1@@ -362,7 +362,6 @@ static void nbd_client_closed(NBDClient *client) state =TERMINATE ; }nbd_update_server_fd_handler (server_fd); -qemu_notify_event ();nbd_client_put (client); }
Quoted 27 lines · Paolo Bonzini
This was needed when qemu-nbd was using
qemu_set_fd_handler2. It is not needed anymore now thatnbd_update_server_fd_handleris called whenevernbd_can_accept()can change from false to true.nbd_update_server_fd_handlerwill callqemu_set_fd_handler(), which will callqemu_notify_event().Signed-off-by Paolo Bonzini <[email protected]>--- qemu-nbd.c | 1 - 1 file changed, 1 deletion(-)qemu-nbd.c +0
-1@@ -362,7 +362,6 @@ static void nbd_client_closed(NBDClient *client) state =TERMINATE ; }nbd_update_server_fd_handler (server_fd); -qemu_notify_event ();nbd_client_put (client); }Signature · 1 line
2.4.3
A question not related to this patch: unlike aio_set_fd_handler, qemu_set_fd_handler doesn't call qemu_notify_event for the "delete" branch. Is that intended?
Quoted 31 lines · Fam Zheng
Quoted 27 lines · Paolo Bonzini
This was needed when qemu-nbd was using
qemu_set_fd_handler2. It is not needed anymore now thatnbd_update_server_fd_handleris called whenevernbd_can_accept()can change from false to true.nbd_update_server_fd_handlerwill callqemu_set_fd_handler(), which will callqemu_notify_event().Signed-off-by Paolo Bonzini <[email protected]>--- qemu-nbd.c | 1 - 1 file changed, 1 deletion(-)qemu-nbd.c +0
-1@@ -362,7 +362,6 @@ static void nbd_client_closed(NBDClient *client) state =TERMINATE ; }nbd_update_server_fd_handler (server_fd); -qemu_notify_event ();nbd_client_put (client); }Signature · 1 line
2.4.3Reviewed-by Fam Zheng <[email protected]>
Quoted 3 lines
A question not related to this patch: unlike
aio_set_fd_handler,qemu_set_fd_handlerdoesn't callqemu_notify_eventfor the "delete" branch. Is that intended?
Yes. In fact I think qemu_notify_event() is not needed at all in qemu_set_fd_handler() because there are no concurrent ppoll() calls during a qemu_set_fd_handler().
Paolo