Handle a failed disconnect correctly

If the sender disconnects its socket before sending the disconnect
message, the destination should restart the migration process.  This
patch makes sure that happens.
This commit is contained in:
Alex Young
2012-07-12 09:39:39 +01:00
parent f3cebcdcd5
commit eb90308b6e
9 changed files with 154 additions and 14 deletions

View File

@@ -50,12 +50,27 @@ module FlexNBD
send_request( 65536, handle )
end
def write_disconnect_request( handle="myhandle" )
send_request( 2, handle )
end
def write_data( data )
@sock.write( data )
end
def send_mirror
read_hello()
write_write_request( 0, 8 )
write_data( "12345678" )
read_response()
write_entrust_request()
read_response()
write_disconnect_request()
close()
end
def read_response
magic = @sock.read(4)