summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSalvatore Orlando <salvatore.orlando@eu.citrix.com>2011-01-12 14:17:22 +0000
committerSalvatore Orlando <salvatore.orlando@eu.citrix.com>2011-01-12 14:17:22 +0000
commit7d56986366a349f5636f8de6018fb52e9befd440 (patch)
tree0453b9ca77ae95f5f0b40402b62a7dea6e912414
parentba0f974c126c2a24ca6b1464ccc4a06be071b04e (diff)
downloadnova-7d56986366a349f5636f8de6018fb52e9befd440.tar.gz
nova-7d56986366a349f5636f8de6018fb52e9befd440.tar.xz
nova-7d56986366a349f5636f8de6018fb52e9befd440.zip
Fix for _stream_disk
-rw-r--r--nova/virt/xenapi/vm_utils.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py
index 7df00111e..4b8cec97b 100644
--- a/nova/virt/xenapi/vm_utils.py
+++ b/nova/virt/xenapi/vm_utils.py
@@ -307,7 +307,6 @@ class VMHelper(HelperBase):
meta, image_file = c.get_image(image)
virtual_size = int(meta['size'])
-
vdi_size = virtual_size
LOG.debug(_("Size for image %s:%d"), image, virtual_size)
if type == ImageType.DISK:
@@ -317,7 +316,8 @@ class VMHelper(HelperBase):
vdi = cls.create_vdi(session, sr, _('Glance image %s') % image,
vdi_size, False)
- with_vdi_attached_here(session, vdi, False, _stream_disk)
+ with_vdi_attached_here(session, vdi, False,
+ lambda dev:_stream_disk(dev,image_file))
if (type == ImageType.KERNEL_RAMDISK):
#we need to invoke a plugin for copying VDI's
#content into proper path
@@ -652,7 +652,7 @@ def get_this_vm_ref(session):
return session.get_xenapi().VM.get_by_uuid(get_this_vm_uuid())
-def _stream_disk(dev):
+def _stream_disk(dev,image_file):
offset = 0
if type == ImageType.DISK:
offset = MBR_SIZE_BYTES