Skip to content

Commit

Permalink
restore logic to force qcow2 image type when creating disk image with…
Browse files Browse the repository at this point in the history
… a backing store

This was in the original version of the backing_store feature but seems to
have gotten lost in one of the refactors during the 0.12 cycle.  This simply
restores the old behavior.  Interestingly, without this libvirt will still
create the new disk image but it seems to contain invalid data.
  • Loading branch information
imcleod authored and clalancette committed Feb 4, 2014
1 parent 0038342 commit e68f660
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion oz/Guest.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,11 @@ def _internal_generate_diskimage(self, size=10, force=False,
self.lxml_subelement(vol, "name", filename)
self.lxml_subelement(vol, "allocation", "0")
target = self.lxml_subelement(vol, "target")
self.lxml_subelement(target, "format", None, {"type":self.image_type})
if backing_filename:
# Only qcow2 supports image creation using a backing file
self.lxml_subelement(target, "format", None, {"type":"qcow2"})
else:
self.lxml_subelement(target, "format", None, {"type":self.image_type})
# FIXME: this makes the permissions insecure, but is needed since
# libvirt launches guests as qemu:qemu
permissions = self.lxml_subelement(target, "permissions")
Expand Down

0 comments on commit e68f660

Please sign in to comment.