after assembly we'll have our correct major/minor.
"""
- def __init__(self, unique_id, children, size, params):
+ def __init__(self, unique_id, children, size, params, dyn_params):
self._children = children
self.dev_path = None
self.unique_id = unique_id
self.attached = False
self.size = size
self.params = params
+ self.dyn_params = dyn_params
def Assemble(self):
"""Assemble the device from its components.
raise NotImplementedError
@classmethod
- def Create(cls, unique_id, children, size, spindles, params, excl_stor):
+ def Create(cls, unique_id, children, size, spindles, params, excl_stor,
+ dyn_params):
"""Create the device.
If the device cannot be created, it will return None
@param params: device-specific options/parameters
@type excl_stor: bool
@param excl_stor: whether exclusive_storage is active
+ @type dyn_params: dict
+ @param dyn_params: dynamic parameters of the disk only valid for this node.
+ As set by L{objects.Disk.UpdateDynamicDiskParams}.
@rtype: L{BlockDev}
@return: the created device, or C{None} in case of an error
for child in self._children:
child.SetInfo(text)
- def Grow(self, amount, dryrun, backingstore):
+ def Grow(self, amount, dryrun, backingstore, excl_stor):
"""Grow the block device.
@type amount: integer
@param backingstore: whether to execute the operation on backing storage
only, or on "logical" storage only; e.g. DRBD is logical storage,
whereas LVM, file, RBD are backing storage
+ @type excl_stor: boolean
+ @param excl_stor: Whether exclusive_storage is active
"""
raise NotImplementedError
"""
return (self.GetActualSize(), self.GetActualSpindles())
+ def GetUserspaceAccessUri(self, hypervisor):
+ """Return URIs hypervisors can use to access disks in userspace mode.
+
+ @rtype: string
+ @return: userspace device URI
+ @raise errors.BlockDeviceError if userspace access is not supported
+
+ """
+ ThrowError("Userspace access with %s block device and %s hypervisor is not "
+ "supported." % (self.__class__.__name__,
+ hypervisor))
+
def __repr__(self):
return ("<%s: unique_id: %s, children: %s, %s:%s, %s>" %
(self.__class__, self.unique_id, self._children,