Revision 48e175a2 lib/backend.py
b/lib/backend.py | ||
---|---|---|
2517 | 2517 |
disk.unique_id, disk.dev_type) |
2518 | 2518 |
|
2519 | 2519 |
|
2520 |
def BlockdevSetInfo(disk, info): |
|
2521 |
"""Sets 'metadata' information on block devices. |
|
2522 |
|
|
2523 |
This function sets 'info' metadata on block devices. Initial |
|
2524 |
information is set at device creation; this function should be used |
|
2525 |
for example after renames. |
|
2526 |
|
|
2527 |
@type disk: L{objects.Disk} |
|
2528 |
@param disk: the disk to be grown |
|
2529 |
@type info: string |
|
2530 |
@param info: new 'info' metadata |
|
2531 |
@rtype: (status, result) |
|
2532 |
@return: a tuple with the status of the operation (True/False), and |
|
2533 |
the errors message if status is False |
|
2534 |
|
|
2535 |
""" |
|
2536 |
r_dev = _RecursiveFindBD(disk) |
|
2537 |
if r_dev is None: |
|
2538 |
_Fail("Cannot find block device %s", disk) |
|
2539 |
|
|
2540 |
try: |
|
2541 |
r_dev.SetInfo(info) |
|
2542 |
except errors.BlockDeviceError, err: |
|
2543 |
_Fail("Failed to set information on block device: %s", err, exc=True) |
|
2544 |
|
|
2545 |
|
|
2520 | 2546 |
def FinalizeExport(instance, snap_disks): |
2521 | 2547 |
"""Write out the export configuration information. |
2522 | 2548 |
|
Also available in: Unified diff