From d1bc92fdbd3aa42b15beeb5eaf2987365247cfa2 Mon Sep 17 00:00:00 2001 From: Alvaro Lopez Garcia Date: Wed, 15 Feb 2012 11:47:28 +0100 Subject: Fix bug 929427 We ensure that we are getting the info from a QCOW2 image, not anything else. Change-Id: I8b6bd504da8d52bb9902c917360f0465f9002551 --- nova/virt/libvirt/connection.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nova/virt/libvirt/connection.py b/nova/virt/libvirt/connection.py index c3bfdedda..833faff1f 100644 --- a/nova/virt/libvirt/connection.py +++ b/nova/virt/libvirt/connection.py @@ -2005,11 +2005,7 @@ class LibvirtConnection(driver.ComputeDriver): continue disk_type = driver_nodes[cnt].get('type') - if disk_type == 'raw': - dk_size = int(os.path.getsize(path)) - backing_file = "" - virt_size = 0 - else: + if disk_type == "qcow2": out, err = utils.execute('qemu-img', 'info', path) # virtual size: @@ -2022,6 +2018,10 @@ class LibvirtConnection(driver.ComputeDriver): # backing file:(actual path:) backing_file = libvirt_utils.get_disk_backing_file(path) + else: + dk_size = int(os.path.getsize(path)) + backing_file = "" + virt_size = 0 disk_info.append({'type': disk_type, 'path': path, -- cgit