Revision f83057ad lib/storage/bdev.py
b/lib/storage/bdev.py | ||
---|---|---|
1006 | 1006 |
raise ValueError("Invalid configuration data %s" % str(unique_id)) |
1007 | 1007 |
|
1008 | 1008 |
self.driver, self.rbd_name = unique_id |
1009 |
self.rbd_pool = params[constants.LDP_POOL] |
|
1009 | 1010 |
|
1010 | 1011 |
self.major = self.minor = None |
1011 | 1012 |
self.Attach() |
... | ... | |
1343 | 1344 |
base.ThrowError("rbd resize failed (%s): %s", |
1344 | 1345 |
result.fail_reason, result.output) |
1345 | 1346 |
|
1347 |
def GetUserspaceAccessUri(self, hypervisor): |
|
1348 |
"""Generate KVM userspace URIs to be used as `-drive file` settings. |
|
1349 |
|
|
1350 |
@see: L{BlockDev.GetUserspaceAccessUri} |
|
1351 |
|
|
1352 |
""" |
|
1353 |
if hypervisor == constants.HT_KVM: |
|
1354 |
return "rbd:" + self.rbd_pool + "/" + self.rbd_name |
|
1355 |
else: |
|
1356 |
base.ThrowError("Hypervisor %s doesn't support RBD userspace access" % |
|
1357 |
hypervisor) |
|
1358 |
|
|
1346 | 1359 |
|
1347 | 1360 |
class ExtStorageDevice(base.BlockDev): |
1348 | 1361 |
"""A block device provided by an ExtStorage Provider. |
Also available in: Unified diff