mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
[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:
1 parent
badba3ddde
commit
e8d1d26031
2 files changed
+14
No files matched your search
@@ -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
|
||||
# ----------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||