qemu-nbd: rewrite termination conditions to use a state machine
Use a simple state machine with the following states:
- RUNNING => accepting connections
- TERMINATE => main loop must call nbd_export_close/put, and not accept
connections anymore
- TERMINATING => waiting for pending requests to finish
- TERMINATED => the NBDExport has been closed
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
Showing
想要评论请 注册 或 登录