WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] [XEND] Strip suffix from device name and

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XEND] Strip suffix from device name and add support for 'VBD.type'
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 25 Jan 2007 08:55:13 -0800
Delivery-date: Thu, 25 Jan 2007 08:55:38 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Alastair Tse <atse@xxxxxxxxxxxxx>
# Date 1169640474 0
# Node ID 4f5772324e679e9794ccd72848023c081d7300da
# Parent  8331aca2f29ca29704f4bafabe0e542f312d6950
[XEND] Strip suffix from device name and add support for 'VBD.type'

Signed-off-by: Alastair Tse <atse@xxxxxxxxxxxxx>
---
 tools/python/xen/xend/XendAPI.py        |    6 ++++++
 tools/python/xen/xend/XendDomainInfo.py |    8 ++++++++
 2 files changed, 14 insertions(+)

diff -r 8331aca2f29c -r 4f5772324e67 tools/python/xen/xend/XendAPI.py
--- a/tools/python/xen/xend/XendAPI.py  Wed Jan 24 12:02:56 2007 +0000
+++ b/tools/python/xen/xend/XendAPI.py  Wed Jan 24 12:07:54 2007 +0000
@@ -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 -r 8331aca2f29c -r 4f5772324e67 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Wed Jan 24 12:02:56 2007 +0000
+++ b/tools/python/xen/xend/XendDomainInfo.py   Wed Jan 24 12:07:54 2007 +0000
@@ -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

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [XEND] Strip suffix from device name and add support for 'VBD.type', Xen patchbot-unstable <=