summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlvaro Lopez Garcia <aloga@ifca.unican.es>2012-02-15 11:47:28 +0100
committerAlvaro Lopez Garcia <aloga@ifca.unican.es>2012-02-16 09:29:25 +0100
commitd1bc92fdbd3aa42b15beeb5eaf2987365247cfa2 (patch)
treee587909a578627cbf4fdecd40b97de3a8121fd89
parentf5e17bbc155203feb8bba4f34ed93d22b1b8e95b (diff)
downloadnova-d1bc92fdbd3aa42b15beeb5eaf2987365247cfa2.tar.gz
nova-d1bc92fdbd3aa42b15beeb5eaf2987365247cfa2.tar.xz
nova-d1bc92fdbd3aa42b15beeb5eaf2987365247cfa2.zip
Fix bug 929427
We ensure that we are getting the info from a QCOW2 image, not anything else. Change-Id: I8b6bd504da8d52bb9902c917360f0465f9002551
-rw-r--r--nova/virt/libvirt/connection.py10
1 files 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,