ssh.c (f0d35765998bb527013b7f06521fa4b3de352f58) | ssh.c (f2e5dca46b5ba4588c0756c5f272123585cbbf23) |
---|---|
1/* 2 * Secure Shell (ssh) backend for QEMU. 3 * 4 * Copyright (C) 2013 Red Hat Inc., Richard W.M. Jones <rjones@redhat.com> 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights --- 744 unchanged lines hidden (view full) --- 753 } 754 if (r & LIBSSH2_SESSION_BLOCK_OUTBOUND) { 755 wr_handler = restart_coroutine; 756 } 757 758 DPRINTF("s->sock=%d rd_handler=%p wr_handler=%p", s->sock, 759 rd_handler, wr_handler); 760 | 1/* 2 * Secure Shell (ssh) backend for QEMU. 3 * 4 * Copyright (C) 2013 Red Hat Inc., Richard W.M. Jones <rjones@redhat.com> 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights --- 744 unchanged lines hidden (view full) --- 753 } 754 if (r & LIBSSH2_SESSION_BLOCK_OUTBOUND) { 755 wr_handler = restart_coroutine; 756 } 757 758 DPRINTF("s->sock=%d rd_handler=%p wr_handler=%p", s->sock, 759 rd_handler, wr_handler); 760 |
761 qemu_aio_set_fd_handler(s->sock, rd_handler, wr_handler, NULL, co); | 761 qemu_aio_set_fd_handler(s->sock, rd_handler, wr_handler, co); |
762} 763 764static coroutine_fn void clear_fd_handler(BDRVSSHState *s) 765{ 766 DPRINTF("s->sock=%d", s->sock); | 762} 763 764static coroutine_fn void clear_fd_handler(BDRVSSHState *s) 765{ 766 DPRINTF("s->sock=%d", s->sock); |
767 qemu_aio_set_fd_handler(s->sock, NULL, NULL, NULL, NULL); | 767 qemu_aio_set_fd_handler(s->sock, NULL, NULL, NULL); |
768} 769 770/* A non-blocking call returned EAGAIN, so yield, ensuring the 771 * handlers are set up so that we'll be rescheduled when there is an 772 * interesting event on the socket. 773 */ 774static coroutine_fn void co_yield(BDRVSSHState *s) 775{ --- 293 unchanged lines hidden --- | 768} 769 770/* A non-blocking call returned EAGAIN, so yield, ensuring the 771 * handlers are set up so that we'll be rescheduled when there is an 772 * interesting event on the socket. 773 */ 774static coroutine_fn void co_yield(BDRVSSHState *s) 775{ --- 293 unchanged lines hidden --- |