diff --git a/tools/python/xen/xend/XendAPI.py b/tools/python/xen/xend/XendAPI.py index a7ae50fafb..19e7ce6222 100644 --- a/tools/python/xen/xend/XendAPI.py +++ b/tools/python/xen/xend/XendAPI.py @@ -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 # ---------------------------------------------------------------- diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index 7d9808d6eb..554ce9adca 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -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