[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Redefine units of VDI.virtual_size to be bytes, not sectors.



# HG changeset patch
# User Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Date 1172447139 0
# Node ID 48d581be85eaa78240a7dbbca9be10698b837424
# Parent  36702d9b2c5cffc73f431bffc109629db386f898
Redefine units of VDI.virtual_size to be bytes, not sectors.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>
---
 docs/xen-api/xenapi-datamodel.tex            |    2 +-
 tools/python/scripts/test_vm_create.py       |    2 +-
 tools/python/scripts/xapi.py                 |    4 ++--
 tools/python/scripts/xapi.vdicfg.py          |    2 +-
 tools/python/xen/xend/XendQCoWStorageRepo.py |    2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff -r 36702d9b2c5c -r 48d581be85ea docs/xen-api/xenapi-datamodel.tex
--- a/docs/xen-api/xenapi-datamodel.tex Sun Feb 25 23:37:05 2007 +0000
+++ b/docs/xen-api/xenapi-datamodel.tex Sun Feb 25 23:45:39 2007 +0000
@@ -9617,7 +9617,7 @@ Quals & Field & Type & Description \\
 $\mathit{RW}$ &  {\tt SR} & SR ref & storage repository in which the VDI 
resides \\
 $\mathit{RO}_\mathit{run}$ &  {\tt VBDs} & (VBD ref) Set & list of vbds that 
refer to this disk \\
 $\mathit{RO}_\mathit{run}$ &  {\tt crash\_dumps} & (crashdump ref) Set & list 
of crash dumps that refer to this disk \\
-$\mathit{RW}$ &  {\tt virtual\_size} & int & size of disk as presented to the 
guest (in multiples of sector\_size field) \\
+$\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 \\
 $\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) \\
 $\mathit{RO}_\mathit{ins}$ &  {\tt sector\_size} & int & sector size of VDI 
(in bytes) \\
 $\mathit{RO}_\mathit{ins}$ &  {\tt type} & vdi\_type & type of the VDI \\
diff -r 36702d9b2c5c -r 48d581be85ea tools/python/scripts/test_vm_create.py
--- a/tools/python/scripts/test_vm_create.py    Sun Feb 25 23:37:05 2007 +0000
+++ b/tools/python/scripts/test_vm_create.py    Sun Feb 25 23:45:39 2007 +0000
@@ -39,7 +39,7 @@ vdi_cfg = {
 vdi_cfg = {
     'name_label': 'API_VDI',
     'name_description': '',
-    'virtual_size': 100 * 1024,
+    'virtual_size': 100 * 1024 * 1024,
     'sector_size': 1024,
     'type': 'system',
     'parent': '',
diff -r 36702d9b2c5c -r 48d581be85ea tools/python/scripts/xapi.py
--- a/tools/python/scripts/xapi.py      Sun Feb 25 23:37:05 2007 +0000
+++ b/tools/python/scripts/xapi.py      Sun Feb 25 23:45:39 2007 +0000
@@ -569,7 +569,7 @@ def xapi_vdi_list(args, async = False):
     if not is_long:
         print VDI_LIST_FORMAT % {'name_label': 'VDI Label',
                                  'uuid' : 'UUID',
-                                 'virtual_size': 'Sectors',
+                                 'virtual_size': 'Bytes',
                                  'sector_size': 'Sector Size'}
         
         for vdi in vdis:
@@ -628,7 +628,7 @@ def xapi_vdi_create(args, async = False)
     sr = srs[0]
     cfg['SR'] = sr
 
-    size = (cfg['virtual_size'] * cfg['sector_size'])/MB
+    size = cfg['virtual_size']/MB
     print 'Creating VDI of size: %dMB ..' % size,
     uuid = execute(server, 'VDI.create', (session, cfg), async = async)
     if async:
diff -r 36702d9b2c5c -r 48d581be85ea tools/python/scripts/xapi.vdicfg.py
--- a/tools/python/scripts/xapi.vdicfg.py       Sun Feb 25 23:37:05 2007 +0000
+++ b/tools/python/scripts/xapi.vdicfg.py       Sun Feb 25 23:45:39 2007 +0000
@@ -1,6 +1,6 @@ name_label = 'VDI 1'
 name_label = 'VDI 1'
 name_description = ''
-virtual_size = 10 * 1024
+virtual_size = 10 * 1024 * 1024
 sector_size = 1024
 type = 'system'
 sharable = False
diff -r 36702d9b2c5c -r 48d581be85ea 
tools/python/xen/xend/XendQCoWStorageRepo.py
--- a/tools/python/xen/xend/XendQCoWStorageRepo.py      Sun Feb 25 23:37:05 
2007 +0000
+++ b/tools/python/xen/xend/XendQCoWStorageRepo.py      Sun Feb 25 23:45:39 
2007 +0000
@@ -326,7 +326,7 @@ class XendQCoWStorageRepo(XendStorageRep
             image = self.images[image_uuid]
             image_cfg = {
                 'sector_size': sector_size,
-                'virtual_size': sector_count,
+                'virtual_size': size_bytes,
                 'type': vdi_struct.get('type', 'system'),
                 'name_label': vdi_struct.get('name_label', ''),
                 'name_description': vdi_struct.get('name_description', ''),

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.