-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
memory_nvdimm: Fix cpu mode to enable test for aarch64 #5378
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Others LGTM
libvirt/tests/src/memory/nvdimm.py
Outdated
virsh.snapshot_create_as(vm_name, vm_s1, ignore_status=False, debug=True) | ||
virsh.snapshot_revert(vm_name, vm_s1, ignore_status=False, debug=True) | ||
virsh.snapshot_delete(vm_name, vm_s1, ignore_status=False, debug=True) | ||
if platform.machine() == 'aarch64': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to use external snapshot instead of simply skipping the steps. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert to external snapshot not supported yet
# virsh snapshot-create-as avocado-vt-vm1 avocado-vt-vm1.s1 --disk-only
Domain snapshot avocado-vt-vm1.s1 created
# virsh snapshot-revert avocado-vt-vm1 avocado-vt-vm1.s1
error: unsupported configuration: revert to external snapshot not supported yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just skip snapshot-revert for external snapshots?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed with feature owner and the decision is we accept the unsupported result in the codes as pass and also keep delete snapshot step.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
For external dish snapshot on ARM
On xxxx-8, both revert and delete are not supported
On xxxx-9, since 9.10.0, both revert and delete are supported, but if the guest is on, the revert will be refused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
0a645ad
to
c5f1efe
Compare
libvirt/tests/src/memory/nvdimm.py
Outdated
if not re.search(error_msg_1, revert_result.stderr) \ | ||
and not re.search(error_msg_2, revert_result.stderr): | ||
test.fail("The error '{}' or '{}' should be in the output \n'{}'" % | ||
format(error_msg_1, error_msg_2, revert_result.stderr)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From line 347 to 357, we could use libvirt.check_result( revert_result, expected_fails=[error_msg_1, error_msg_2])
libvirt/tests/src/memory/nvdimm.py
Outdated
virsh.snapshot_delete(vm_name, "%s --metadata" % vm_s1, ignore_status=False, debug=True) | ||
domxml = virsh.dumpxml(vm_name).stdout.strip() | ||
xtf_dom = xml_utils.XMLTreeFile(domxml) | ||
snap_file_path = xtf_dom.find("devices/disk/source").get("file") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To get the disk source, you might use libvirt_disk.get_first_disk_source(vm)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
libvirt/tests/src/memory/nvdimm.py
Outdated
if os.path.exists(snap_file_path): | ||
os.remove(snap_file_path) | ||
else: | ||
virsh.snapshot_create_as(vm_name, vm_s1, ignore_status=False, debug=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you help also update with
virsh.snapshot_create_as(vm_name, "%s --disk-only" % vm_s1,
ignore_status=False, debug=True)
```for x86_64?
Someone will help to test it on x86_64. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
578d0d7
to
4da8556
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
libvirt/tests/src/memory/nvdimm.py
Outdated
virsh.snapshot_revert(vm_name, vm_s1, ignore_status=False, debug=True) | ||
virsh.snapshot_delete(vm_name, vm_s1, ignore_status=False, debug=True) | ||
if platform.machine() == 'aarch64': | ||
virsh.snapshot_create_as(vm_name, "%s --disk-only" % vm_s1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After I tested on x86_64, the error message is same with on aarch64. That is to say, these operations are arch independant.
So could you remove the arch checking and just keep line 344 to line 355?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, PTAL.
The cpu mode is host-passthrough for arm. Internal snapshots of a VM with pflash based firmware are not supported on arm, so skip this check on arm. Signed-off-by: Hu Shuai <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The cpu mode is host-passthrough for arm.
Internal snapshots of a VM with pflash based firmware are not supported on arm, so skip this check on arm
The following is the test result on arm, the failed two cases are because arm does not support and they have been skipped in libvirt-ci: