5
0
mirror of git://git.proxmox.com/git/pve-qemu.git synced 2024-12-25 01:34:31 +03:00
pve-qemu/debian/parse-cpu-flags.pl
Thomas Lamprecht 376d9ce806 Write recognized CPUID flags into static file
located at /usr/share/kvm/recognized-CPUID-flags-x86_64

It's a simple one flag per line list of all flags the build of QEMU
can understand for x86_64 CPUs.

It will be used in qemu-server for the custom CPU model feature.

For now, only x86_64 is implemented, since aarch64 doesn't print any flags when
called this way.

Co-developed-by: Stefan Reiter <s.reiter@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-10-17 13:39:21 +02:00

24 lines
384 B
Perl
Executable File

#!/usr/bin/perl
use warnings;
use strict;
my @flags = ();
my $got_flags_section;
while (<STDIN>) {
if (/^\s*Recognized CPUID flags:/) {
$got_flags_section = 1;
next;
}
next if !$got_flags_section;
s/^\s+//;
push @flags, split(/\s+/);
}
die "no QEMU/KVM CPU flags detected from STDIN input" if scalar (@flags) <= 0;
print join("\n", @flags) or die "$!\n";