Skip to content

Commit

Permalink
Merge pull request #6118 from liang-cong-red-hat/multidisks_minimal_d…
Browse files Browse the repository at this point in the history
…omain_aarch64_adaption

Add aarch64 adaption for minimal domain disk attach
  • Loading branch information
dzhengfy authored Jan 9, 2025
2 parents fbda0a6 + 7f259b9 commit eca2264
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
7 changes: 7 additions & 0 deletions libvirt/tests/cfg/virtual_disks/virtual_disks_multidisks.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,13 @@
- disk_attach_with_minimal_xml:
only coldplug
test_minimal_xml = "yes"
memory_size = "1048576"
curr_mem_size = "1048576"
aarch64:
cpu_model_xml = "<cpu mode='host-passthrough' check='none'/>"
aarch64_machine_type = "virt"
memory_size = "4194304"
curr_mem_size = "4194304"
disks_attach_option = "--live"
virt_disk_device = "disk"
virt_disk_device_source = "disk_minimal"
Expand Down
18 changes: 15 additions & 3 deletions libvirt/tests/src/virtual_disks/virtual_disks_multidisks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1117,19 +1117,25 @@ def check_info_in_libvird_log_file(matchedMsg=None):

# For minimal VM xml,it need reconstruct one.
if test_minimal_xml:
cpu_model_xml = params.get("cpu_model_xml", "")
aarch64_machine_type = params.get("aarch64_machine_type")
memory_size = params.get("memory_size", "1048576")
curr_mem_size = params.get("curr_mem_size", "1048576")
minimal_vm_xml = vm_xml.VMXML.new_from_inactive_dumpxml(vm_name)
machine_type = aarch64_machine_type if aarch64_machine_type else machine
first_disk = vm.get_first_disk_devices()
first_disk_source = first_disk['source']
minimal_vm_xml_file = minimal_vm_xml.xml
minimal_xml_content = """<domain type='kvm'>
<name>%s</name>
<memory unit='KiB'>1048576</memory>
<currentMemory unit='KiB'>1048576</currentMemory>
<memory unit='KiB'>%s</memory>
<currentMemory unit='KiB'>%s</currentMemory>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='%s' machine='%s'>hvm</type>
<boot dev='hd'/>
</os>
%s
<devices>
<emulator>/usr/libexec/qemu-kvm</emulator>
<disk type='file' device='disk'>
Expand All @@ -1138,7 +1144,13 @@ def check_info_in_libvird_log_file(matchedMsg=None):
<target dev='vda' bus='virtio'/>
</disk>
</devices>
</domain>""" % (vm_name, arch, machine, first_disk_source)
</domain>""" % (vm_name,
memory_size,
curr_mem_size,
arch,
machine_type,
cpu_model_xml,
first_disk_source)
with open(minimal_vm_xml_file, 'w') as xml_file:
xml_file.seek(0)
xml_file.truncate()
Expand Down

0 comments on commit eca2264

Please sign in to comment.