mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
Redefine units of VDI.virtual_size to be bytes, not sectors.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
1 parent
496ee4e22a
commit
51b6900b84
5 files changed
+6
-6
No files matched your search
@@ -39,7 +39,7 @@ vm_cfg = {
|
||||
vdi_cfg = {
|
||||
'name_label': 'API_VDI',
|
||||
'name_description': '',
|
||||
'virtual_size': 100 * 1024,
|
||||
'virtual_size': 100 * 1024 * 1024,
|
||||
'sector_size': 1024,
|
||||
'type': 'system',
|
||||
'parent': '',
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name_label = 'VDI 1'
|
||||
name_description = ''
|
||||
virtual_size = 10 * 1024
|
||||
virtual_size = 10 * 1024 * 1024
|
||||
sector_size = 1024
|
||||
type = 'system'
|
||||
sharable = False
|
||||
|
||||