Added the flexnbd break command to stop mirroring

This commit is contained in:
Alex Young
2012-07-17 16:30:49 +01:00
parent 1caa3d4e27
commit 314c0c2a2a
10 changed files with 223 additions and 8 deletions

View File

@@ -271,6 +271,11 @@ class FlexNBD
"#{@debug} "
end
def break_cmd
"#{@bin} break "\
"--sock #{ctrl} "\
"#{@debug}"
end
def status_cmd
"#{@bin} status "\
@@ -416,6 +421,14 @@ class FlexNBD
end
def break(timeout=nil)
cmd = break_cmd
debug( cmd )
maybe_timeout( cmd, timeout )
end
def acl(*acl)
cmd = acl_cmd( *acl )
debug( cmd )
@@ -439,6 +452,14 @@ class FlexNBD
end
def paused
Process.kill( "STOP", @pid )
yield
ensure
Process.kill( "CONT", @pid )
end
protected
def control_command(*args)
raise "Server not running" unless @pid