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] Use VDI.location rather than VDI.i

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XEND] Use VDI.location rather than VDI.image_uri/uri for Xen API
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 31 Jan 2007 11:05:11 -0800
Delivery-date: Wed, 31 Jan 2007 11:05:53 -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 1170255958 0
# Node ID 0c91fd1c92c7001a6e08fe6a8bb2acda7375454c
# Parent  3291a7b48731018d52060a36f1b1dd67f8410d6a
[XEND] Use VDI.location rather than VDI.image_uri/uri for Xen API

Signed-off-by: Alastair Tse <atse@xxxxxxxxxxxxx>
---
 tools/python/xen/xend/XendAPI.py |    2 +-
 tools/python/xen/xend/XendVDI.py |   15 +++++++++------
 2 files changed, 10 insertions(+), 7 deletions(-)

diff -r 3291a7b48731 -r 0c91fd1c92c7 tools/python/xen/xend/XendAPI.py
--- a/tools/python/xen/xend/XendAPI.py  Wed Jan 31 15:04:06 2007 +0000
+++ b/tools/python/xen/xend/XendAPI.py  Wed Jan 31 15:05:58 2007 +0000
@@ -1469,7 +1469,7 @@ class XendAPI(object):
             vdi = XendNode.instance().get_vdi_by_uuid(vdi_ref)
             if not vdi:
                 return xen_api_error(['VDI_HANDLE_INVALID', vdi_ref])
-            vdi_image = vdi.get_image_uri()
+            vdi_image = vdi.get_location()
             vbd_ref = XendTask.log_progress(0, 100,
                                             dom.create_vbd,
                                             vbd_struct, vdi_image)
diff -r 3291a7b48731 -r 0c91fd1c92c7 tools/python/xen/xend/XendVDI.py
--- a/tools/python/xen/xend/XendVDI.py  Wed Jan 31 15:04:06 2007 +0000
+++ b/tools/python/xen/xend/XendVDI.py  Wed Jan 31 15:05:58 2007 +0000
@@ -73,6 +73,7 @@ class XendVDI(AutoSaveObject):
         self.sharable = False
         self.read_only = False
         self.type = "system"
+        self.location = ''
 
     def load_config_dict(self, cfg):
         """Loads configuration into the object from a dict.
@@ -147,9 +148,10 @@ class XendVDI(AutoSaveObject):
                 'sharable': False,
                 'readonly': False,
                 'SR': self.sr_uuid,
+                'location': self.get_location(),
                 'VBDs': []}
 
-    def get_image_uri(self):
+    def get_location(self):
         raise NotImplementedError()
                 
 
@@ -163,9 +165,10 @@ class XendQCoWVDI(XendVDI):
         self.virtual_size = vsize
         self.sector_size = 512
         self.auto_save = True
+        self.location = 'tap:qcow:%s' % self.qcow_path
 
-    def get_image_uri(self):
-        return 'tap:qcow:%s' % self.qcow_path
+    def get_location(self):
+        return self.location
 
 class XendLocalVDI(XendVDI):
     def __init__(self, vdi_struct):
@@ -183,7 +186,7 @@ class XendLocalVDI(XendVDI):
         self.type = vdi_struct.get('type', '')
         self.sharable = vdi_struct.get('sharable', False)
         self.read_only = vdi_struct.get('read_only', False)
-        self.image_uri = vdi_struct.get('uri', 'file:/dev/null')
+        self.location = vdi_struct.get('location', 'file:/dev/null')
 
-    def get_image_uri(self):
-        return self.image_uri
+    def get_location(self):
+        return self.location

_______________________________________________
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] Use VDI.location rather than VDI.image_uri/uri for Xen API, Xen patchbot-unstable <=