[libvirt PATCH 0/3] Small tweaks to cpu-gather.py script

Jiri Denemark (3): cpu-gather: Remove redundant "processor" from CPU data file names cpu_map: Suggest better command for updating test data files cpu-gather: Rename the script as cpu-data.py src/cpu_map/x86_features.xml | 5 ++--- tests/cputestdata/{cpu-gather.py => cpu-data.py} | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) rename tests/cputestdata/{cpu-gather.py => cpu-data.py} (99%) -- 2.30.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/cputestdata/cpu-gather.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cputestdata/cpu-gather.py b/tests/cputestdata/cpu-gather.py index f679fb9066..b8c1f23c82 100755 --- a/tests/cputestdata/cpu-gather.py +++ b/tests/cputestdata/cpu-gather.py @@ -237,7 +237,7 @@ def parse_filename(data): filename = re.sub("\\(([Rr]|[Tt][Mm])\\)", "", filename) filename = re.sub(".*(Intel|AMD) ", "", filename) filename = re.sub(" (Duo|Quad|II X[0-9]+)", " ", filename) - filename = re.sub(" (CPU|Processor)", "", filename) + filename = re.sub(" (CPU|[Pp]rocessor)", "", filename) filename = re.sub(" @.*", "", filename) filename = re.sub(" APU .*", "", filename) filename = re.sub(" SE$", "", filename) -- 2.30.0

cpu-cpuid.py was merged into cpu-gather.py and the script can handle multiple files so there's no need for a loop around it. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/cpu_map/x86_features.xml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/cpu_map/x86_features.xml b/src/cpu_map/x86_features.xml index 4836595a8c..01a777e0e8 100644 --- a/src/cpu_map/x86_features.xml +++ b/src/cpu_map/x86_features.xml @@ -1,9 +1,8 @@ <!-- After adding new features, update existing test files with - for json in tests/cputestdata/x86_64-cpuid-*.json; do - tests/cputestdata/cpu-cpuid.py diff $json - done + tests/cputestdata/cpu-gather.py diff tests/cputestdata/x86_64-cpuid-*.json + --> <cpus> <!-- standard features, EDX --> -- 2.30.0

It is now doing way more than gathering the CPU data from a host as the other scripts were merged in it. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/cpu_map/x86_features.xml | 2 +- tests/cputestdata/{cpu-gather.py => cpu-data.py} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename tests/cputestdata/{cpu-gather.py => cpu-data.py} (99%) diff --git a/src/cpu_map/x86_features.xml b/src/cpu_map/x86_features.xml index 01a777e0e8..5cfa07502a 100644 --- a/src/cpu_map/x86_features.xml +++ b/src/cpu_map/x86_features.xml @@ -1,7 +1,7 @@ <!-- After adding new features, update existing test files with - tests/cputestdata/cpu-gather.py diff tests/cputestdata/x86_64-cpuid-*.json + tests/cputestdata/cpu-data.py diff tests/cputestdata/x86_64-cpuid-*.json --> <cpus> diff --git a/tests/cputestdata/cpu-gather.py b/tests/cputestdata/cpu-data.py similarity index 99% rename from tests/cputestdata/cpu-gather.py rename to tests/cputestdata/cpu-data.py index b8c1f23c82..a41f1d025c 100755 --- a/tests/cputestdata/cpu-gather.py +++ b/tests/cputestdata/cpu-data.py @@ -455,7 +455,7 @@ def main(): help="Reads data from stdin and parses data for libvirt use.") subparsers.add_parser( "full", - help="Equivalent to `cpu-gather gather | cpu-gather parse`.") + help="Equivalent to `cpu-data.py gather | cpu-data.py parse`.") diffparser = subparsers.add_parser( "diff", help="Diff json description of CPU model against known features.") -- 2.30.0

On Fri, Jan 08, 2021 at 00:03:08 +0100, Jiri Denemark wrote:
Jiri Denemark (3): cpu-gather: Remove redundant "processor" from CPU data file names cpu_map: Suggest better command for updating test data files cpu-gather: Rename the script as cpu-data.py
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

On Fri, 2021-01-08 at 00:03 +0100, Jiri Denemark wrote:
Jiri Denemark (3): cpu-gather: Remove redundant "processor" from CPU data file names cpu_map: Suggest better command for updating test data files cpu-gather: Rename the script as cpu-data.py
src/cpu_map/x86_features.xml | 5 ++--- tests/cputestdata/{cpu-gather.py => cpu-data.py} | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) rename tests/cputestdata/{cpu-gather.py => cpu-data.py} (99%)
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
participants (3)
-
Jiri Denemark
-
Peter Krempa
-
Tim Wiederhake