pass
if dev_type == 'vbd':
- dev_info['bootable'] = 0
if dev_info.get('dev', '').startswith('ioemu:'):
dev_info['driver'] = 'ioemu'
else:
if param not in target:
target[param] = []
if dev_uuid not in target[param]:
- if dev_type == 'vbd':
+ if dev_type == 'vbd' and 'bootable' not in dev_info:
# Compat hack -- mark first disk bootable
dev_info['bootable'] = int(not target[param])
target[param].append(dev_uuid)
if 'vbd_refs' not in target:
target['vbd_refs'] = []
if dev_uuid not in target['vbd_refs']:
- # Compat hack -- mark first disk bootable
- dev_info['bootable'] = int(not target['vbd_refs'])
+ if 'bootable' not in dev_info:
+ # Compat hack -- mark first disk bootable
+ dev_info['bootable'] = int(not target['vbd_refs'])
target['vbd_refs'].append(dev_uuid)
elif dev_type == 'vfb':
if uuid:
back['uuid'] = uuid
+ bootable = config.get('bootable', None)
+ if bootable != None:
+ back['bootable'] = str(bootable)
+
if security.on() == xsconstants.XS_POLICY_USE:
self.do_access_control(config, uname)
config = DevController.getDeviceConfiguration(self, devid, transaction)
if transaction is None:
devinfo = self.readBackend(devid, 'dev', 'type', 'params', 'mode',
- 'uuid')
+ 'uuid', 'bootable')
else:
devinfo = self.readBackendTxn(transaction, devid,
- 'dev', 'type', 'params', 'mode', 'uuid')
- dev, typ, params, mode, uuid = devinfo
+ 'dev', 'type', 'params', 'mode', 'uuid',
+ 'bootable')
+ dev, typ, params, mode, uuid, bootable = devinfo
if dev:
if transaction is None:
config['mode'] = mode
if uuid:
config['uuid'] = uuid
+ if bootable != None:
+ config['bootable'] = int(bootable)
proto = self.readFrontend(devid, 'protocol')
if proto: