Commit 4c8ba8b3 authored by Iustin Pop's avatar Iustin Pop
Browse files

Implement block device grow at the rpc layer

This simple patch exposes the block device grow operation at the rpc
layer. It does not increase the protocol version as it has been recently
changed by the live failover rpc call.

Reviewed-by: imsnah
parent 594609c0
......@@ -211,6 +211,15 @@ class ServerObject(BaseHTTPServer.BaseHTTPRequestHandler):
cfbd = objects.Disk.FromDict(params[0])
return backend.SnapshotBlockDevice(cfbd)
def perspective_blockdev_grow(params):
"""Grow a stack of devices.
cfbd = objects.Disk.FromDict(params[0])
amount = params[1]
return backend.GrowBlockDevice(cfbd, amount)
# export/import --------------------------
......@@ -607,6 +607,18 @@ def call_iallocator_runner(node, name, idata):
return result
def call_blockdev_grow(node, cf_bdev, amount):
"""Request a snapshot of the given block device.
This is a single-node call.
c = Client("blockdev_grow", [cf_bdev.ToDict(), amount])
return c.getresult().get(node, False)
def call_blockdev_snapshot(node, cf_bdev):
"""Request a snapshot of the given 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