bdev: Allow userspace-only disk templates
Until now all implementations at the bdev level require a local
block device on the primary node. Since there are storage
technologies that allow userspace access only without the need of
a block device, (e.g. QEMU + RADOS), this patch makes the
corresponding changes to support this kind of functionality.
Note that for this to work you need corresponding support in the
OS definition.
This patch changes the backend logic so that it can handle the
absence of local block devices.
Finally, it extends the ExtStorage interface to support the above
functionality. Until now the 'attach' script returned the block
device in the first line. With this patch, if this line is empty,
it denotes that a local block device is not available.
An example could be a RADOS provider where the volume does not get
mapped locally (i.e., no /dev/rbdX device) and the attach script
returns two lines: an empty line denoting that no local block device
exists and a second line with the appropriate KVM userspace URI
(i.e. kvm:rbd:<pool>/<volume name>).
Adjust OpInstanceActivateDisks so that a None dev_path is handled
correctly as a return value.
Signed-off-by: Dimitris Aragiorgis <dimitris.aragiorgis@gmail.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>