summaryrefslogtreecommitdiff
path: root/nova/virt/libvirt/driver.py
diff options
context:
space:
mode:
Diffstat (limited to 'nova/virt/libvirt/driver.py')
-rw-r--r--nova/virt/libvirt/driver.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py
index 5d1caf34f6..da98829453 100644
--- a/nova/virt/libvirt/driver.py
+++ b/nova/virt/libvirt/driver.py
@@ -2880,7 +2880,16 @@ class LibvirtDriver(driver.ComputeDriver):
# If the rebased image is going to have a backing file then
# explicitly set the backing file format to avoid any security
# concerns related to file format auto detection.
- backing_file = rebase_base
+ if os.path.isabs(rebase_base):
+ backing_file = rebase_base
+ else:
+ # this is a probably a volume snapshot case where the
+ # rebase_base is relative. See bug
+ # https://bugs.launchpad.net/nova/+bug/1885528
+ backing_file_name = os.path.basename(rebase_base)
+ volume_path = os.path.dirname(source_path)
+ backing_file = os.path.join(volume_path, backing_file_name)
+
b_file_fmt = images.qemu_img_info(backing_file).file_format
qemu_img_extra_arg = ['-F', b_file_fmt]