Skip to content

Commit

Permalink
Merge pull request #5027 from meinaLi/chain_raw_file
Browse files Browse the repository at this point in the history
backingchain: add new test scenario for raw format
  • Loading branch information
Yingshun authored Aug 3, 2023
2 parents bb13c66 + d999a15 commit e585ee5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@
top_image_suffix = 3
expected_chain = "4>base"
variants:
- file_disk:
- file_disk_qcow2:
disk_type = "file"
disk_dict = {"type_name":"${disk_type}", "target":{"dev": "${target_disk}", "bus": "virtio"}, "driver": {"name": "qemu", "type":"qcow2"}}
- file_disk_raw:
disk_type = "file"
disk_image_format = "raw"
disk_dict = {"type_name":"${disk_type}", "target":{"dev": "${target_disk}", "bus": "virtio"}, "driver": {"name": "qemu", "type":"raw"}}
- block_disk:
disk_type = "block"
disk_dict = {"type_name":"${disk_type}", "target":{"dev": "${target_disk}", "bus": "virtio"}, "driver": {"name": "qemu", "type":"raw"}}
Expand Down
4 changes: 2 additions & 2 deletions provider/virtual_disk/disk_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ def prepare_disk_obj(self, disk_type, disk_dict, new_image_path='', **kwargs):
size = kwargs.get("size", "50M")
if kwargs.get("size"):
kwargs.pop("size")
libvirt.create_local_disk("file", path=new_image_path,
size=size, disk_format="qcow2",
libvirt.create_local_disk("file", path=new_image_path, size=size,
disk_format=self.params.get("disk_image_format", 'qcow2'),
**kwargs)
disk_dict.update({'source': {'attrs': {'file': new_image_path}}})

Expand Down

0 comments on commit e585ee5

Please sign in to comment.