direct-io.hg

changeset 13750:0c91fd1c92c7

[XEND] Use VDI.location rather than VDI.image_uri/uri for Xen API

Signed-off-by: Alastair Tse <atse@xensource.com>
author Alastair Tse <atse@xensource.com>
date Wed Jan 31 15:05:58 2007 +0000 (2007-01-31)
parents 3291a7b48731
children 85e8d7b8360a
files tools/python/xen/xend/XendAPI.py tools/python/xen/xend/XendVDI.py
line diff
     1.1 --- a/tools/python/xen/xend/XendAPI.py	Wed Jan 31 15:04:06 2007 +0000
     1.2 +++ b/tools/python/xen/xend/XendAPI.py	Wed Jan 31 15:05:58 2007 +0000
     1.3 @@ -1469,7 +1469,7 @@ class XendAPI(object):
     1.4              vdi = XendNode.instance().get_vdi_by_uuid(vdi_ref)
     1.5              if not vdi:
     1.6                  return xen_api_error(['VDI_HANDLE_INVALID', vdi_ref])
     1.7 -            vdi_image = vdi.get_image_uri()
     1.8 +            vdi_image = vdi.get_location()
     1.9              vbd_ref = XendTask.log_progress(0, 100,
    1.10                                              dom.create_vbd,
    1.11                                              vbd_struct, vdi_image)
     2.1 --- a/tools/python/xen/xend/XendVDI.py	Wed Jan 31 15:04:06 2007 +0000
     2.2 +++ b/tools/python/xen/xend/XendVDI.py	Wed Jan 31 15:05:58 2007 +0000
     2.3 @@ -73,6 +73,7 @@ class XendVDI(AutoSaveObject):
     2.4          self.sharable = False
     2.5          self.read_only = False
     2.6          self.type = "system"
     2.7 +        self.location = ''
     2.8  
     2.9      def load_config_dict(self, cfg):
    2.10          """Loads configuration into the object from a dict.
    2.11 @@ -147,9 +148,10 @@ class XendVDI(AutoSaveObject):
    2.12                  'sharable': False,
    2.13                  'readonly': False,
    2.14                  'SR': self.sr_uuid,
    2.15 +                'location': self.get_location(),
    2.16                  'VBDs': []}
    2.17  
    2.18 -    def get_image_uri(self):
    2.19 +    def get_location(self):
    2.20          raise NotImplementedError()
    2.21                  
    2.22  
    2.23 @@ -163,9 +165,10 @@ class XendQCoWVDI(XendVDI):
    2.24          self.virtual_size = vsize
    2.25          self.sector_size = 512
    2.26          self.auto_save = True
    2.27 +        self.location = 'tap:qcow:%s' % self.qcow_path
    2.28  
    2.29 -    def get_image_uri(self):
    2.30 -        return 'tap:qcow:%s' % self.qcow_path
    2.31 +    def get_location(self):
    2.32 +        return self.location
    2.33  
    2.34  class XendLocalVDI(XendVDI):
    2.35      def __init__(self, vdi_struct):
    2.36 @@ -183,7 +186,7 @@ class XendLocalVDI(XendVDI):
    2.37          self.type = vdi_struct.get('type', '')
    2.38          self.sharable = vdi_struct.get('sharable', False)
    2.39          self.read_only = vdi_struct.get('read_only', False)
    2.40 -        self.image_uri = vdi_struct.get('uri', 'file:/dev/null')
    2.41 +        self.location = vdi_struct.get('location', 'file:/dev/null')
    2.42  
    2.43 -    def get_image_uri(self):
    2.44 -        return self.image_uri
    2.45 +    def get_location(self):
    2.46 +        return self.location