summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSalvatore Orlando <salvatore.orlando@eu.citrix.com>2011-01-12 17:05:40 +0000
committerSalvatore Orlando <salvatore.orlando@eu.citrix.com>2011-01-12 17:05:40 +0000
commitc71d5d41bb6e5d7a046a76563eed75a4d6e77e90 (patch)
treed8a15ee2c423ab72812abc566cee774700a65425
parentf3dba791b9f10fec759dce0fe4e2abc214e3fd61 (diff)
downloadnova-c71d5d41bb6e5d7a046a76563eed75a4d6e77e90.tar.gz
nova-c71d5d41bb6e5d7a046a76563eed75a4d6e77e90.tar.xz
nova-c71d5d41bb6e5d7a046a76563eed75a4d6e77e90.zip
Fixed another issue in _stream_disk, as it did never execute _write_partition.
Fixed fake method accordingly. Fixed pep8 errors.
-rw-r--r--nova/tests/xenapi/stubs.py2
-rw-r--r--nova/virt/xenapi/vm_utils.py6
2 files changed, 5 insertions, 3 deletions
diff --git a/nova/tests/xenapi/stubs.py b/nova/tests/xenapi/stubs.py
index 0c0fe5bc9..624995ada 100644
--- a/nova/tests/xenapi/stubs.py
+++ b/nova/tests/xenapi/stubs.py
@@ -125,7 +125,7 @@ def stubout_get_this_vm_uuid(stubs):
def stubout_stream_disk(stubs):
- def f(_1, _2):
+ def f(_1, _2, _3, _4):
pass
stubs.Set(vm_utils, '_stream_disk', f)
diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py
index 6f19f5970..2c9d53858 100644
--- a/nova/virt/xenapi/vm_utils.py
+++ b/nova/virt/xenapi/vm_utils.py
@@ -317,7 +317,9 @@ class VMHelper(HelperBase):
vdi_size, False)
with_vdi_attached_here(session, vdi, False,
- lambda dev: _stream_disk(dev, image_file))
+ lambda dev:
+ _stream_disk(dev, type,
+ virtual_size, image_file))
if (type == ImageType.KERNEL_RAMDISK):
#we need to invoke a plugin for copying VDI's
#content into proper path
@@ -652,7 +654,7 @@ def get_this_vm_ref(session):
return session.get_xenapi().VM.get_by_uuid(get_this_vm_uuid())
-def _stream_disk(dev, image_file):
+def _stream_disk(dev, type, virtual_size, image_file):
offset = 0
if type == ImageType.DISK:
offset = MBR_SIZE_BYTES