Skip to content

Commit

Permalink
Merge pull request autotest#5462 from Yingshun/sk_vdpa_save
Browse files Browse the repository at this point in the history
vDPA: Add libvirt version check for save/restore
  • Loading branch information
chunfuwen authored Mar 4, 2024
2 parents 1836fc0 + 647f3ae commit 8bc7456
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
only x86_64
func_supported_since_libvirt_ver = (7, 3, 0)
func_supported_since_qemu_kvm_ver = (6, 0, 0)
save_supported_ver = (8, 5, 0)
iface_dict = {"source": {'dev':'/dev/vhost-vdpa-0'}}
variants test_target:
- simulator:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,17 @@ def run_test(dev_type, params, test_obj=None):
check_points.check_network_accessibility(
vm, test_obj=test_obj, config_vdpa=True, **params)

test.log.info("Save the VM.")
save_path = os.path.join(data_dir.get_tmp_dir(), vm.name + '.save')
virsh.save(vm.name, save_path, **VIRSH_ARGS)
test.log.info("Restore vm.")
virsh.restore(save_path, **VIRSH_ARGS)
check_points.check_network_accessibility(
vm, test_obj=test_obj, config_vdpa=False, **params)
save_supported_ver = {
'func_supported_since_libvirt_ver': params.get('save_supported_ver',
'(8,5,0)')}
if libvirt_version.is_libvirt_feature_supported(save_supported_ver, True):
test.log.info("Save the VM.")
save_path = os.path.join(data_dir.get_tmp_dir(), vm.name + '.save')
virsh.save(vm.name, save_path, **VIRSH_ARGS)
test.log.info("Restore vm.")
virsh.restore(save_path, **VIRSH_ARGS)
check_points.check_network_accessibility(
vm, test_obj=test_obj, config_vdpa=False, **params)

test.log.info("Suspend and resume the vm.")
virsh.suspend(vm.name, **VIRSH_ARGS)
Expand Down

0 comments on commit 8bc7456

Please sign in to comment.