Merge "Refix disk size during live migration with disk over-commit"

This commit is contained in:
Zuul 2018-08-29 11:42:07 +00:00 committed by Gerrit Code Review
commit 0b63a7674a
2 changed files with 3 additions and 3 deletions

View File

@ -8763,7 +8763,7 @@ class LibvirtConnTestCase(test.NoDBTestCase,
instance_ref.vcpu_model = test_vcpu_model.fake_vcpumodel
drvr = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), False)
compute_info = {'disk_available_least': -1000,
'local_gb': 100,
'free_disk_gb': 50,
'cpu_info': 'asdf',
}
filename = "file"
@ -8780,7 +8780,7 @@ class LibvirtConnTestCase(test.NoDBTestCase,
return_value.is_volume_backed = False
self.assertThat({"filename": "file",
'image_type': 'default',
'disk_available_mb': 102400,
'disk_available_mb': 51200,
"disk_over_commit": True,
"block_migration": True,
"is_volume_backed": False,

View File

@ -6622,7 +6622,7 @@ class LibvirtDriver(driver.ComputeDriver):
raise exception.MigrationPreCheckError(reason=msg)
if disk_over_commit:
disk_available_gb = dst_compute_info['local_gb']
disk_available_gb = dst_compute_info['free_disk_gb']
else:
disk_available_gb = dst_compute_info['disk_available_least']
disk_available_mb = (