Merge pull request #6936 from kaptk2/develop

Added ability to specify boot order
This commit is contained in:
Thomas S Hatch 2013-08-28 09:41:28 -07:00
commit 0a8ce6a7ad

View File

@ -197,7 +197,7 @@ def _gen_xml(name,
<memory unit='KiB'>%%MEM%%</memory>
<os>
<type>hvm</type>
<boot dev='hd'/>
%%BOOT%%
</os>
<devices>
<disk type='file' device='disk'>
@ -219,6 +219,16 @@ def _gen_xml(name,
data = data.replace('%%MEM%%', str(mem))
data = data.replace('%%VDA%%', vda)
data = data.replace('%%DISKTYPE%%', _image_type(vda))
boot_str = ''
if 'boot_dev' in kwargs:
for dev in boot_dev:
boot_part = '''<boot dev='%%DEV%%' />
'''
boot_part = boot_part.replace('%%DEV%%', dev)
boot_str += boot_part
else:
boot_str = '''<boot dev='hd'/>'''
data = data.replace('%%BOOT%%', boot_str)
nic_str = ''
for dev, args in nicp.items():
nic_t = '''