From de5cb27e64267ec59e12a495a59880412cecb5e8 Mon Sep 17 00:00:00 2001 From: Jim Fehlig Date: Thu, 10 May 2012 13:20:20 -0700 Subject: Use default qemu-img cluster size in libvirt connection driver The recommended cluster size [1] for qcow2 is 64k, which is the default when invoking 'qemu-img create ...'. Remove the cluster_size option from qemu-img invocation. [1] http://www.mail-archive.com/openstack@lists.launchpad.net/msg11371.html V2: Fix test. Change-Id: Iafc290720a820cb5f57ded10a2f584fdc5cd5b49 --- Authors | 1 + nova/tests/test_libvirt.py | 2 +- nova/virt/libvirt/utils.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Authors b/Authors index 3818e4f57..d67e781c6 100644 --- a/Authors +++ b/Authors @@ -87,6 +87,7 @@ Jason Koelker Jay Pipes JC Martin Jesse Andrews +Jim Fehlig Jimmy Bergman Joe Gordon Joe Heck diff --git a/nova/tests/test_libvirt.py b/nova/tests/test_libvirt.py index 2391ea1ea..11e51b8a6 100644 --- a/nova/tests/test_libvirt.py +++ b/nova/tests/test_libvirt.py @@ -2201,7 +2201,7 @@ class LibvirtUtilsTestCase(test.TestCase): def test_create_cow_image(self): self.mox.StubOutWithMock(utils, 'execute') utils.execute('qemu-img', 'create', '-f', 'qcow2', - '-o', 'cluster_size=2M,backing_file=/some/path', + '-o', 'backing_file=/some/path', '/the/new/cow') # Start test self.mox.ReplayAll() diff --git a/nova/virt/libvirt/utils.py b/nova/virt/libvirt/utils.py index f4c6d20a5..bb2051927 100644 --- a/nova/virt/libvirt/utils.py +++ b/nova/virt/libvirt/utils.py @@ -87,7 +87,7 @@ def create_cow_image(backing_file, path): :param path: Desired location of the COW image """ execute('qemu-img', 'create', '-f', 'qcow2', '-o', - 'cluster_size=2M,backing_file=%s' % backing_file, path) + 'backing_file=%s' % backing_file, path) def get_disk_size(path): -- cgit