diff --git a/cinder/tests/test_xenapi_sm.py b/cinder/tests/test_xenapi_sm.py index d619d257066..ed01dbaa685 100644 --- a/cinder/tests/test_xenapi_sm.py +++ b/cinder/tests/test_xenapi_sm.py @@ -392,7 +392,7 @@ def test_use_image_utils_to_pipe_bytes_to_volume(self): mock, drv = self._setup_mock_driver( 'server', 'serverpath', '/var/run/sr-mount') - volume = dict(provider_location='sr-uuid/vdi-uuid') + volume = dict(provider_location='sr-uuid/vdi-uuid', size=1) context = MockContext('token') mock.StubOutWithMock(driver.image_utils, 'fetch_to_raw') @@ -402,7 +402,7 @@ def test_use_image_utils_to_pipe_bytes_to_volume(self): simple_context('device')) driver.image_utils.fetch_to_raw( - context, 'image_service', 'image_id', 'device') + context, 'image_service', 'image_id', 'device', size=1) mock.ReplayAll() drv._use_image_utils_to_pipe_bytes_to_volume( diff --git a/cinder/volume/drivers/xenapi/sm.py b/cinder/volume/drivers/xenapi/sm.py index c2f53777d92..f19d48054c9 100644 --- a/cinder/volume/drivers/xenapi/sm.py +++ b/cinder/volume/drivers/xenapi/sm.py @@ -175,7 +175,8 @@ def _use_image_utils_to_pipe_bytes_to_volume(self, context, volume, image_utils.fetch_to_raw(context, image_service, image_id, - device) + device, + size=volume['size']) def _use_glance_plugin_to_copy_image_to_volume(self, context, volume, image_service, image_id):