]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
cpu-data.py: Automatically adjust command line for kcpuid
authorTim Wiederhake <twiederh@redhat.com>
Tue, 27 Apr 2021 08:25:03 +0000 (10:25 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 7 May 2021 16:02:48 +0000 (18:02 +0200)
kcpuid does not have a "-1" flag.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
tests/cputestdata/cpu-data.py

index 4305aacf35fe849f855896a9979765c7578e8903..d8a89ebc2a9c22ad323f2ad49be76182a3883052 100755 (executable)
@@ -116,7 +116,7 @@ def gather_cpuid_leaves(args):
     cpuid = args.path_to_cpuid or "cpuid"
     try:
         output = subprocess.check_output(
-            [cpuid, "-1r"],
+            [cpuid, "-r" if "kcpuid" in cpuid else "-1r"],
             universal_newlines=True)
     except FileNotFoundError as e:
         exit("Error: '{}' not found.\n'cpuid' can be usually found in a "