Skip to content
Snippets Groups Projects
Commit 546ad089 authored by Timmy Chan's avatar Timmy Chan
Browse files

Fix kernel version bug

parent 7382bf0d
Branches
No related tags found
1 merge request!5Feat/cve linux kernel
...@@ -96,7 +96,12 @@ def get_kernel_release_number(kernel_version): ...@@ -96,7 +96,12 @@ def get_kernel_release_number(kernel_version):
Return a version number string that is a valid kernel release (hopefully) Return a version number string that is a valid kernel release (hopefully)
Replace all "x" in the number with "1". Replace all "x" in the number with "1".
Replace ".0" ending with ".1"
This could fail in the rare case where there is a new kernel, without version 1 This could fail in the rare case where there is a new kernel, without version 1
FIXME: Use qemu.utils.get_kernel_version_table() to get a 100% valid version number FIXME: Use qemu.utils.get_kernel_version_table() to get a 100% valid version number
""" """
return re.sub('x', '1', kernel_version) result = re.sub('x', '1', kernel_version)
if result[-2:] == ".0":
result = result[:-2] + ".1"
return result
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment