machine list: save as JSON
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
40e6b6e5a5
commit
6503e6e08d
16
debian/parse-machines.pl
vendored
16
debian/parse-machines.pl
vendored
@ -3,7 +3,9 @@
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
my @machines = ();
|
||||
use JSON;
|
||||
|
||||
my $machines = [];
|
||||
|
||||
while (<STDIN>) {
|
||||
if (/^\s*Supported machines are:/) {
|
||||
@ -12,10 +14,14 @@ while (<STDIN>) {
|
||||
|
||||
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";
|
||||
|
2
debian/rules
vendored
2
debian/rules
vendored
@ -22,7 +22,7 @@ PACKAGE=pve-qemu-kvm
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user