Revision a3fffcc6 lib/bdev.py
b/lib/bdev.py | ||
---|---|---|
230 | 230 |
result = result and child.SetSyncSpeed(speed) |
231 | 231 |
return result |
232 | 232 |
|
233 |
def PauseResumeSync(self, pause): |
|
234 |
"""Pause/Resume the sync of the mirror. |
|
235 |
|
|
236 |
In case this is not a mirroring device, this is no-op. |
|
237 |
|
|
238 |
@param pause: Wheater to pause or resume |
|
239 |
|
|
240 |
""" |
|
241 |
result = True |
|
242 |
if self._children: |
|
243 |
for child in self._children: |
|
244 |
result = result and child.PauseResumeSync(pause) |
|
245 |
return result |
|
246 |
|
|
233 | 247 |
def GetSyncStatus(self): |
234 | 248 |
"""Returns the sync status of the device. |
235 | 249 |
|
... | ... | |
1488 | 1502 |
children_result = super(DRBD8, self).SetSyncSpeed(kbytes) |
1489 | 1503 |
return self._SetMinorSyncSpeed(self.minor, kbytes) and children_result |
1490 | 1504 |
|
1505 |
def PauseResumeSync(self, pause): |
|
1506 |
"""Pauses or resumes the sync of a DRBD device. |
|
1507 |
|
|
1508 |
@param pause: Wether to pause or resume |
|
1509 |
@return: the success of the operation |
|
1510 |
|
|
1511 |
""" |
|
1512 |
if self.minor is None: |
|
1513 |
logging.info("Not attached during PauseSync") |
|
1514 |
return False |
|
1515 |
|
|
1516 |
children_result = super(DRBD8, self).PauseResumeSync(pause) |
|
1517 |
|
|
1518 |
if pause: |
|
1519 |
cmd = "pause-sync" |
|
1520 |
else: |
|
1521 |
cmd = "resume-sync" |
|
1522 |
|
|
1523 |
result = utils.RunCmd(["drbdsetup", self.dev_path, cmd]) |
|
1524 |
if result.failed: |
|
1525 |
logging.error("Can't %s: %s - %s", cmd, |
|
1526 |
result.fail_reason, result.output) |
|
1527 |
return not result.failed and children_result |
|
1528 |
|
|
1491 | 1529 |
def GetProcStatus(self): |
1492 | 1530 |
"""Return device data from /proc. |
1493 | 1531 |
|
Also available in: Unified diff