[XEND] Strip suffix from device name and add support for 'VBD.type'

Signed-off-by: Alastair Tse <atse@xensource.com>
This commit is contained in:
Alastair Tse committed 2007-01-24 12:07:54 +00:00
1 parent badba3ddde
commit e8d1d26031
2 files changed
+14

No files matched your search

+6
View File
@@ -1090,6 +1090,7 @@ class XendAPI:
'VDI',
'device',
'mode',
'type',
'driver']
VBD_attr_inst = VBD_attr_rw + ['image']
@@ -1170,6 +1171,11 @@ class XendAPI:
return xen_api_success(xendom.get_dev_property_by_uuid('vbd', vbd_ref,
'driver'))
def VBD_get_type(self, session, vbd_ref):
xendom = XendDomain.instance()
return xen_api_success(xendom.get_dev_property_by_uuid('vbd', vbd_ref,
'type'))
# Xen API: Class VIF
# ----------------------------------------------------------------
+8
View File
@@ -2058,6 +2058,14 @@ class XendDomainInfo:
if dev_class == 'vbd':
config['VDI'] = config.get('VDI', '')
config['device'] = config.get('dev', '')
if ':' in config['device']:
vbd_name, vbd_type = config['device'].split(':', 1)
config['device'] = vbd_name
if vbd_type == 'cdrom':
config['type'] = XEN_API_VBD_TYPE[0]
else:
config['type'] = XEN_API_VBD_TYPE[1]
config['driver'] = 'paravirtualised' # TODO
config['image'] = config.get('uname', '')
config['io_read_kbs'] = 0.0
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.