Commit 9c007da8 authored by René Nussbaumer's avatar René Nussbaumer
Browse files

Add RPC calls for pause/resume sync of devices


Signed-off-by: default avatarRené Nussbaumer <rn@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 5119c79e
......@@ -988,6 +988,16 @@ class RpcRunner(object):
return self._SingleNodeCall(node, "blockdev_rename",
[(d.ToDict(), uid) for d, uid in devlist])
@_RpcTimeout(_TMO_NORMAL)
def call_blockdev_pause_resume_sync(self, node, disks, pause):
"""Request a pause/resume of given block device.
This is a single-node call.
"""
return self._SingleNodeCall(node, "blockdev_pause_resume_sync",
[[bdev.ToDict() for bdev in disks], pause])
@_RpcTimeout(_TMO_NORMAL)
def call_blockdev_assemble(self, node, disk, owner, on_primary):
"""Request assembling of a given block device.
......
......@@ -183,6 +183,15 @@ class NodeHttpServer(http.server.HttpServer):
raise ValueError("can't unserialize data!")
return backend.BlockdevCreate(bdev, size, owner, on_primary, info)
@staticmethod
def perspective_blockdev_pause_resume_sync(params):
"""Pause/resume sync of a block device.
"""
disks_s, pause = params
disks = [objects.Disk.FromDict(bdev_s) for bdev_s in disks_s]
return backend.BlockdevPauseResumeSync(disks, pause)
@staticmethod
def perspective_blockdev_wipe(params):
"""Wipe a block device.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment