Commit 5119c79e authored by René Nussbaumer's avatar René Nussbaumer
Browse files

Add backend method for pause/resume sync of devices

Signed-off-by: default avatarRené Nussbaumer <>
Reviewed-by: default avatarIustin Pop <>
Reviewed-by: default avatarMichael Hanselmann <>
parent a3fffcc6
......@@ -1353,6 +1353,41 @@ def BlockdevWipe(disk, offset, size):
_WipeDevice(rdev.dev_path, offset, size)
def BlockdevPauseResumeSync(disks, pause):
"""Pause or resume the sync of the block device.
@type disk: list of L{objects.Disk}
@param disk: the disks object we want to pause/resume
@type pause: bool
@param pause: Wheater to pause or resume
success = []
for disk in disks:
rdev = _RecursiveFindBD(disk)
except errors.BlockDeviceError:
rdev = None
if not rdev:
success.append((False, ("Cannot change sync for device %s:"
" device not found" % disk.iv_name)))
result = rdev.PauseResumeSync(pause)
if result:
success.append((result, None))
if pause:
msg = "Pause"
msg = "Resume"
success.append((result, "%s for device %s failed" % (msg, disk.iv_name)))
return success
def BlockdevRemove(disk):
"""Remove 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