Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
use warnings;
use strict;
-my @machines = ();
+use JSON;
+
+my $machines = [];
while (<STDIN>) {
if (/^\s*Supported machines are:/) {
s/^\s+//;
my @machine = split(/\s+/);
- next if $machine[0] !~ m/^pc-(i440fx|q35)/;
- push @machines, $machine[0];
+ next if $machine[0] !~ m/^pc-(i440fx|q35)-(.+)$/;
+ push @$machines, {
+ 'id' => $machine[0],
+ 'type' => $1,
+ 'version' => $2,
+ };
}
-die "no QEMU machine types detected from STDIN input" if scalar (@machines) <= 0;
+die "no QEMU machine types detected from STDIN input" if scalar (@$machines) <= 0;
-print join("\n", @machines) or die "$!\n";
+print to_json($machines, { utf8 => 1 }) or die "$!\n";
destdir := $(CURDIR)/debian/$(PACKAGE)
flagfile := $(destdir)/usr/share/kvm/recognized-CPUID-flags-x86_64
-machinefile := $(destdir)/usr/share/kvm/machine-versions-x86_64
+machinefile := $(destdir)/usr/share/kvm/machine-versions-x86_64.json
# default QEMU out-of-tree build directory is ./build
BUILDDIR=build