Boot from volume for Xen

Implements bp xenapi-boot-from-volume

Ensure boot from volume works for XenAPI (tested using XenServer).
1. Add strip_prefix to block_device to make the command mountpoint
agnostic.
2. Pass block device and delete on terminate information to driver
layer.
3. Add ability to recognize and boot from the specified nova volume.

Change-Id: If117087086eab809217d2b173f921bf9319a52c7
This commit is contained in:
Renuka Apte
2012-06-04 13:48:34 -07:00
committed by Gerrit Code Review
parent 14df5dfb99
commit ed4f9ca54b

View File

@@ -72,3 +72,12 @@ _dev = re.compile('^/dev/')
def strip_dev(device_name):
"""remove leading '/dev/'"""
return _dev.sub('', device_name)
_pref = re.compile('^((x?v|s)d)')
def strip_prefix(device_name):
""" remove both leading /dev/ and xvd or sd or vd """
device_name = strip_dev(device_name)
return _pref.sub('', device_name)