ia64/xen-unstable

changeset 14125:48d581be85ea

Redefine units of VDI.virtual_size to be bytes, not sectors.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Sun Feb 25 23:45:39 2007 +0000 (2007-02-25)
parents 36702d9b2c5c
children 568433250d84
files docs/xen-api/xenapi-datamodel.tex tools/python/scripts/test_vm_create.py tools/python/scripts/xapi.py tools/python/scripts/xapi.vdicfg.py tools/python/xen/xend/XendQCoWStorageRepo.py
line diff
     1.1 --- a/docs/xen-api/xenapi-datamodel.tex	Sun Feb 25 23:37:05 2007 +0000
     1.2 +++ b/docs/xen-api/xenapi-datamodel.tex	Sun Feb 25 23:45:39 2007 +0000
     1.3 @@ -9617,7 +9617,7 @@ Quals & Field & Type & Description \\
     1.4  $\mathit{RW}$ &  {\tt SR} & SR ref & storage repository in which the VDI resides \\
     1.5  $\mathit{RO}_\mathit{run}$ &  {\tt VBDs} & (VBD ref) Set & list of vbds that refer to this disk \\
     1.6  $\mathit{RO}_\mathit{run}$ &  {\tt crash\_dumps} & (crashdump ref) Set & list of crash dumps that refer to this disk \\
     1.7 -$\mathit{RW}$ &  {\tt virtual\_size} & int & size of disk as presented to the guest (in multiples of sector\_size field) \\
     1.8 +$\mathit{RW}$ &  {\tt virtual\_size} & int & size of disk as presented to the guest (in bytes). Note that, depending on storage backend type, requested size may not be respected exactly \\
     1.9  $\mathit{RO}_\mathit{run}$ &  {\tt physical\_utilisation} & int & amount of physical space that the disk image is currently taking up on the storage repository (in bytes) \\
    1.10  $\mathit{RO}_\mathit{ins}$ &  {\tt sector\_size} & int & sector size of VDI (in bytes) \\
    1.11  $\mathit{RO}_\mathit{ins}$ &  {\tt type} & vdi\_type & type of the VDI \\
     2.1 --- a/tools/python/scripts/test_vm_create.py	Sun Feb 25 23:37:05 2007 +0000
     2.2 +++ b/tools/python/scripts/test_vm_create.py	Sun Feb 25 23:45:39 2007 +0000
     2.3 @@ -39,7 +39,7 @@ vm_cfg = {
     2.4  vdi_cfg = {
     2.5      'name_label': 'API_VDI',
     2.6      'name_description': '',
     2.7 -    'virtual_size': 100 * 1024,
     2.8 +    'virtual_size': 100 * 1024 * 1024,
     2.9      'sector_size': 1024,
    2.10      'type': 'system',
    2.11      'parent': '',
     3.1 --- a/tools/python/scripts/xapi.py	Sun Feb 25 23:37:05 2007 +0000
     3.2 +++ b/tools/python/scripts/xapi.py	Sun Feb 25 23:45:39 2007 +0000
     3.3 @@ -569,7 +569,7 @@ def xapi_vdi_list(args, async = False):
     3.4      if not is_long:
     3.5          print VDI_LIST_FORMAT % {'name_label': 'VDI Label',
     3.6                                   'uuid' : 'UUID',
     3.7 -                                 'virtual_size': 'Sectors',
     3.8 +                                 'virtual_size': 'Bytes',
     3.9                                   'sector_size': 'Sector Size'}
    3.10          
    3.11          for vdi in vdis:
    3.12 @@ -628,7 +628,7 @@ def xapi_vdi_create(args, async = False)
    3.13      sr = srs[0]
    3.14      cfg['SR'] = sr
    3.15  
    3.16 -    size = (cfg['virtual_size'] * cfg['sector_size'])/MB
    3.17 +    size = cfg['virtual_size']/MB
    3.18      print 'Creating VDI of size: %dMB ..' % size,
    3.19      uuid = execute(server, 'VDI.create', (session, cfg), async = async)
    3.20      if async:
     4.1 --- a/tools/python/scripts/xapi.vdicfg.py	Sun Feb 25 23:37:05 2007 +0000
     4.2 +++ b/tools/python/scripts/xapi.vdicfg.py	Sun Feb 25 23:45:39 2007 +0000
     4.3 @@ -1,6 +1,6 @@
     4.4  name_label = 'VDI 1'
     4.5  name_description = ''
     4.6 -virtual_size = 10 * 1024
     4.7 +virtual_size = 10 * 1024 * 1024
     4.8  sector_size = 1024
     4.9  type = 'system'
    4.10  sharable = False
     5.1 --- a/tools/python/xen/xend/XendQCoWStorageRepo.py	Sun Feb 25 23:37:05 2007 +0000
     5.2 +++ b/tools/python/xen/xend/XendQCoWStorageRepo.py	Sun Feb 25 23:45:39 2007 +0000
     5.3 @@ -326,7 +326,7 @@ class XendQCoWStorageRepo(XendStorageRep
     5.4              image = self.images[image_uuid]
     5.5              image_cfg = {
     5.6                  'sector_size': sector_size,
     5.7 -                'virtual_size': sector_count,
     5.8 +                'virtual_size': size_bytes,
     5.9                  'type': vdi_struct.get('type', 'system'),
    5.10                  'name_label': vdi_struct.get('name_label', ''),
    5.11                  'name_description': vdi_struct.get('name_description', ''),